]> khamidou — GitHub mirrors - electron.git/commitdiff
menu_bar_show_ => menu_bar_visible_
authorCheng Zhao <zcbenz@gmail.com>
Thu, 7 Aug 2014 08:48:30 +0000 (16:48 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 7 Aug 2014 08:48:30 +0000 (16:48 +0800)
atom/browser/native_window_views.cc
atom/browser/native_window_views.h

index 1d7957f9f24f1c704e1afe42144c97cd35fdbc33..26697f0dcba3a2bf553a12753f8071872b9003b4 100644 (file)
@@ -112,7 +112,7 @@ NativeWindowViews::NativeWindowViews(content::WebContents* web_contents,
       window_(new views::Widget),
       web_view_(inspectable_web_contents()->GetView()->GetView()),
       menu_bar_autohide_(false),
-      menu_bar_show_(false),
+      menu_bar_visible_(false),
       menu_bar_alt_pressed_(false),
       keyboard_event_handler_(new views::UnhandledKeyboardEventHandler),
       use_content_size_(false),
@@ -261,7 +261,7 @@ gfx::Size NativeWindowViews::GetContentSize() {
 
   gfx::Size content_size =
       window_->non_client_view()->frame_view()->GetBoundsForClientView().size();
-  if (menu_bar_ && menu_bar_show_)
+  if (menu_bar_ && menu_bar_visible_)
     content_size.set_height(content_size.height() - kMenuBarHeight);
   return content_size;
 }
@@ -461,7 +461,7 @@ void NativeWindowViews::OnWidgetActivationChanged(
     GetWebContents()->Focus();
 
   // Hide menu bar when window is blured.
-  if (!active && menu_bar_autohide_ && menu_bar_show_) {
+  if (!active && menu_bar_autohide_ && menu_bar_visible_) {
     SetMenuBarVisibility(false);
     Layout();
   }
@@ -559,7 +559,7 @@ views::NonClientFrameView* NativeWindowViews::CreateNonClientFrameView(
 
 void NativeWindowViews::HandleMouseDown() {
   // Hide menu bar when web view is clicked.
-  if (menu_bar_autohide_ && menu_bar_show_) {
+  if (menu_bar_autohide_ && menu_bar_visible_) {
     SetMenuBarVisibility(false);
     Layout();
   }
@@ -577,7 +577,7 @@ void NativeWindowViews::HandleKeyboardEvent(
              event.modifiers == 0 && menu_bar_alt_pressed_) {
     // When a single Alt is released right after a Alt is pressed:
     menu_bar_alt_pressed_ = false;
-    SetMenuBarVisibility(!menu_bar_show_);
+    SetMenuBarVisibility(!menu_bar_visible_);
     Layout();
   } else {
     // When any other keys except single Alt have been pressed/released:
@@ -613,7 +613,7 @@ gfx::Rect NativeWindowViews::ContentBoundsToWindowBounds(
     const gfx::Rect& bounds) {
   gfx::Rect window_bounds =
       window_->non_client_view()->GetWindowBoundsForClientBounds(bounds);
-  if (menu_bar_ && menu_bar_show_)
+  if (menu_bar_ && menu_bar_visible_)
     window_bounds.set_height(window_bounds.height() + kMenuBarHeight);
   return window_bounds;
 }
@@ -622,7 +622,7 @@ void NativeWindowViews::SetMenuBarVisibility(bool visible) {
   if (!menu_bar_)
     return;
 
-  menu_bar_show_ = visible;
+  menu_bar_visible_ = visible;
   if (visible) {
     DCHECK_EQ(child_count(), 1);
     AddChildView(menu_bar_.get());
index ba3007e8d923aba60161feae201418580cba2523..17fd315f5459a72c47325d0c69ae479a489145d1 100644 (file)
@@ -130,7 +130,7 @@ class NativeWindowViews : public NativeWindow,
 
   scoped_ptr<MenuBar> menu_bar_;
   bool menu_bar_autohide_;
-  bool menu_bar_show_;
+  bool menu_bar_visible_;
   bool menu_bar_alt_pressed_;
 
 #if defined(USE_X11)