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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 584833003: Made double-tap zoom work in pinch virtual viewport mode. (Blink-side) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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') | no next file » | 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 18d6939011cee586b8b011d77289778ce0b4768a..fe748490820a4b17a216c79649ef7b5088fd20e3 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -2889,7 +2889,10 @@ IntPoint WebViewImpl::clampOffsetAtScale(const IntPoint& offset, float scale)
if (!view)
return offset;
- return view->clampOffsetAtScale(offset, scale);
+ if (!pinchVirtualViewportEnabled())
+ return view->clampOffsetAtScale(offset, scale);
+
+ return page()->frameHost().pinchViewport().clampDocumentOffsetAtScale(offset, scale);
}
bool WebViewImpl::pinchVirtualViewportEnabled() const
@@ -2938,6 +2941,19 @@ void WebViewImpl::setPageScaleFactor(float scaleFactor)
deviceOrPageScaleFactorChanged();
}
+void WebViewImpl::setPageScaleFactorFromImpl(float scaleFactor)
+{
+ ASSERT(page());
+ ASSERT(pinchVirtualViewportEnabled());
+
+ scaleFactor = clampPageScaleFactorToLimits(scaleFactor);
+ if (scaleFactor == pageScaleFactor())
+ return;
+
+ page()->frameHost().pinchViewport().setScaleWithoutClampingViewportOffset(scaleFactor);
+ deviceOrPageScaleFactorChanged();
+}
+
void WebViewImpl::setMainFrameScrollOffset(const WebPoint& origin)
{
updateMainFrameScrollPosition(origin, false);
@@ -4146,8 +4162,10 @@ void WebViewImpl::applyViewportDeltas(const WebSize& scrollDelta, float pageScal
if (pinchVirtualViewportEnabled()) {
if (pageScaleDelta != 1) {
- // When the virtual viewport is enabled, offsets are already set for us.
- setPageScaleFactor(pageScaleFactor() * pageScaleDelta);
+ // When the virtual viewport is enabled, offsets are already set for us. Don't clamp
aelias_OOO_until_Jul13 2014/09/19 22:39:21 We've so far always been able to avoid "don't clam
+ // the viewport offset when setting page scale here, it will be clamped when the
+ // compositor sets the viewport offset immediately following this.
+ setPageScaleFactorFromImpl(pageScaleFactor() * pageScaleDelta);
m_doubleTapZoomPending = false;
}
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698