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

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

Issue 12288012: Showing launcher items for windowed v1 apps - pinned or not. Also - don't show windowed v1 apps in … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing build breakage with clang Created 7 years, 10 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/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 d8ea96aa853eaa5f1e5a803da0414244aa37fafa..af8d5b72acead58cba77b21b356110fa02d2304e 100644
--- a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
+++ b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
@@ -67,8 +67,10 @@ void LauncherContextMenu::Init() {
set_delegate(this);
if (is_valid_item()) {
- if (item_.type == ash::TYPE_APP_SHORTCUT) {
- DCHECK(controller_->IsPinned(item_.id));
+ if (item_.type == ash::TYPE_APP_SHORTCUT ||
+ item_.type == ash::TYPE_WINDOWED_APP) {
+ DCHECK(item_.type == ash::TYPE_APP_SHORTCUT &&
+ controller_->IsPinned(item_.id));
// V1 apps can be started from the menu - but V2 apps should not.
if (!controller_->IsPlatformApp(item_.id)) {
AddItem(MENU_OPEN_NEW, string16());
@@ -76,7 +78,9 @@ void LauncherContextMenu::Init() {
}
AddItem(
MENU_PIN,
- l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_UNPIN));
+ l10n_util::GetStringUTF16(controller_->IsPinned(item_.id) ?
+ IDS_LAUNCHER_CONTEXT_MENU_UNPIN :
+ IDS_LAUNCHER_CONTEXT_MENU_PIN));
if (controller_->IsOpen(item_.id)) {
AddItem(MENU_CLOSE,
l10n_util::GetStringUTF16(IDS_LAUNCHER_CONTEXT_MENU_CLOSE));
@@ -118,6 +122,7 @@ void LauncherContextMenu::Init() {
}
AddSeparator(ui::NORMAL_SEPARATOR);
if (item_.type == ash::TYPE_APP_SHORTCUT ||
+ item_.type == ash::TYPE_WINDOWED_APP ||
item_.type == ash::TYPE_PLATFORM_APP) {
std::string app_id = controller_->GetAppIDForLauncherID(item_.id);
if (!app_id.empty()) {

Powered by Google App Engine
This is Rietveld 408576698