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

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

Issue 2684723003: Remove LauncherItemController::Launch, cleanup. (Closed)
Patch Set: Use AppLauncherId Created 3 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/chrome_launcher_controller_impl.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
index 4b063df5d7567fa4b212c6e9fcbb331b5ffe547d..c6f5978b84a773b2a7f6c4e34d60059cad47a051 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
@@ -415,7 +415,12 @@ void ChromeLauncherControllerImpl::Launch(ash::ShelfID id, int event_flags) {
LauncherItemController* controller = GetLauncherItemController(id);
if (!controller)
return; // In case invoked from menu and item closed while menu up.
- controller->Launch(ash::LAUNCH_FROM_UNKNOWN, event_flags);
+
+ // Launching some items replaces the associated item controller instance,
+ // which destroys the app and launch id strings; making copies avoid crashes.
+ LaunchApp(ash::launcher::AppLauncherId(controller->app_id(),
+ controller->launch_id()),
+ ash::LAUNCH_FROM_UNKNOWN, event_flags);
}
void ChromeLauncherControllerImpl::Close(ash::ShelfID id) {
@@ -455,11 +460,11 @@ void ChromeLauncherControllerImpl::ActivateApp(const std::string& app_id,
// Create a temporary application launcher item and use it to see if there are
// running instances.
std::unique_ptr<AppShortcutLauncherItemController> app_controller(
- AppShortcutLauncherItemController::Create(app_id, "", this));
+ AppShortcutLauncherItemController::Create(app_id, std::string(), this));
if (!app_controller->GetRunningApplications().empty())
app_controller->Activate(source);
else
- LaunchApp(app_id, source, event_flags);
+ LaunchApp(ash::launcher::AppLauncherId(app_id), source, event_flags);
}
void ChromeLauncherControllerImpl::SetLauncherItemImage(

Powered by Google App Engine
This is Rietveld 408576698