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

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: 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..9211776d49fd34b0ac494754308399cc6bc743ee 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,17 @@ 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);
+ if (app_id == kPlayStoreAppId) {
Yusuke Sato 2017/03/13 18:05:56 qq: When this can be false? Is it okay to execute
khmel 2017/03/13 19:44:19 Another default app may activate this flow, for ex
Yusuke Sato 2017/03/13 20:08:18 Can you copy the summary of your comment to the co
khmel 2017/03/13 21:42:34 Done.
+ prefs->SetLastLaunchTime(app_id, base::Time::Now());
+ return true;
+ }
+ }
}
ChromeLauncherController* chrome_controller =

Powered by Google App Engine
This is Rietveld 408576698