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

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: Rebase 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
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 572e42bd4c3d09d6e3479a593b63e3b8d3a00b5e..477a43843620c60000da6ab3b1fbd2bc1c2c6702 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -412,6 +412,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;
@@ -1661,6 +1662,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)
@@ -4100,11 +4107,13 @@ void WebViewImpl::updateMainFrameScrollPosition(const IntPoint& scrollPosition,
frameView->setInProgrammaticScroll(oldProgrammaticScroll);
}
-void WebViewImpl::applyScrollAndScale(const WebSize& scrollDelta, float pageScaleDelta)
+void WebViewImpl::applyViewportDeltas(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.
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698