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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunManager.java

Issue 978653002: Upstream FirstRunActivity and friends. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits + remove MobileFreFinishState as it is no longer relevant Created 5 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/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunManager.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunManager.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..c6b2d5ba0feb9c2926a3fb6f4c21d81020592ab2
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunManager.java
@@ -0,0 +1,54 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.firstrun;
+
+import android.content.Context;
+import android.content.pm.ApplicationInfo;
+
+import org.chromium.base.VisibleForTesting;
+import org.chromium.chrome.browser.signin.SigninManager;
+import org.chromium.chrome.browser.util.FeatureUtilities;
+
+/**
+ * Manages the First Run Experience.
+ */
+public class FirstRunManager {
+ @VisibleForTesting
+ public static final String LAUNCH_CHROME_WITH_FRE_EXTRA = "Launch Chrome with FRE";
+
+ FirstRunManager() {
+ }
+
+ /**
+ * A version of checkAnyUserHasSeenToS() above that could be overridden in tests.
+ * @param context Context for the app.
+ * @return Whether or not the the ToS has been seen.
+ */
+ @VisibleForTesting
+ boolean testableCheckAnyUserHasSeenToS(Context context) {
+ return ToSAckedReceiver.checkAnyUserHasSeenToS(context);
+ }
+
+ /**
+ * Checks if sync can be turned on.
+ * @param context Context for the app.
+ * @return Whether sync is available.
+ */
+ @VisibleForTesting
+ boolean checkIsSyncAllowed(Context context) {
+ return FeatureUtilities.canAllowSync(context)
+ && !SigninManager.get(context).isSigninDisabledByPolicy();
+ }
+
+ /**
+ * Check whether Chrome has been installed as part of the system image.
+ * @param context Context for the app.
+ * @return Whether Chrome is in the system image.
+ */
+ @VisibleForTesting
+ boolean checkIsSystemInstall(Context context) {
+ return ((context.getApplicationInfo().flags & ApplicationInfo.FLAG_SYSTEM) != 0);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698