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.content.Context; | 7 import android.content.Context; |
8 import android.text.TextUtils; | 8 import android.text.TextUtils; |
9 | 9 |
10 import org.chromium.base.CommandLine; | 10 import org.chromium.base.CommandLine; |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 | 636 |
637 /** | 637 /** |
638 * @return Whether Reader mode and its new UI are enabled. | 638 * @return Whether Reader mode and its new UI are enabled. |
639 * @param context A context | 639 * @param context A context |
640 */ | 640 */ |
641 public static boolean isEnabled(Context context) { | 641 public static boolean isEnabled(Context context) { |
642 if (context == null) return false; | 642 if (context == null) return false; |
643 | 643 |
644 boolean enabled = CommandLine.getInstance().hasSwitch(ChromeSwitches.ENA
BLE_DOM_DISTILLER) | 644 boolean enabled = CommandLine.getInstance().hasSwitch(ChromeSwitches.ENA
BLE_DOM_DISTILLER) |
645 && !CommandLine.getInstance().hasSwitch( | 645 && !CommandLine.getInstance().hasSwitch( |
646 ChromeSwitches.DISABLE_READER_MODE_BOTTOM_BAR) | 646 ChromeSwitches.DISABLE_READER_MODE_BOTTOM_BAR) |
647 && !DeviceFormFactor.isTablet(context) | 647 && !DeviceFormFactor.isTablet() |
648 && DomDistillerTabUtils.isDistillerHeuristicsEnabled() | 648 && DomDistillerTabUtils.isDistillerHeuristicsEnabled() |
649 && !SysUtils.isLowEndDevice(); | 649 && !SysUtils.isLowEndDevice(); |
650 return enabled; | 650 return enabled; |
651 } | 651 } |
652 } | 652 } |
OLD | NEW |