| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 mIsFindToolbarShowing = false; | 149 mIsFindToolbarShowing = false; |
| 150 requestReaderPanelShow(StateChangeReason.UNKNOWN); | 150 requestReaderPanelShow(StateChangeReason.UNKNOWN); |
| 151 } | 151 } |
| 152 }; | 152 }; |
| 153 } | 153 } |
| 154 | 154 |
| 155 // TabModelSelectorTabObserver: | 155 // TabModelSelectorTabObserver: |
| 156 | 156 |
| 157 @Override | 157 @Override |
| 158 public void onShown(Tab shownTab) { | 158 public void onShown(Tab shownTab) { |
| 159 if (mTabModelSelector == null) return; | |
| 160 | |
| 161 int shownTabId = shownTab.getId(); | 159 int shownTabId = shownTab.getId(); |
| 162 Tab previousTab = mTabModelSelector.getTabById(mTabId); | 160 Tab previousTab = mTabModelSelector.getTabById(mTabId); |
| 163 mTabId = shownTabId; | 161 mTabId = shownTabId; |
| 164 | 162 |
| 165 // If the reader panel was dismissed, stop here. | 163 // If the reader panel was dismissed, stop here. |
| 166 if (mTabStatusMap.containsKey(shownTabId) | 164 if (mTabStatusMap.containsKey(shownTabId) |
| 167 && mTabStatusMap.get(shownTabId).isDismissed()) { | 165 && mTabStatusMap.get(shownTabId).isDismissed()) { |
| 168 return; | 166 return; |
| 169 } | 167 } |
| 170 | 168 |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 | 641 |
| 644 boolean enabled = CommandLine.getInstance().hasSwitch(ChromeSwitches.ENA
BLE_DOM_DISTILLER) | 642 boolean enabled = CommandLine.getInstance().hasSwitch(ChromeSwitches.ENA
BLE_DOM_DISTILLER) |
| 645 && !CommandLine.getInstance().hasSwitch( | 643 && !CommandLine.getInstance().hasSwitch( |
| 646 ChromeSwitches.DISABLE_READER_MODE_BOTTOM_BAR) | 644 ChromeSwitches.DISABLE_READER_MODE_BOTTOM_BAR) |
| 647 && !DeviceFormFactor.isTablet(context) | 645 && !DeviceFormFactor.isTablet(context) |
| 648 && DomDistillerTabUtils.isDistillerHeuristicsEnabled() | 646 && DomDistillerTabUtils.isDistillerHeuristicsEnabled() |
| 649 && !SysUtils.isLowEndDevice(); | 647 && !SysUtils.isLowEndDevice(); |
| 650 return enabled; | 648 return enabled; |
| 651 } | 649 } |
| 652 } | 650 } |
| OLD | NEW |