| 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.tabmodel; | 5 package org.chromium.chrome.browser.tabmodel; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.os.Handler; | 8 import android.os.Handler; |
| 9 | 9 |
| 10 import org.chromium.base.metrics.RecordHistogram; | 10 import org.chromium.base.metrics.RecordHistogram; |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 335 |
| 336 @Override | 336 @Override |
| 337 public void requestToShowTab(Tab tab, TabSelectionType type) { | 337 public void requestToShowTab(Tab tab, TabSelectionType type) { |
| 338 boolean isFromExternalApp = tab != null | 338 boolean isFromExternalApp = tab != null |
| 339 && tab.getLaunchType() == TabLaunchType.FROM_EXTERNAL_APP; | 339 && tab.getLaunchType() == TabLaunchType.FROM_EXTERNAL_APP; |
| 340 | 340 |
| 341 if (mVisibleTab != tab && tab != null && !tab.isNativePage()) { | 341 if (mVisibleTab != tab && tab != null && !tab.isNativePage()) { |
| 342 TabModelImpl.startTabSwitchLatencyTiming(type); | 342 TabModelImpl.startTabSwitchLatencyTiming(type); |
| 343 } | 343 } |
| 344 if (mVisibleTab != null && mVisibleTab != tab && !mVisibleTab.needsReloa
d()) { | 344 if (mVisibleTab != null && mVisibleTab != tab && !mVisibleTab.needsReloa
d()) { |
| 345 if (mVisibleTab.isInitialized()) { | 345 if (mVisibleTab.isInitialized() && !mVisibleTab.isDetachedForReparen
ting()) { |
| 346 // TODO(dtrainor): Once we figure out why we can't grab a snapsh
ot from the current | 346 // TODO(dtrainor): Once we figure out why we can't grab a snapsh
ot from the current |
| 347 // tab when we have other tabs loading from external apps remove
the checks for | 347 // tab when we have other tabs loading from external apps remove
the checks for |
| 348 // FROM_EXTERNAL_APP/FROM_NEW. | 348 // FROM_EXTERNAL_APP/FROM_NEW. |
| 349 if (!mVisibleTab.isClosing() | 349 if (!mVisibleTab.isClosing() |
| 350 && (!isFromExternalApp || type != TabSelectionType.FROM_
NEW)) { | 350 && (!isFromExternalApp || type != TabSelectionType.FROM_
NEW)) { |
| 351 cacheTabBitmap(mVisibleTab); | 351 cacheTabBitmap(mVisibleTab); |
| 352 } | 352 } |
| 353 mVisibleTab.hide(); | 353 mVisibleTab.hide(); |
| 354 mVisibleTab.setFullscreenManager(null); | 354 mVisibleTab.setFullscreenManager(null); |
| 355 mTabSaver.addTabToSaveQueue(mVisibleTab); | 355 mTabSaver.addTabToSaveQueue(mVisibleTab); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 public boolean isSessionRestoreInProgress() { | 397 public boolean isSessionRestoreInProgress() { |
| 398 return mSessionRestoreInProgress.get(); | 398 return mSessionRestoreInProgress.get(); |
| 399 } | 399 } |
| 400 | 400 |
| 401 // TODO(tedchoc): Remove the need for this to be exposed. | 401 // TODO(tedchoc): Remove the need for this to be exposed. |
| 402 @Override | 402 @Override |
| 403 public void notifyChanged() { | 403 public void notifyChanged() { |
| 404 super.notifyChanged(); | 404 super.notifyChanged(); |
| 405 } | 405 } |
| 406 } | 406 } |
| OLD | NEW |