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

Unified Diff: chrome/browser/ui/app_list/arc/arc_app_utils.cc

Issue 2755073003: [Merge M58] arc: Reactivate OptIn flow on clicking Play Store. (Closed)
Patch Set: update unit_tests expectation for M58 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_utils.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_app_utils.cc b/chrome/browser/ui/app_list/arc/arc_app_utils.cc
index af1104cdf3801de910000e8e60d06eb14a1d5307..ab977d4d418fca83d9c8f949333ec8f1f6d2fadd 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_utils.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_utils.cc
@@ -12,6 +12,7 @@
#include "base/json/json_writer.h"
#include "base/synchronization/waitable_event.h"
#include "base/values.h"
+#include "chrome/browser/chromeos/arc/arc_session_manager.h"
#include "chrome/browser/chromeos/arc/arc_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
@@ -280,6 +281,21 @@ bool LaunchApp(content::BrowserContext* context,
return false;
}
play_store_activated = true;
+ } else {
+ // Handle the case when default app tries to re-activate OptIn flow.
+ if (IsArcPlayStoreEnabledPreferenceManagedForProfile(profile) &&
+ !ArcSessionManager::Get()->enable_requested() &&
+ prefs->IsDefault(app_id)) {
+ SetArcPlayStoreEnabledForProfile(profile, true);
+ // PlayStore item has special handling for shelf controllers. In order
+ // to avoid unwanted initial animation for PlayStore item do not create
+ // deferred launch request when PlayStore item enables Google Play
+ // Store.
+ if (app_id == kPlayStoreAppId) {
+ prefs->SetLastLaunchTime(app_id, base::Time::Now());
+ return true;
+ }
+ }
}
// PlayStore item has special handling for shelf controllers. In order to

Powered by Google App Engine
This is Rietveld 408576698