Commit f73c5696 authored by Brandon Wylie's avatar Brandon Wylie Committed by Commit Bot

Start bitmap capturing after native init if the tab is loaded

Bitmap capturing is enabled in
ActivityTabProvider.ActivityTabTabObserver methods:
- onUrlUpdated (called when the URL is updated)
- onShown (called when a tab is selected from the tab switcher)

These methods aren't called when returning to a tab from a theme change.
If the URL isn't updated and the tab isn't selected through the tab
switcher, the bitmap capturing won't be enabled.

This change supports bitmap capture when swiping through tabs after
changing the theme.

Bug: 1091643
Change-Id: Ife285cac48c20c3db4f7450800bba7cec2d27db2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2236070
Commit-Queue: Brandon Wylie <wylieb@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Reviewed-by: default avatarPatrick Noland <pnoland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#778409}
parent 4616754c
...@@ -829,6 +829,13 @@ public class ToolbarManager implements UrlFocusChangeListener, ThemeColorObserve ...@@ -829,6 +829,13 @@ public class ToolbarManager implements UrlFocusChangeListener, ThemeColorObserve
mOnInitializedRunnable = null; mOnInitializedRunnable = null;
} }
// Allow bitmap capturing once everything has been initialized.
Tab currentTab = tabModelSelector.getCurrentTab();
if (currentTab != null && currentTab.getWebContents() != null
&& !TextUtils.isEmpty(currentTab.getUrlString())) {
mControlContainer.setReadyForBitmapCapture(true);
}
setCurrentProfile(mProfileSupplier.get()); setCurrentProfile(mProfileSupplier.get());
TraceEvent.end("ToolbarManager.initializeWithNative"); TraceEvent.end("ToolbarManager.initializeWithNative");
} }
......
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