Commit 24faa677 authored by Michael Thiessen's avatar Michael Thiessen Committed by Commit Bot

Ensure pause/resumed state is correct for CVCs, even when showing Native Page

A cvc->NativePage switch can happen while paused, leading the CVC's
paused/resumed state to be incorrect because there's no current CVC when
Chrome is resumed.

We need to update the paused/resumed state for all CVCs during pause and
resume to ensure the state is always correct.

Bug: 829793
Change-Id: I64d816aad648dad0d1c5898041eabd6b56d77b91
Reviewed-on: https://chromium-review.googlesource.com/999736Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548821}
parent 7997314c
...@@ -850,8 +850,15 @@ public abstract class ChromeActivity extends AsyncInitializationActivity ...@@ -850,8 +850,15 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
if (getActivityTab() != null) { if (getActivityTab() != null) {
LaunchMetrics.commitLaunchMetrics(getActivityTab().getWebContents()); LaunchMetrics.commitLaunchMetrics(getActivityTab().getWebContents());
} }
ContentViewCore cvc = getContentViewCore();
if (cvc != null) cvc.onResume(); for (TabModel model : getTabModelSelector().getModels()) {
int count = model.getCount();
for (int i = 0; i < count; ++i) {
ContentViewCore cvc = model.getTabAt(i).getActiveContentViewCore();
if (cvc != null) cvc.onResume();
}
}
FeatureUtilities.setCustomTabVisible(isCustomTab()); FeatureUtilities.setCustomTabVisible(isCustomTab());
FeatureUtilities.setIsInMultiWindowMode( FeatureUtilities.setIsInMultiWindowMode(
MultiWindowUtils.getInstance().isInMultiWindowMode(this)); MultiWindowUtils.getInstance().isInMultiWindowMode(this));
...@@ -882,8 +889,13 @@ public abstract class ChromeActivity extends AsyncInitializationActivity ...@@ -882,8 +889,13 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
RecordUserAction.record("MobileGoToBackground"); RecordUserAction.record("MobileGoToBackground");
Tab tab = getActivityTab(); Tab tab = getActivityTab();
if (tab != null) getTabContentManager().cacheTabThumbnail(tab); if (tab != null) getTabContentManager().cacheTabThumbnail(tab);
ContentViewCore cvc = getContentViewCore(); for (TabModel model : getTabModelSelector().getModels()) {
if (cvc != null) cvc.onPause(); int count = model.getCount();
for (int i = 0; i < count; ++i) {
ContentViewCore cvc = model.getTabAt(i).getActiveContentViewCore();
if (cvc != null) cvc.onPause();
}
}
VrShellDelegate.maybeUnregisterVrEntryHook(this); VrShellDelegate.maybeUnregisterVrEntryHook(this);
markSessionEnd(); markSessionEnd();
super.onPauseWithNative(); super.onPauseWithNative();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment