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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java

Issue 2013883002: ✈ Remove unnecessary flag and DocumentModeManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 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/util/FeatureUtilities.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java b/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java
index 5b6866f7c396ab0dd81da54b72a0aca0d7ddbb8c..23eaeceb7d91fb23a4784a5b8eb76c4ea51b3b5a 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java
@@ -28,7 +28,7 @@ import org.chromium.chrome.browser.ChromeApplication;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.ChromeVersionInfo;
import org.chromium.chrome.browser.preferences.ChromePreferenceManager;
-import org.chromium.chrome.browser.preferences.DocumentModeManager;
+import org.chromium.chrome.browser.tabmodel.DocumentModeAssassin;
import org.chromium.sync.signin.AccountManagerHelper;
import org.chromium.ui.base.DeviceFormFactor;
@@ -115,14 +115,7 @@ public class FeatureUtilities {
* @return Whether Chrome should be running on document mode.
*/
public static boolean isDocumentMode(Context context) {
- if (sDocumentModeDisabled == null && CommandLine.isInitialized()) {
- initResetListener();
- sDocumentModeDisabled = CommandLine.getInstance().hasSwitch(
- ChromeSwitches.DISABLE_DOCUMENT_MODE);
- }
- return isDocumentModeEligible(context)
- && !DocumentModeManager.getInstance(context).isOptedOutOfDocumentMode()
- && (sDocumentModeDisabled == null || !sDocumentModeDisabled.booleanValue());
+ return isDocumentModeEligible(context) && !DocumentModeAssassin.isOptedOutOfDocumentMode();
}
/**
@@ -188,18 +181,6 @@ public class FeatureUtilities {
ChromeSwitches.ENABLE_TAB_SWITCHER_IN_DOCUMENT_MODE);
}
- private static void initResetListener() {
- if (sResetListener != null) return;
-
- sResetListener = new CommandLine.ResetListener() {
- @Override
- public void onCommandLineReset() {
- sDocumentModeDisabled = null;
- }
- };
- CommandLine.addResetListener(sResetListener);
- }
-
private static boolean isHerbDisallowed(Context context) {
return isDocumentMode(context) || ChromeVersionInfo.isStableBuild()
|| ChromeVersionInfo.isBetaBuild() || DeviceFormFactor.isTablet(context);

Powered by Google App Engine
This is Rietveld 408576698