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

Unified Diff: chrome/android/java_staging/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java

Issue 1181353002: Disable custom tabs if the feature is disabled in finch experiment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final comments addressed Created 5 years, 6 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
« no previous file with comments | « chrome/android/java_staging/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java_staging/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java
diff --git a/chrome/android/java_staging/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java b/chrome/android/java_staging/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java
index 1d8e4a9e7e84cdba67e3f834e27602cc8c9b62f9..e240e56d021514c7baa77feace555acbbd5407d7 100644
--- a/chrome/android/java_staging/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java
+++ b/chrome/android/java_staging/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java
@@ -29,6 +29,7 @@ public class ChromePreferenceManager {
private static final String CONTEXTUAL_SEARCH_TAP_TRIGGERED_PROMO_COUNT =
"contextual_search_tap_triggered_promo_count";
private static final String CONTEXTUAL_SEARCH_TAP_COUNT = "contextual_search_tap_count";
+ private static final String ENABLE_CUSTOM_TABS = "enable_custom_tabs";
private static final int SIGNIN_PROMO_CYCLE_IN_DAYS = 120;
private static final long MILLISECONDS_IN_DAY = 1000 * 60 * 60 * 24;
@@ -116,6 +117,24 @@ public class ChromePreferenceManager {
}
/**
+ * Enables custom tabs when true. This will take effect next time an activity is created.
+ * @param enabled Whether custom tabs should be enabled.
+ */
+ public void setCustomTabsEnabled(boolean enabled) {
+ SharedPreferences.Editor ed = mSharedPreferences.edit();
+ ed.putBoolean(ENABLE_CUSTOM_TABS, enabled);
+ ed.apply();
+ }
+
+ /**
+ * @return Whether custom tabs is enabled. This return value is designed to be used as a kill
+ * switch for the feature, so it returns true by default if the preference is not set.
+ */
+ public boolean getCustomTabsEnabled() {
+ return mSharedPreferences.getBoolean(ENABLE_CUSTOM_TABS, true);
+ }
+
+ /**
* Marks whether the data reduction promotion was skipped on first
* invocation.
* @param displayed Whether the promotion was shown.
« no previous file with comments | « chrome/android/java_staging/src/org/chromium/chrome/browser/document/ChromeLauncherActivity.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698