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

Side by Side 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: Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/frame/TopControls.h" 5 #include "core/frame/TopControls.h"
6 6
7 #include "core/frame/FrameHost.h" 7 #include "core/frame/FrameHost.h"
8 #include "core/frame/VisualViewport.h" 8 #include "core/frame/VisualViewport.h"
9 #include "core/page/ChromeClient.h" 9 #include "core/page/ChromeClient.h"
10 #include "platform/geometry/FloatSize.h" 10 #include "platform/geometry/FloatSize.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 if (m_shownRatio == shownRatio) 91 if (m_shownRatio == shownRatio)
92 return; 92 return;
93 93
94 m_shownRatio = shownRatio; 94 m_shownRatio = shownRatio;
95 m_frameHost->chromeClient().didUpdateTopControls(); 95 m_frameHost->chromeClient().didUpdateTopControls();
96 } 96 }
97 97
98 void TopControls::updateConstraints(WebTopControlsState constraints) 98 void TopControls::updateConstraints(WebTopControlsState constraints)
99 { 99 {
100 m_permittedState = constraints; 100 m_permittedState = constraints;
101
102 if (m_permittedState == WebTopControlsShown)
103 setShownRatio(1.f);
104 else if (m_permittedState == WebTopControlsHidden)
105 setShownRatio(0.f);
106 } 101 }
107 102
108 void TopControls::setHeight(float height, bool shrinkViewport) 103 void TopControls::setHeight(float height, bool shrinkViewport)
109 { 104 {
110 if (m_height == height && m_shrinkViewport == shrinkViewport) 105 if (m_height == height && m_shrinkViewport == shrinkViewport)
111 return; 106 return;
112 107
113 m_height = height; 108 m_height = height;
114 m_shrinkViewport = shrinkViewport; 109 m_shrinkViewport = shrinkViewport;
115 m_frameHost->chromeClient().didUpdateTopControls(); 110 m_frameHost->chromeClient().didUpdateTopControls();
116 } 111 }
117 112
118 } // namespace blink 113 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698