From: Cheng Zhao Date: Thu, 7 Aug 2014 06:14:43 +0000 (+0800) Subject: views: Hide menu bar when web view is clicked. X-Git-Tag: v0.15.4~2^2~7 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=92d6fd641f69585f98f7e214165090e50f717b89;p=electron.git views: Hide menu bar when web view is clicked. --- diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index bf58b209..75b8d556 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -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) { diff --git a/atom/browser/native_window_views.h b/atom/browser/native_window_views.h index d4292191..0381a9bd 100644 --- a/atom/browser/native_window_views.h +++ b/atom/browser/native_window_views.h @@ -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;