| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.device; | 5 package org.chromium.chrome.browser.device; |
| 6 | 6 |
| 7 import org.chromium.base.CommandLine; | 7 import org.chromium.base.CommandLine; |
| 8 import org.chromium.base.ContextUtils; | |
| 9 import org.chromium.base.SysUtils; | 8 import org.chromium.base.SysUtils; |
| 10 import org.chromium.chrome.browser.ChromeSwitches; | 9 import org.chromium.chrome.browser.ChromeSwitches; |
| 11 import org.chromium.chrome.browser.util.AccessibilityUtil; | 10 import org.chromium.chrome.browser.util.AccessibilityUtil; |
| 12 import org.chromium.ui.base.DeviceFormFactor; | 11 import org.chromium.ui.base.DeviceFormFactor; |
| 13 | 12 |
| 14 /** | 13 /** |
| 15 * This class is used to turn on and off certain features for different types of | 14 * This class is used to turn on and off certain features for different types of |
| 16 * devices. | 15 * devices. |
| 17 */ | 16 */ |
| 18 public class DeviceClassManager { | 17 public class DeviceClassManager { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 mEnableToolbarSwipe = false; | 49 mEnableToolbarSwipe = false; |
| 51 } else { | 50 } else { |
| 52 mEnableSnapshots = true; | 51 mEnableSnapshots = true; |
| 53 mEnableLayerDecorationCache = true; | 52 mEnableLayerDecorationCache = true; |
| 54 mEnableAccessibilityLayout = false; | 53 mEnableAccessibilityLayout = false; |
| 55 mEnableAnimations = true; | 54 mEnableAnimations = true; |
| 56 mEnablePrerendering = true; | 55 mEnablePrerendering = true; |
| 57 mEnableToolbarSwipe = true; | 56 mEnableToolbarSwipe = true; |
| 58 } | 57 } |
| 59 | 58 |
| 60 if (DeviceFormFactor.isTablet(ContextUtils.getApplicationContext())) { | 59 if (DeviceFormFactor.isTablet()) { |
| 61 mEnableAccessibilityLayout = false; | 60 mEnableAccessibilityLayout = false; |
| 62 } | 61 } |
| 63 | 62 |
| 64 // Flag based configurations. | 63 // Flag based configurations. |
| 65 CommandLine commandLine = CommandLine.getInstance(); | 64 CommandLine commandLine = CommandLine.getInstance(); |
| 66 assert commandLine.isNativeImplementation(); | 65 assert commandLine.isNativeImplementation(); |
| 67 mEnableAccessibilityLayout |= commandLine | 66 mEnableAccessibilityLayout |= commandLine |
| 68 .hasSwitch(ChromeSwitches.ENABLE_ACCESSIBILITY_TAB_SWITCHER); | 67 .hasSwitch(ChromeSwitches.ENABLE_ACCESSIBILITY_TAB_SWITCHER); |
| 69 mEnableFullscreen = | 68 mEnableFullscreen = |
| 70 !commandLine.hasSwitch(ChromeSwitches.DISABLE_FULLSCREEN); | 69 !commandLine.hasSwitch(ChromeSwitches.DISABLE_FULLSCREEN); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 return getInstance().mEnablePrerendering; | 117 return getInstance().mEnablePrerendering; |
| 119 } | 118 } |
| 120 | 119 |
| 121 /** | 120 /** |
| 122 * @return Whether or not we can use the toolbar swipe. | 121 * @return Whether or not we can use the toolbar swipe. |
| 123 */ | 122 */ |
| 124 public static boolean enableToolbarSwipe() { | 123 public static boolean enableToolbarSwipe() { |
| 125 return getInstance().mEnableToolbarSwipe; | 124 return getInstance().mEnableToolbarSwipe; |
| 126 } | 125 } |
| 127 } | 126 } |
| OLD | NEW |