Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2105523002: Don't set shownRatio in main thread top controls on animated state change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/TopControls.cpp ('k') | third_party/WebKit/Source/web/tests/TopControlsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698