From 92d6fd641f69585f98f7e214165090e50f717b89 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 7 Aug 2014 14:14:43 +0800 Subject: [PATCH] views: Hide menu bar when web view is clicked. --- atom/browser/native_window_views.cc | 7 +++++++ atom/browser/native_window_views.h | 1 + 2 files changed, 8 insertions(+) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index bf58b2094dc3..75b8d556870d 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 d4292191c7bd..0381a9bd05e9 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;