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

Unified Diff: chrome/browser/ui/ash/launcher/launcher_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: chrome/browser/ui/ash/launcher/launcher_context_menu.cc
diff --git a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
index d45b703eae9c286ed82cf477ec9d17f335bffe1d..3e1b754f0ac7d8f6a42bf6613234e4db75dcf167 100644
--- a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
+++ b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
@@ -175,8 +175,8 @@ bool LauncherContextMenu::IsCommandIdChecked(int command_id) const {
return controller_->GetLaunchType(item_.id) ==
extensions::ExtensionPrefs::LAUNCH_FULLSCREEN;
case MENU_AUTO_HIDE:
- return ash::Shell::GetInstance()->IsShelfAutoHideMenuHideChecked(
- root_window_);
+ return controller_->GetShelfAutoHideBehavior(root_window_) ==
+ ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS;
default:
return extension_items_->IsCommandIdChecked(command_id);
}
@@ -194,6 +194,8 @@ bool LauncherContextMenu::IsCommandIdEnabled(int command_id) const {
// "Normal" windows are not allowed when incognito is enforced.
return IncognitoModePrefs::GetAvailability(
controller_->profile()->GetPrefs()) != IncognitoModePrefs::FORCED;
+ case MENU_AUTO_HIDE:
+ return controller_->CanUserModifyShelfAutoHideBehavior(root_window_);
case MENU_NEW_INCOGNITO_WINDOW:
// Incognito windows are not allowed when incognito is disabled.
return IncognitoModePrefs::GetAvailability(
@@ -237,10 +239,7 @@ void LauncherContextMenu::ExecuteCommand(int command_id) {
extensions::ExtensionPrefs::LAUNCH_FULLSCREEN);
break;
case MENU_AUTO_HIDE:
- controller_->SetAutoHideBehavior(
- ash::Shell::GetInstance()->GetToggledShelfAutoHideBehavior(
- root_window_),
- root_window_);
+ controller_->ToggleShelfAutoHideBehavior(root_window_);
break;
case MENU_NEW_WINDOW:
controller_->CreateNewWindow();

Powered by Google App Engine
This is Rietveld 408576698