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

Unified Diff: chrome/browser/ui/views/ash/launcher/launcher_context_menu.cc

Issue 10534142: Add support for pinning platform apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed review issue. Created 8 years, 6 months 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/views/ash/launcher/launcher_context_menu.cc
diff --git a/chrome/browser/ui/views/ash/launcher/launcher_context_menu.cc b/chrome/browser/ui/views/ash/launcher/launcher_context_menu.cc
index 083ce174c68c16153c72c43cc81f03a33e1c070c..75cf697b5f31c89b175ca88797f34fc5af6b33af 100644
--- a/chrome/browser/ui/views/ash/launcher/launcher_context_menu.cc
+++ b/chrome/browser/ui/views/ash/launcher/launcher_context_menu.cc
@@ -54,6 +54,11 @@ LauncherContextMenu::LauncherContextMenu(ChromeLauncherController* controller,
}
} else {
AddItem(MENU_OPEN, controller->GetTitle(item_));
+ if (item_.type == ash::TYPE_PLATFORM_APP) {
+ AddItem(
+ MENU_PIN,
+ l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_PIN));
+ }
if (controller->IsOpen(item_.id)) {
AddItem(MENU_CLOSE,
l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE));
@@ -98,7 +103,8 @@ bool LauncherContextMenu::IsCommandIdChecked(int command_id) const {
bool LauncherContextMenu::IsCommandIdEnabled(int command_id) const {
switch (command_id) {
case MENU_PIN:
- return controller_->IsPinnable(item_.id);
+ return item_.type == ash::TYPE_PLATFORM_APP ||
+ controller_->IsPinnable(item_.id);
default:
return true;
}

Powered by Google App Engine
This is Rietveld 408576698