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

Unified Diff: third_party/WebKit/Source/core/frame/TopControls.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: Addressed Feedback 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
« no previous file with comments | « third_party/WebKit/Source/core/frame/TopControls.h ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/TopControls.cpp
diff --git a/third_party/WebKit/Source/core/frame/TopControls.cpp b/third_party/WebKit/Source/core/frame/TopControls.cpp
index d7d3ad90dfcf318d91f96c0cc1e2f5b159f83821..78ff0b4af90ee625325773bbdbb8c455685c3e0e 100644
--- a/third_party/WebKit/Source/core/frame/TopControls.cpp
+++ b/third_party/WebKit/Source/core/frame/TopControls.cpp
@@ -95,14 +95,29 @@ void TopControls::setShownRatio(float shownRatio)
m_frameHost->chromeClient().didUpdateTopControls();
}
-void TopControls::updateConstraints(WebTopControlsState constraints)
+void TopControls::updateConstraintsAndState(
+ WebTopControlsState constraints,
+ WebTopControlsState current,
+ bool animate)
{
m_permittedState = constraints;
- if (m_permittedState == WebTopControlsShown)
- setShownRatio(1.f);
- else if (m_permittedState == WebTopControlsHidden)
- setShownRatio(0.f);
+ // 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) {
+ switch (current) {
majidvp 2016/06/29 13:56:09 Sorry to go back and forth and not noticing this e
bokan 2016/06/29 16:23:00 Good catch, I hadn't noticed this doesn't fix the
+ case WebTopControlsShown:
+ setShownRatio(1.f);
+ break;
+ case WebTopControlsHidden:
+ setShownRatio(0.f);
+ break;
+ case WebTopControlsBoth:
+ default:
+ break;
+ }
+ }
}
void TopControls::setHeight(float height, bool shrinkViewport)
« no previous file with comments | « third_party/WebKit/Source/core/frame/TopControls.h ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698