OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.dom_distiller; | 5 package org.chromium.chrome.browser.dom_distiller; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.text.TextUtils; | 9 import android.text.TextUtils; |
10 | 10 |
11 import com.google.android.apps.chrome.R; | 11 import com.google.android.apps.chrome.R; |
12 | 12 |
13 import org.chromium.base.CommandLine; | 13 import org.chromium.base.CommandLine; |
14 import org.chromium.base.ObserverList; | 14 import org.chromium.base.ObserverList; |
15 import org.chromium.base.metrics.RecordHistogram; | 15 import org.chromium.base.metrics.RecordHistogram; |
16 import org.chromium.chrome.browser.ApplicationSwitches; | |
17 import org.chromium.chrome.browser.ChromeSwitches; | 16 import org.chromium.chrome.browser.ChromeSwitches; |
18 import org.chromium.chrome.browser.ChromeVersionInfo; | 17 import org.chromium.chrome.browser.ChromeVersionInfo; |
19 import org.chromium.chrome.browser.CompositorChromeActivity; | 18 import org.chromium.chrome.browser.CompositorChromeActivity; |
20 import org.chromium.chrome.browser.EmptyTabObserver; | 19 import org.chromium.chrome.browser.EmptyTabObserver; |
21 import org.chromium.chrome.browser.Tab; | 20 import org.chromium.chrome.browser.Tab; |
22 import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager; | 21 import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager; |
23 import org.chromium.chrome.browser.contextualsearch.ContextualSearchObserver; | 22 import org.chromium.chrome.browser.contextualsearch.ContextualSearchObserver; |
24 import org.chromium.chrome.browser.dom_distiller.ReaderModePanel.ReaderModePanel
Host; | 23 import org.chromium.chrome.browser.dom_distiller.ReaderModePanel.ReaderModePanel
Host; |
25 import org.chromium.chrome.browser.gsa.GSAContextDisplaySelection; | 24 import org.chromium.chrome.browser.gsa.GSAContextDisplaySelection; |
26 import org.chromium.chrome.browser.tab.ChromeTab; | 25 import org.chromium.chrome.browser.tab.ChromeTab; |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 288 |
290 /** | 289 /** |
291 * @return Whether Reader mode and its new UI are enabled. | 290 * @return Whether Reader mode and its new UI are enabled. |
292 * @param context A context | 291 * @param context A context |
293 */ | 292 */ |
294 public static boolean isEnabled(Context context) { | 293 public static boolean isEnabled(Context context) { |
295 if (context == null) return false; | 294 if (context == null) return false; |
296 | 295 |
297 boolean enabled = CommandLine.getInstance().hasSwitch(ChromeSwitches.ENA
BLE_DOM_DISTILLER) | 296 boolean enabled = CommandLine.getInstance().hasSwitch(ChromeSwitches.ENA
BLE_DOM_DISTILLER) |
298 && !CommandLine.getInstance().hasSwitch( | 297 && !CommandLine.getInstance().hasSwitch( |
299 ApplicationSwitches.DISABLE_READER_MODE_BOTTOM_BAR) | 298 ChromeSwitches.DISABLE_READER_MODE_BOTTOM_BAR) |
300 && !DeviceFormFactor.isTablet(context); | 299 && !DeviceFormFactor.isTablet(context); |
301 if (ChromeVersionInfo.isBetaBuild() || ChromeVersionInfo.isStableBuild()
) { | 300 if (ChromeVersionInfo.isBetaBuild() || ChromeVersionInfo.isStableBuild()
) { |
302 enabled = enabled | 301 enabled = enabled |
303 && CommandLine.getInstance().hasSwitch( | 302 && CommandLine.getInstance().hasSwitch( |
304 ApplicationSwitches.ENABLE_READER_MODE_BUTTON); | 303 ChromeSwitches.ENABLE_READER_MODE_BUTTON); |
305 } | 304 } |
306 return enabled; | 305 return enabled; |
307 } | 306 } |
308 } | 307 } |
OLD | NEW |