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

Unified Diff: chrome/browser/ui/app_list/arc/arc_app_launcher.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/app_list/arc/arc_app_launcher.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_app_launcher.cc b/chrome/browser/ui/app_list/arc/arc_app_launcher.cc
index 878e244f56a9693f59b7f3f6f2a1512c5596ba92..2edf5be1f5d0b66cdeee8f613754fd5810c2b334 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_launcher.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_launcher.cc
@@ -10,13 +10,17 @@
ArcAppLauncher::ArcAppLauncher(content::BrowserContext* context,
const std::string& app_id,
- bool landscape_layout)
- : context_(context), app_id_(app_id), landscape_layout_(landscape_layout) {
+ bool landscape_layout,
+ bool deferred_launch_allowed)
+ : context_(context),
+ app_id_(app_id),
+ landscape_layout_(landscape_layout),
+ deferred_launch_allowed_(deferred_launch_allowed) {
ArcAppListPrefs* prefs = ArcAppListPrefs::Get(context_);
DCHECK(prefs);
std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = prefs->GetApp(app_id_);
- if (app_info && app_info->ready)
+ if (app_info && (app_info->ready || deferred_launch_allowed_))
LaunchApp();
else
prefs->AddObserver(this);
@@ -34,12 +38,12 @@ ArcAppLauncher::~ArcAppLauncher() {
void ArcAppLauncher::OnAppRegistered(
const std::string& app_id,
const ArcAppListPrefs::AppInfo& app_info) {
- if (app_id == app_id_ && app_info.ready)
+ if (app_id == app_id_ && (app_info.ready || deferred_launch_allowed_))
LaunchApp();
}
void ArcAppLauncher::OnAppReadyChanged(const std::string& app_id, bool ready) {
- if (app_id == app_id_ && ready)
+ if (app_id == app_id_ && (ready || deferred_launch_allowed_))
LaunchApp();
}

Powered by Google App Engine
This is Rietveld 408576698