Chromium Code Reviews| 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) |