]> khamidou — GitHub mirrors - electron.git/commitdiff
views: Hide menu bar when web view is clicked.
authorCheng Zhao <zcbenz@gmail.com>
Thu, 7 Aug 2014 06:14:43 +0000 (14:14 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 7 Aug 2014 06:14:43 +0000 (14:14 +0800)
atom/browser/native_window_views.cc
atom/browser/native_window_views.h

index bf58b2094dc3771464b7d49387d13c412537e64f..75b8d556870de93663b36206a9d9b335a2635763 100644 (file)
@@ -537,6 +537,13 @@ views::NonClientFrameView* NativeWindowViews::CreateNonClientFrameView(
   return NULL;
 }
 
+void NativeWindowViews::HandleMouseDown() {
+  if (menu_bar_autohide_ && menu_bar_show_) {
+    SetMenuBarVisibility(false);
+    Layout();
+  }
+}
+
 void NativeWindowViews::HandleKeyboardEvent(
     content::WebContents*,
     const content::NativeWebKeyboardEvent& event) {
index d4292191c7bdf74f8e5b5e9b6882b589964defdc..0381a9bd05e9529be52825bcb3e57a9b3ee5c916 100644 (file)
@@ -107,6 +107,7 @@ class NativeWindowViews : public NativeWindow,
       views::Widget* widget) OVERRIDE;
 
   // content::WebContentsDelegate:
+  virtual void HandleMouseDown() OVERRIDE;
   virtual void HandleKeyboardEvent(
       content::WebContents*,
       const content::NativeWebKeyboardEvent& event) OVERRIDE;