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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 560623002: Adjust maximum scroll bounds on FrameView to account for top controls. (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 3cc40830398ad515275708a40db35074d99bef98..0e57764ac25aa38e86787f9eaca25328fa8d7703 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -420,6 +420,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_zoomFactorOverride(0)
, m_userGestureObserved(false)
, m_topControlsContentOffset(0)
+ , m_topControlsLayoutHeight(0)
{
Page::PageClients pageClients;
pageClients.chromeClient = &m_chromeClientImpl;
@@ -1685,6 +1686,27 @@ void WebViewImpl::setTopControlsContentOffset(float offset)
{
m_topControlsContentOffset = offset;
m_layerTreeView->setTopControlsContentOffset(offset);
+ didUpdateTopControls();
+}
+
+void WebViewImpl::setTopControlsLayoutHeight(float height)
+{
+ m_topControlsLayoutHeight = height;
+ didUpdateTopControls();
+}
+
+void WebViewImpl::didUpdateTopControls()
+{
+ FrameView* view = localFrameRootTemporary()->frameView();
+ if (!view)
+ return;
+
+ // The viewport bounds were adjusted on the compositor by this much due to top controls. Tell
+ // the FrameView about it so it can make correct scroll offset clamping decisions during compositor
+ // commits.
+ // FIXME(bokan) Reenable once Chromium side lands.
+ // float topControlsViewportAdjustment = m_topControlsContentOffset - m_topControlsLayoutHeight;
+ // view->setTopControlsViewportAdjustment(topControlsViewportAdjustment);
}
void WebViewImpl::resize(const WebSize& newSize)
« 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