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

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

Issue 2793223002: arc: Fix crash activating Play Store in deferred mode. (Closed)
Patch Set: clean up Created 3 years, 9 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/arc_playstore_shortcut_launcher_item_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/arc_playstore_shortcut_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/arc_playstore_shortcut_launcher_item_controller.cc
index da6cfe61c47154852cfcc458e0652d8a617e7b53..7c2d4ee09e5efabb32faafef8aa2f47dfcac7752 100644
--- a/chrome/browser/ui/ash/launcher/arc_playstore_shortcut_launcher_item_controller.cc
+++ b/chrome/browser/ui/ash/launcher/arc_playstore_shortcut_launcher_item_controller.cc
@@ -27,8 +27,14 @@ void ArcPlaystoreShortcutLauncherItemController::ItemSelected(
int64_t display_id,
ash::ShelfLaunchSource source,
const ItemSelectedCallback& callback) {
- playstore_launcher_ = base::MakeUnique<ArcAppLauncher>(
- controller()->profile(), arc::kPlayStoreAppId, true, true);
- callback.Run(ash::SHELF_ACTION_NONE,
- GetAppMenuItems(event ? event->flags() : ui::EF_NONE));
+ // Note, ArcAppLauncher may invoke arc::LaunchApp that in some cases creates
msw 2017/04/04 01:42:05 I don't quite understand this comment or why |play
khmel 2017/04/04 16:52:26 Problem following. This is shortcut controller. Us
+ // deferred launch item which substitutes current controller. It is not safe
msw 2017/04/04 01:42:05 what is the "current controller"?
khmel 2017/04/04 16:52:26 Explained above
+ // to access this object if Play Store was actually launched.
msw 2017/04/04 01:42:05 by "this object", do you mean this ArcPlaystoreSho
khmel 2017/04/04 16:52:26 yes
+ DCHECK(GetAppMenuItems(event ? event->flags() : ui::EF_NONE).empty());
+ std::unique_ptr<ArcAppLauncher> playstore_launcher =
+ base::MakeUnique<ArcAppLauncher>(controller()->profile(),
+ arc::kPlayStoreAppId, true, true);
+ if (!playstore_launcher->app_launched())
+ playstore_launcher_ = std::move(playstore_launcher);
+ callback.Run(ash::SHELF_ACTION_NONE, MenuItemList());
}

Powered by Google App Engine
This is Rietveld 408576698