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

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

Issue 2540433002: Reland "Propagate information about how ARC apps are launched" (Closed)
Patch Set: Fixed use-after-free Created 4 years 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/arc_app_deferred_launcher_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.cc b/chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.cc
index 2bc17384b35a1956bee1997c9ae3377ea1f28f4a..c56c50ee93e27fd2dce29d2e332b22f19604dc3b 100644
--- a/chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.cc
@@ -129,9 +129,11 @@ void ArcAppDeferredLauncherController::OnAppReadyChanged(
if (it == app_controller_map_.end())
return;
+ // Preserve the event flags before |it| is invalidated in Close().
+ int event_flags = it->second->event_flags();
Close(app_id);
- arc::LaunchApp(observed_profile_, app_id);
+ arc::LaunchApp(observed_profile_, app_id, event_flags);
}
void ArcAppDeferredLauncherController::OnAppRemoved(const std::string& app_id) {
@@ -179,7 +181,8 @@ void ArcAppDeferredLauncherController::RegisterNextUpdate() {
}
void ArcAppDeferredLauncherController::RegisterDeferredLaunch(
- const std::string& app_id) {
+ const std::string& app_id,
+ int event_flags) {
const arc::ArcSessionManager* arc_session_manager =
arc::ArcSessionManager::Get();
DCHECK(arc_session_manager);
@@ -203,8 +206,8 @@ void ArcAppDeferredLauncherController::RegisterDeferredLaunch(
}
ArcAppDeferredLauncherItemController* controller =
- new ArcAppDeferredLauncherItemController(shelf_app_id, owner_,
- weak_ptr_factory_.GetWeakPtr());
+ new ArcAppDeferredLauncherItemController(
+ shelf_app_id, owner_, event_flags, weak_ptr_factory_.GetWeakPtr());
if (shelf_id == 0) {
owner_->CreateAppLauncherItem(controller, shelf_app_id,
ash::STATUS_RUNNING);

Powered by Google App Engine
This is Rietveld 408576698