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

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

Issue 2739323004: arc: Reactivate OptIn flow on clicking Play Store. (Closed)
Patch Set: TODO added/rebased 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 a4eb8be47e35a2c27ec3fc600a1b1f4687033674..417df3224fec001287b6bf860a7856db2ea4dda7 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"
@@ -289,6 +290,21 @@ bool LaunchApp(content::BrowserContext* context,
// Only reachable when ARC always starts.
DCHECK(arc::ShouldArcAlwaysStart());
}
+ } 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;
+ }
+ }
}
ChromeLauncherController* chrome_controller =

Powered by Google App Engine
This is Rietveld 408576698