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

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

Issue 2751913004: arc: Fix race conditon when Play Store is started too early. (Closed)
Patch Set: 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 9f445f5319c22b1ff90a6dc2ff5bf216375114b2..79ea53995ec840d52fe126231f1567d45502cf90 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
@@ -8,6 +8,7 @@
#include "chrome/browser/chromeos/arc/arc_support_host.h"
#include "chrome/browser/chromeos/arc/arc_util.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/app_list/arc/arc_app_launcher.h"
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
#include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
@@ -31,10 +32,13 @@ void ArcPlaystoreShortcutLauncherItemController::ItemSelected(
ArcAppListPrefs* arc_app_prefs = ArcAppListPrefs::Get(profile);
DCHECK(arc_app_prefs);
khmel 2017/03/15 22:51:48 I discarded similar code in one of my previous CL:
- // Play Store should always be registered and arc::LaunchApp can handle all
- // cases.
- DCHECK(arc_app_prefs->IsRegistered(arc::kPlayStoreAppId));
- arc::LaunchApp(profile, arc::kPlayStoreAppId, true);
+ if (arc_app_prefs->IsRegistered(arc::kPlayStoreAppId)) {
hidehiko 2017/03/16 01:05:39 L35-L37 is just a dup logic with ArcAppLauncher's
khmel 2017/03/16 16:12:14 Nice, Done.
+ // arc::LaunchApp can handle all cases.
+ arc::LaunchApp(profile, arc::kPlayStoreAppId, true);
+ } else {
+ playstore_launcher_ = base::MakeUnique<ArcAppLauncher>(
+ profile, arc::kPlayStoreAppId, true, true);
+ }
callback.Run(ash::SHELF_ACTION_NONE,
GetAppMenuItems(event ? event->flags() : ui::EF_NONE));

Powered by Google App Engine
This is Rietveld 408576698