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

Unified Diff: chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.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/app_shortcut_launcher_item_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc
index 1441b8f9af1d3e0b3339e8eca0bc138c5b52b873..8dae306c52134cece99c856dcf207038ccb671cb 100644
--- a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc
+++ b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc
@@ -61,26 +61,25 @@ bool CanBrowserBeUsedForDirectActivation(Browser* browser,
// static
std::unique_ptr<AppShortcutLauncherItemController>
-AppShortcutLauncherItemController::Create(
- const ash::AppLaunchId& app_launch_id) {
- if (app_launch_id.app_id() == ArcSupportHost::kHostAppId ||
- app_launch_id.app_id() == arc::kPlayStoreAppId) {
+AppShortcutLauncherItemController::Create(const ash::ShelfID& shelf_id) {
+ if (shelf_id.app_id() == ArcSupportHost::kHostAppId ||
+ shelf_id.app_id() == arc::kPlayStoreAppId) {
return base::MakeUnique<ArcPlaystoreShortcutLauncherItemController>();
}
return base::WrapUnique<AppShortcutLauncherItemController>(
- new AppShortcutLauncherItemController(app_launch_id));
+ new AppShortcutLauncherItemController(shelf_id));
}
// Item controller for an app shortcut. Shortcuts track app and launcher ids,
// but do not have any associated windows (opening a shortcut will replace the
// item with the appropriate ash::ShelfItemDelegate type).
AppShortcutLauncherItemController::AppShortcutLauncherItemController(
- const ash::AppLaunchId& app_launch_id)
- : ash::ShelfItemDelegate(app_launch_id) {
+ const ash::ShelfID& shelf_id)
+ : ash::ShelfItemDelegate(shelf_id) {
// To detect V1 applications we use their domain and match them against the
// used URL. This will also work with applications like Google Drive.
const Extension* extension = GetExtensionForAppID(
- app_launch_id.app_id(), ChromeLauncherController::instance()->profile());
+ shelf_id.app_id(), ChromeLauncherController::instance()->profile());
// Some unit tests have no real extension.
if (extension) {
set_refocus_url(GURL(
@@ -116,9 +115,9 @@ void AppShortcutLauncherItemController::ItemSelected(
}
// Launching some items replaces this item controller instance, which
- // destroys its AppLaunchId string pair; making copies avoid crashes.
- ChromeLauncherController::instance()->LaunchApp(
- ash::AppLaunchId(app_launch_id()), source, ui::EF_NONE);
+ // destroys its ShelfID string pair; making copies avoid crashes.
+ ChromeLauncherController::instance()->LaunchApp(ash::ShelfID(shelf_id()),
+ source, ui::EF_NONE);
callback.Run(ash::SHELF_ACTION_NEW_WINDOW_CREATED, base::nullopt);
return;
}

Powered by Google App Engine
This is Rietveld 408576698