Commit ee092745 authored by Alex Cooper's avatar Alex Cooper Committed by Commit Bot

Fix VRB navigation from NTP

This broke in crrev.com/c/2003869, the fix here is to switch to using
the cached rather than passed in content offset when in VR.
showAndroidControls assumes that the top content offset should be the
same as the controls height, but the controls are hidden in VR.

Fixed: 1055619
Change-Id: Ife34937ddb06baa0be254b7265181e165781144b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2079516
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Auto-Submit: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: default avatarMichael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746519}
parent 73e02d62
...@@ -298,7 +298,7 @@ public class ManualFillingControllerTest { ...@@ -298,7 +298,7 @@ public class ManualFillingControllerTest {
return false; return false;
} }
@Override @Override
protected void rawTopContentOffsetChangedForVr(int topContentOffset) {} protected void rawTopContentOffsetChangedForVr() {}
}; };
when(mMockActivity.getFullscreenManager()).thenReturn(fullscreenManager); when(mMockActivity.getFullscreenManager()).thenReturn(fullscreenManager);
when(mMockActivity.getCompositorViewHolder()).thenReturn(mMockCompositorViewHolder); when(mMockActivity.getCompositorViewHolder()).thenReturn(mMockCompositorViewHolder);
......
...@@ -1012,7 +1012,7 @@ public class ChromeFullscreenManager extends FullscreenManager ...@@ -1012,7 +1012,7 @@ public class ChromeFullscreenManager extends FullscreenManager
int bottomControlsOffset, int topContentOffset, int topControlsMinHeightOffset, int bottomControlsOffset, int topContentOffset, int topControlsMinHeightOffset,
int bottomControlsMinHeightOffset) { int bottomControlsMinHeightOffset) {
if (isInVr()) { if (isInVr()) {
rawTopContentOffsetChangedForVr(topContentOffset); rawTopContentOffsetChangedForVr();
// The dip scale of java UI and WebContents are different while in VR, leading to a // The dip scale of java UI and WebContents are different while in VR, leading to a
// mismatch in size in pixels when converting from dips. Since we hide the controls in // mismatch in size in pixels when converting from dips. Since we hide the controls in
// VR anyways, just set the offsets to what they're supposed to be with the controls // VR anyways, just set the offsets to what they're supposed to be with the controls
...@@ -1101,8 +1101,13 @@ public class ChromeFullscreenManager extends FullscreenManager ...@@ -1101,8 +1101,13 @@ public class ChromeFullscreenManager extends FullscreenManager
return VrModuleProvider.getDelegate().bootsToVr(); return VrModuleProvider.getDelegate().bootsToVr();
} }
protected void rawTopContentOffsetChangedForVr(int topContentOffset) { protected void rawTopContentOffsetChangedForVr() {
VrModuleProvider.getDelegate().rawTopContentOffsetChanged(topContentOffset); // TODO(https://crbug.com/1055619): VR wants to wait until the controls are fully hidden, as
// otherwise there may be a brief race where the omnibox is rendered over the webcontents.
// However, something seems to be happening in the case where the browser is launched on the
// NTP, such that the top content offset is never set to 0. If we can figure out what that
// is, we should be passing the TopContentOffset into this method again.
VrModuleProvider.getDelegate().rawTopContentOffsetChanged(0);
} }
@Override @Override
......
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