Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4199)

Unified Diff: ash/shell/context_menu.cc

Issue 11418114: Add policy for ash launcher auto-hide behavior (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/shell/context_menu.cc
diff --git a/ash/shell/context_menu.cc b/ash/shell/context_menu.cc
index fe23f20b411414a429aac31026a165bf12fca33c..700563cb83b194fc43637afe2c9126fbf86d3f46 100644
--- a/ash/shell/context_menu.cc
+++ b/ash/shell/context_menu.cc
@@ -33,7 +33,8 @@ ContextMenu::~ContextMenu() {
bool ContextMenu::IsCommandIdChecked(int command_id) const {
switch (command_id) {
case MENU_AUTO_HIDE:
- return Shell::GetInstance()->IsShelfAutoHideMenuHideChecked(root_window_);
+ return Shell::GetInstance()->GetShelfAutoHideBehavior(root_window_) ==
+ ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS;
default:
return false;
}
@@ -50,10 +51,14 @@ bool ContextMenu::GetAcceleratorForCommandId(
}
void ContextMenu::ExecuteCommand(int command_id) {
+ Shell* shell = Shell::GetInstance();
switch (static_cast<MenuItem>(command_id)) {
case MENU_AUTO_HIDE:
- Shell::GetInstance()->SetShelfAutoHideBehavior(
- Shell::GetInstance()->GetToggledShelfAutoHideBehavior(root_window_),
+ shell->SetShelfAutoHideBehavior(
+ shell->GetShelfAutoHideBehavior(root_window_) ==
+ SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS ?
+ SHELF_AUTO_HIDE_BEHAVIOR_NEVER :
+ SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
root_window_);
break;
case MENU_ALIGNMENT_MENU:

Powered by Google App Engine
This is Rietveld 408576698