menu_bar_show_ => menu_bar_visible_
This commit is contained in:
parent
58a09f6495
commit
8cc49ffa80
2 changed files with 8 additions and 8 deletions
|
@ -112,7 +112,7 @@ NativeWindowViews::NativeWindowViews(content::WebContents* web_contents,
|
||||||
window_(new views::Widget),
|
window_(new views::Widget),
|
||||||
web_view_(inspectable_web_contents()->GetView()->GetView()),
|
web_view_(inspectable_web_contents()->GetView()->GetView()),
|
||||||
menu_bar_autohide_(false),
|
menu_bar_autohide_(false),
|
||||||
menu_bar_show_(false),
|
menu_bar_visible_(false),
|
||||||
menu_bar_alt_pressed_(false),
|
menu_bar_alt_pressed_(false),
|
||||||
keyboard_event_handler_(new views::UnhandledKeyboardEventHandler),
|
keyboard_event_handler_(new views::UnhandledKeyboardEventHandler),
|
||||||
use_content_size_(false),
|
use_content_size_(false),
|
||||||
|
@ -261,7 +261,7 @@ gfx::Size NativeWindowViews::GetContentSize() {
|
||||||
|
|
||||||
gfx::Size content_size =
|
gfx::Size content_size =
|
||||||
window_->non_client_view()->frame_view()->GetBoundsForClientView().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);
|
content_size.set_height(content_size.height() - kMenuBarHeight);
|
||||||
return content_size;
|
return content_size;
|
||||||
}
|
}
|
||||||
|
@ -461,7 +461,7 @@ void NativeWindowViews::OnWidgetActivationChanged(
|
||||||
GetWebContents()->Focus();
|
GetWebContents()->Focus();
|
||||||
|
|
||||||
// Hide menu bar when window is blured.
|
// 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);
|
SetMenuBarVisibility(false);
|
||||||
Layout();
|
Layout();
|
||||||
}
|
}
|
||||||
|
@ -559,7 +559,7 @@ views::NonClientFrameView* NativeWindowViews::CreateNonClientFrameView(
|
||||||
|
|
||||||
void NativeWindowViews::HandleMouseDown() {
|
void NativeWindowViews::HandleMouseDown() {
|
||||||
// Hide menu bar when web view is clicked.
|
// Hide menu bar when web view is clicked.
|
||||||
if (menu_bar_autohide_ && menu_bar_show_) {
|
if (menu_bar_autohide_ && menu_bar_visible_) {
|
||||||
SetMenuBarVisibility(false);
|
SetMenuBarVisibility(false);
|
||||||
Layout();
|
Layout();
|
||||||
}
|
}
|
||||||
|
@ -577,7 +577,7 @@ void NativeWindowViews::HandleKeyboardEvent(
|
||||||
event.modifiers == 0 && menu_bar_alt_pressed_) {
|
event.modifiers == 0 && menu_bar_alt_pressed_) {
|
||||||
// When a single Alt is released right after a Alt is pressed:
|
// When a single Alt is released right after a Alt is pressed:
|
||||||
menu_bar_alt_pressed_ = false;
|
menu_bar_alt_pressed_ = false;
|
||||||
SetMenuBarVisibility(!menu_bar_show_);
|
SetMenuBarVisibility(!menu_bar_visible_);
|
||||||
Layout();
|
Layout();
|
||||||
} else {
|
} else {
|
||||||
// When any other keys except single Alt have been pressed/released:
|
// When any other keys except single Alt have been pressed/released:
|
||||||
|
@ -613,7 +613,7 @@ gfx::Rect NativeWindowViews::ContentBoundsToWindowBounds(
|
||||||
const gfx::Rect& bounds) {
|
const gfx::Rect& bounds) {
|
||||||
gfx::Rect window_bounds =
|
gfx::Rect window_bounds =
|
||||||
window_->non_client_view()->GetWindowBoundsForClientBounds(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);
|
window_bounds.set_height(window_bounds.height() + kMenuBarHeight);
|
||||||
return window_bounds;
|
return window_bounds;
|
||||||
}
|
}
|
||||||
|
@ -622,7 +622,7 @@ void NativeWindowViews::SetMenuBarVisibility(bool visible) {
|
||||||
if (!menu_bar_)
|
if (!menu_bar_)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
menu_bar_show_ = visible;
|
menu_bar_visible_ = visible;
|
||||||
if (visible) {
|
if (visible) {
|
||||||
DCHECK_EQ(child_count(), 1);
|
DCHECK_EQ(child_count(), 1);
|
||||||
AddChildView(menu_bar_.get());
|
AddChildView(menu_bar_.get());
|
||||||
|
|
|
@ -130,7 +130,7 @@ class NativeWindowViews : public NativeWindow,
|
||||||
|
|
||||||
scoped_ptr<MenuBar> menu_bar_;
|
scoped_ptr<MenuBar> menu_bar_;
|
||||||
bool menu_bar_autohide_;
|
bool menu_bar_autohide_;
|
||||||
bool menu_bar_show_;
|
bool menu_bar_visible_;
|
||||||
bool menu_bar_alt_pressed_;
|
bool menu_bar_alt_pressed_;
|
||||||
|
|
||||||
#if defined(USE_X11)
|
#if defined(USE_X11)
|
||||||
|
|
Loading…
Reference in a new issue