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

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

Issue 2062083002: Implements the Lightweight First Run Experience (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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/FirstRunStatus.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java
index 542bc95cd92b964d88f1cee1f4d8be0e5cd190f8..e62fdea030cc07beaa354821dd454a88745a2e15 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java
@@ -15,6 +15,9 @@ public class FirstRunStatus {
// Needed by ChromeBackupAgent
public static final String FIRST_RUN_FLOW_COMPLETE = "first_run_flow";
+ public static final String LIGHTWEIGHT_FIRST_RUN_FLOW_COMPLETE = "lightweight_first_run_flow";
+
+ private static final String SKIP_WELCOME_PAGE = "skip_welcome_page";
/**
* Sets the "main First Run Experience flow complete" preference.
@@ -39,4 +42,40 @@ public class FirstRunStatus {
.getBoolean(FIRST_RUN_FLOW_COMPLETE, false);
}
+ /**
+ * Sets the preference to skip the welcome page from the main First Run Experience.
+ * @param context Any context
+ * @param isSkip Whether the welcome page should be skpped
+ */
+ public static void setSkipWelcomePage(Context context, boolean isSkip) {
+ ContextUtils.getAppSharedPreferences().edit().putBoolean(SKIP_WELCOME_PAGE, isSkip).apply();
+ }
+
+ /**
+ * Checks whether the welcome page should be skipped from the main First Run Experience.
+ */
+ public static boolean shouldSkipWelcomePage(Context context) {
+ return ContextUtils.getAppSharedPreferences().getBoolean(SKIP_WELCOME_PAGE, false);
+ }
+
+ /**
+ * Sets the "lightweight First Run Experience flow complete" preference.
+ * @param context Any context
+ * @param isComplete Whether the lightweight First Run Experience flow is complete
+ */
+ public static void setLightweightFirstRunFlowComplete(Context context, boolean isComplete) {
+ ContextUtils.getAppSharedPreferences()
+ .edit()
+ .putBoolean(LIGHTWEIGHT_FIRST_RUN_FLOW_COMPLETE, isComplete)
+ .apply();
+ }
+
+ /**
+ * Returns whether the "lightweight First Run Experience flow" is complete.
+ * @param context Any context
+ */
+ public static boolean getLightweightFirstRunFlowComplete(Context context) {
+ return ContextUtils.getAppSharedPreferences().getBoolean(
+ LIGHTWEIGHT_FIRST_RUN_FLOW_COMPLETE, false);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698