summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichaelpg@chromium.org <michaelpg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-29 15:25:48 +0000
committermichaelpg@chromium.org <michaelpg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-29 15:25:48 +0000
commitc99dfee7cbd919ec8c5e9d6a86a482694e2e5c12 (patch)
tree0d3922c9e364935f342306d231a9559f432897da
parentfe57f395f65539fae741e2765e371358d13239bc (diff)
downloadchromium_src-c99dfee7cbd919ec8c5e9d6a86a482694e2e5c12.zip
chromium_src-c99dfee7cbd919ec8c5e9d6a86a482694e2e5c12.tar.gz
chromium_src-c99dfee7cbd919ec8c5e9d6a86a482694e2e5c12.tar.bz2
Disable pin/unpin option if enterprise policy sets the list of pinned apps,
rather than hide the option. Also fix the pin option being available for platform apps even when the enterprise policy restricts the list of pinned apps. BUG=285056 Review URL: https://codereview.chromium.org/25046006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225887 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/app_list/app_context_menu.cc17
-rw-r--r--chrome/browser/ui/ash/launcher/launcher_context_menu.cc3
2 files changed, 10 insertions, 10 deletions
diff --git a/chrome/browser/ui/app_list/app_context_menu.cc b/chrome/browser/ui/app_list/app_context_menu.cc
index d5f3e4b..7b103fc 100644
--- a/chrome/browser/ui/app_list/app_context_menu.cc
+++ b/chrome/browser/ui/app_list/app_context_menu.cc
@@ -179,14 +179,15 @@ ui::MenuModel* AppContextMenu::GetMenuModel() {
extension_menu_items_->AppendExtensionItems(app_id_, string16(),
&index);
- if (controller_->CanPin()) {
- menu_model_->AddSeparator(ui::NORMAL_SEPARATOR);
- menu_model_->AddItemWithStringId(
- TOGGLE_PIN,
- controller_->IsAppPinned(app_id_) ?
- IDS_APP_LIST_CONTEXT_MENU_UNPIN :
- IDS_APP_LIST_CONTEXT_MENU_PIN);
- }
+#if defined(USE_ASH)
+ // Always show Pin/Unpin option for ash.
+ menu_model_->AddSeparator(ui::NORMAL_SEPARATOR);
+ menu_model_->AddItemWithStringId(
+ TOGGLE_PIN,
+ controller_->IsAppPinned(app_id_) ?
+ IDS_APP_LIST_CONTEXT_MENU_UNPIN :
+ IDS_APP_LIST_CONTEXT_MENU_PIN);
+#endif
if (controller_->CanDoCreateShortcutsFlow(is_platform_app_)) {
menu_model_->AddItemWithStringId(CREATE_SHORTCUTS,
diff --git a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
index 1d679f0..5302c5c 100644
--- a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
+++ b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
@@ -205,8 +205,7 @@ bool LauncherContextMenu::IsCommandIdChecked(int command_id) const {
bool LauncherContextMenu::IsCommandIdEnabled(int command_id) const {
switch (command_id) {
case MENU_PIN:
- return item_.type == ash::TYPE_PLATFORM_APP ||
- controller_->IsPinnable(item_.id);
+ return controller_->IsPinnable(item_.id);
#if defined(OS_CHROMEOS)
case MENU_CHANGE_WALLPAPER:
return ash::Shell::GetInstance()->user_wallpaper_delegate()->