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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 513053003: Made Blink aware of top controls offset (Blink-side) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added top_controls_content_offset Created 6 years, 3 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: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index a95346118a8a53bb327cf1173dcb3b3895635900..4fdab03b9aabaa93bbad2f40059d8c858b8bc294 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -410,6 +410,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_backgroundColorOverride(Color::transparent)
, m_zoomFactorOverride(0)
, m_userGestureObserved(false)
+ , m_topControlsContentOffset(0)
{
Page::PageClients pageClients;
pageClients.chromeClient = &m_chromeClientImpl;
@@ -1654,6 +1655,12 @@ void WebViewImpl::performResize()
}
}
+void WebViewImpl::setTopControlsContentOffset(float offset)
+{
+ m_topControlsContentOffset = offset;
+ m_layerTreeView->setTopControlsContentOffset(offset);
+}
+
void WebViewImpl::resize(const WebSize& newSize)
{
if (m_shouldAutoResize || m_size == newSize)
@@ -4094,11 +4101,13 @@ void WebViewImpl::updateMainFrameScrollPosition(const IntPoint& scrollPosition,
frameView->setInProgrammaticScroll(oldProgrammaticScroll);
}
-void WebViewImpl::applyScrollAndScale(const WebSize& scrollDelta, float pageScaleDelta)
+void WebViewImpl::applyViewportProperties(const WebSize& scrollDelta, float pageScaleDelta, float topControlsDelta)
{
if (!mainFrameImpl() || !mainFrameImpl()->frameView())
return;
+ setTopControlsContentOffset(m_topControlsContentOffset + topControlsDelta);
+
if (pinchVirtualViewportEnabled()) {
if (pageScaleDelta != 1) {
// When the virtual viewport is enabled, offsets are already set for us.

Powered by Google App Engine
This is Rietveld 408576698