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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 655763002: Revert of Made top controls work with virtual viewport pinch-to-zoom. (Blink) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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/PageScaleConstraintsSet.cpp ('k') | Source/web/tests/PinchViewportTest.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 79018e8aefcd6e3117dbd534e39b1501b650e52b..38a0553d0af224ed7fd473dcc023b28adf606ec6 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -1716,22 +1716,11 @@
if (!view)
return;
- float topControlsViewportAdjustment = m_topControlsLayoutHeight - m_topControlsContentOffset;
- if (!pinchVirtualViewportEnabled()) {
- // 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.
- view->setTopControlsViewportAdjustment(topControlsViewportAdjustment);
- } else {
- PinchViewport& pinchViewport = page()->frameHost().pinchViewport();
- pinchViewport.setTopControlsAdjustment(topControlsViewportAdjustment);
-
- // Shrink the FrameView by the amount that will maintain the aspect-ratio with the PinchViewport.
- float aspectRatio = pinchViewport.visibleRect().width() / pinchViewport.visibleRect().height();
- float newHeight = view->unscaledVisibleContentSize(ExcludeScrollbars).width() / aspectRatio;
- float adjustment = newHeight - view->unscaledVisibleContentSize(ExcludeScrollbars).height();
- view->setTopControlsViewportAdjustment(adjustment);
- }
+ // 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.
+ float topControlsViewportAdjustment = m_topControlsContentOffset - m_topControlsLayoutHeight;
+ view->setTopControlsViewportAdjustment(topControlsViewportAdjustment);
}
void WebViewImpl::resize(const WebSize& newSize)
« no previous file with comments | « Source/web/PageScaleConstraintsSet.cpp ('k') | Source/web/tests/PinchViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698