| Index: third_party/WebKit/Source/web/WebViewImpl.cpp
|
| diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
|
| index fd456862672b1408979d0ebbfc4265161e187043..bd6fee8e3297d3eb04e6c7ad375dbacb86a5550f 100644
|
| --- a/third_party/WebKit/Source/web/WebViewImpl.cpp
|
| +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
|
| @@ -1765,6 +1765,7 @@ void WebViewImpl::performResize() {
|
| // viewport with the browser controls shown.
|
| IntSize ICBSize = m_size;
|
| if (RuntimeEnabledFeatures::inertTopControlsEnabled() &&
|
| + browserControls().permittedState() == WebBrowserControlsBoth &&
|
| !browserControls().shrinkViewport())
|
| ICBSize.expand(0, -browserControls().height());
|
|
|
| @@ -1786,8 +1787,20 @@ void WebViewImpl::performResize() {
|
| void WebViewImpl::updateBrowserControlsState(WebBrowserControlsState constraint,
|
| WebBrowserControlsState current,
|
| bool animate) {
|
| + WebBrowserControlsState oldPermittedState =
|
| + browserControls().permittedState();
|
| +
|
| browserControls().updateConstraintsAndState(constraint, current, animate);
|
|
|
| + // If the controls are going from a locked to an unlocked state, or
|
| + // vice-versa, then we need to force a recompute of the ICB size since that
|
| + // depends on the permitted browser controls state.
|
| + if (oldPermittedState != constraint &&
|
| + (oldPermittedState == WebBrowserControlsBoth ||
|
| + constraint == WebBrowserControlsBoth)) {
|
| + performResize();
|
| + }
|
| +
|
| if (m_layerTreeView)
|
| m_layerTreeView->updateBrowserControlsState(constraint, current, animate);
|
| }
|
| @@ -1834,8 +1847,7 @@ BrowserControls& WebViewImpl::browserControls() {
|
| return page()->frameHost().browserControls();
|
| }
|
|
|
| -void WebViewImpl::resizeViewWhileAnchored(FrameView* view,
|
| - float browserControlsHeight,
|
| +void WebViewImpl::resizeViewWhileAnchored(float browserControlsHeight,
|
| bool browserControlsShrinkLayout) {
|
| DCHECK(mainFrameImpl());
|
|
|
| @@ -1899,12 +1911,10 @@ void WebViewImpl::resizeWithBrowserControls(const WebSize& newSize,
|
| if (isRotation) {
|
| RotationViewportAnchor anchor(*view, visualViewport, viewportAnchorCoords,
|
| pageScaleConstraintsSet());
|
| - resizeViewWhileAnchored(view, browserControlsHeight,
|
| - browserControlsShrinkLayout);
|
| + resizeViewWhileAnchored(browserControlsHeight, browserControlsShrinkLayout);
|
| } else {
|
| ResizeViewportAnchor::ResizeScope resizeScope(*m_resizeViewportAnchor);
|
| - resizeViewWhileAnchored(view, browserControlsHeight,
|
| - browserControlsShrinkLayout);
|
| + resizeViewWhileAnchored(browserControlsHeight, browserControlsShrinkLayout);
|
| }
|
| sendResizeEventAndRepaint();
|
| }
|
|
|