| 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..c44217dde01f4ec2f0d0a9f846d2ffb958934a07 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)
|
| + DCHECK(!(constraints == WebTopControlsShown && current == WebTopControlsHidden));
|
| + DCHECK(!(constraints == WebTopControlsHidden && current == WebTopControlsShown));
|
| +
|
| + // 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)
|
| + return;
|
| +
|
| + if (constraints == WebTopControlsBoth && current == WebTopControlsBoth)
|
| + return;
|
| +
|
| + if (constraints == WebTopControlsHidden || current == WebTopControlsHidden)
|
| setShownRatio(0.f);
|
| + else
|
| + setShownRatio(1.f);
|
| }
|
|
|
| void TopControls::setHeight(float height, bool shrinkViewport)
|
|
|