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

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

Issue 2860503002: mash: Replace int ShelfIDs with AppLaunchID strings. (Closed)
Patch Set: Restore AppLaunchId class via using ShelfID = AppLaunchId; cleanup. Created 3 years, 7 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 a2f2f56e0a093ed111593f5f8143da526005ac91..5934a9127f2efcdcdbca2d0546d10a180a7afd79 100644
--- a/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
+++ b/chrome/browser/ui/ash/launcher/launcher_context_menu.cc
@@ -48,7 +48,7 @@ LauncherContextMenu* LauncherContextMenu::Create(
DCHECK(controller);
DCHECK(wm_shelf);
// Create DesktopShellLauncherContextMenu if no item is selected.
- if (!item || item->id == 0)
+ if (!item || item->id.IsEmpty())
return new DesktopShellLauncherContextMenu(controller, item, wm_shelf);
// Create ArcLauncherContextMenu if the item is an ARC app.
@@ -126,10 +126,10 @@ void LauncherContextMenu::ExecuteCommand(int command_id, int event_flags) {
ash::UMA_CLOSE_THROUGH_CONTEXT_MENU);
break;
case MENU_PIN:
- if (controller_->IsAppPinned(item_.app_launch_id.app_id()))
- controller_->UnpinAppWithID(item_.app_launch_id.app_id());
+ if (controller_->IsAppPinned(item_.id.app_id()))
+ controller_->UnpinAppWithID(item_.id.app_id());
else
- controller_->PinAppWithID(item_.app_launch_id.app_id());
+ controller_->PinAppWithID(item_.id.app_id());
break;
case MENU_AUTO_HIDE:
wm_shelf_->SetAutoHideBehavior(
@@ -149,8 +149,8 @@ void LauncherContextMenu::ExecuteCommand(int command_id, int event_flags) {
}
void LauncherContextMenu::AddPinMenu() {
- // Expect an item with a none zero id to add pin/unpin menu item.
- DCHECK(item_.id);
+ // Expect a valid ShelfID to add pin/unpin menu item.
+ DCHECK(!item_.id.IsEmpty());
int menu_pin_string_id;
const std::string app_id = controller_->GetAppIDForShelfID(item_.id);
switch (GetPinnableForAppID(app_id, controller_->profile())) {

Powered by Google App Engine
This is Rietveld 408576698