views: Hide menu bar when web view is clicked.

This commit is contained in:
Cheng Zhao 2014-08-07 14:14:43 +08:00
parent f219e7f0dd
commit 92d6fd641f
2 changed files with 8 additions and 0 deletions

View file

@ -537,6 +537,13 @@ views::NonClientFrameView* NativeWindowViews::CreateNonClientFrameView(
return NULL; return NULL;
} }
void NativeWindowViews::HandleMouseDown() {
if (menu_bar_autohide_ && menu_bar_show_) {
SetMenuBarVisibility(false);
Layout();
}
}
void NativeWindowViews::HandleKeyboardEvent( void NativeWindowViews::HandleKeyboardEvent(
content::WebContents*, content::WebContents*,
const content::NativeWebKeyboardEvent& event) { const content::NativeWebKeyboardEvent& event) {

View file

@ -107,6 +107,7 @@ class NativeWindowViews : public NativeWindow,
views::Widget* widget) OVERRIDE; views::Widget* widget) OVERRIDE;
// content::WebContentsDelegate: // content::WebContentsDelegate:
virtual void HandleMouseDown() OVERRIDE;
virtual void HandleKeyboardEvent( virtual void HandleKeyboardEvent(
content::WebContents*, content::WebContents*,
const content::NativeWebKeyboardEvent& event) OVERRIDE; const content::NativeWebKeyboardEvent& event) OVERRIDE;