Chromium Code Reviews| 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 7f9d5c550cfe56d0f26f919d9bc120bda193ac41..3de3c9e437114d6f73ac264da187ebba51ab5124 100644 |
| --- a/third_party/WebKit/Source/web/WebViewImpl.cpp |
| +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp |
| @@ -1831,6 +1831,17 @@ void WebViewImpl::performResize() |
| void WebViewImpl::updateTopControlsState(WebTopControlsState constraint, WebTopControlsState current, bool animate) |
| { |
| topControls().updateConstraints(constraint); |
| + |
| + // If the change should be animated, let the impl thread drive the change. |
| + // Otherwise, immediately set the shown ratio so we don't have to wait for |
| + // a commit from the impl thread. |
| + if (!animate) { |
| + if (current == WebTopControlsShown) |
| + topControls().setShownRatio(1.f); |
| + else if (current == WebTopControlsHidden) |
| + topControls().setShownRatio(0.f); |
|
majidvp
2016/06/28 19:52:20
Maybe it is worth it to specifically call out the
bokan
2016/06/28 23:15:33
Done.
|
| + } |
|
majidvp
2016/06/28 19:52:20
Why move the clamping logic out of top controls? I
bokan
2016/06/28 23:15:33
Done.
|
| + |
| if (m_layerTreeView) |
| m_layerTreeView->updateTopControlsState(constraint, current, animate); |
| } |