Commit 192cdd7c authored by Sinan Sahin's avatar Sinan Sahin Committed by Commit Bot

[Offline indicator v2] Fix wrong toolbar offset when swiping new tab

This CL fixes a bug where if the user swipes the toolbar immediately
after opening a new tab (easily reproducible w/ context menu > open in
incognito tab), top controls have the wrong offset and get hidden.

This is caused by ChromeFullscreenManager#onInteractabilityChanged()
which pushes offsets from TabBrowserControlsOffsetHelper even if the
offsets aren't initialized.

This is fixed by adding a simple check and returning early if the
offsets aren't initialized.

Bug: 1048596
Change-Id: I3db087db835f81067018f808ee03974fb4d1adc8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2042677Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Sinan Sahin <sinansahin@google.com>
Cr-Commit-Position: refs/heads/master@{#739202}
parent ea551ec1
...@@ -310,6 +310,8 @@ public class ChromeFullscreenManager extends FullscreenManager ...@@ -310,6 +310,8 @@ public class ChromeFullscreenManager extends FullscreenManager
TabBrowserControlsOffsetHelper offsetHelper = TabBrowserControlsOffsetHelper offsetHelper =
TabBrowserControlsOffsetHelper.get(currentTab); TabBrowserControlsOffsetHelper.get(currentTab);
if (!offsetHelper.offsetInitialized()) return;
onOffsetsChanged(offsetHelper.topControlsOffset(), onOffsetsChanged(offsetHelper.topControlsOffset(),
offsetHelper.bottomControlsOffset(), offsetHelper.contentOffset(), offsetHelper.bottomControlsOffset(), offsetHelper.contentOffset(),
offsetHelper.topControlsMinHeightOffset(), offsetHelper.topControlsMinHeightOffset(),
......
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