| Index: chrome/android/java/src/org/chromium/chrome/browser/preferences/DocumentModeManager.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/DocumentModeManager.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/DocumentModeManager.java
|
| index 58914a3f5c108b992321a145ce2e8c74696faa95..8dabea3428f2a309411237ffcfb0b7145f9541c3 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/DocumentModeManager.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/DocumentModeManager.java
|
| @@ -169,6 +169,7 @@ public class DocumentModeManager {
|
| };
|
|
|
| private static DocumentModeManager sManager;
|
| + private static Boolean sIsDeviceTabbedModeByDefaultCache;
|
|
|
| private final SharedPreferences mSharedPreferences;
|
|
|
| @@ -197,6 +198,13 @@ public class DocumentModeManager {
|
| }
|
|
|
| /**
|
| + * @return Whether the user set a preference to use the document mode.
|
| + */
|
| + public boolean isOptedInToDocumentMode() {
|
| + return getOptOutState() == OPT_IN_TO_DOCUMENT_MODE;
|
| + }
|
| +
|
| + /**
|
| * @return Whether the user dismissed the opt out promo.
|
| */
|
| public boolean isOptOutPromoDismissed() {
|
| @@ -254,10 +262,18 @@ public class DocumentModeManager {
|
| * platform Overview screen is deemed too difficult to make Document mode user friendly.
|
| */
|
| public static boolean isDeviceTabbedModeByDefault() {
|
| + if (sIsDeviceTabbedModeByDefaultCache != null) {
|
| + return sIsDeviceTabbedModeByDefaultCache.booleanValue();
|
| + }
|
| +
|
| String model = Build.MODEL.toUpperCase(Locale.US);
|
| for (String device : DEFAULT_TABBED_MODE_DEVICES) {
|
| - if (model.contains(device)) return true;
|
| + if (model.contains(device)) {
|
| + sIsDeviceTabbedModeByDefaultCache = Boolean.TRUE;
|
| + return true;
|
| + }
|
| }
|
| + sIsDeviceTabbedModeByDefaultCache = Boolean.FALSE;
|
| return false;
|
| }
|
|
|
|
|