Commit 8b320a86 authored by Patrick Noland's avatar Patrick Noland Committed by Commit Bot

[ToolbarMVC] Use tab model selector's current tab if tab is null in onObservingDifferentTab

ActivityTabProvider nulls out the active tab when it's non-interactive,
and we receive the onObservingDifferentTab event before entering the
tab switcher. This caused us to prematurely set the current tab to null,
removing the ability for ToolbarPhone to accurately retrieve state about,
e.g. whether the location bar is currently showing. In the linked bug,
this manifested by drawing the location bar during the tab switcher entry
animation when the location bar wasn't currently being shown.

Bug: 1060335
Change-Id: Ib101e4be786f5cad0d2602cb73f7df4620f80af0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2100112Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Patrick Noland <pnoland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751112}
parent 870fa813
...@@ -375,6 +375,11 @@ public class ToolbarManager implements ScrimObserver, ToolbarTabController, UrlF ...@@ -375,6 +375,11 @@ public class ToolbarManager implements ScrimObserver, ToolbarTabController, UrlF
mActivityTabProvider) { mActivityTabProvider) {
@Override @Override
public void onObservingDifferentTab(Tab tab) { public void onObservingDifferentTab(Tab tab) {
// ActivityTabProvider will null out the tab passed to onObservingDifferentTab when
// the tab is non-interactive (e.g. when entering the TabSwitcher), but in those
// cases we actually still want to use the most recently selected tab.
if (tab == null) return;
refreshSelectedTab(tab); refreshSelectedTab(tab);
} }
......
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