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

Unified Diff: Source/core/frame/PinchViewport.cpp

Issue 1025543002: Remove old pinch-zoom paths from Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 9 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/core/frame/PinchViewport.h ('k') | Source/core/frame/Settings.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/PinchViewport.cpp
diff --git a/Source/core/frame/PinchViewport.cpp b/Source/core/frame/PinchViewport.cpp
index 48cbcf0639a7758cbc9d110a144762bcec264058..4f34e86a33203faac127a995df9c5862db556466 100644
--- a/Source/core/frame/PinchViewport.cpp
+++ b/Source/core/frame/PinchViewport.cpp
@@ -210,6 +210,20 @@ void PinchViewport::move(const FloatSize& delta)
setLocation(m_offset + delta);
}
+void PinchViewport::setLocationInDocument(const DoublePoint& location)
+{
+ if (!mainFrame() || !mainFrame()->view())
+ return;
+
+ FrameView* view = mainFrame()->view();
+
+ DoublePoint currentLocation = visibleRectInDocument().location();
+ view->setScrollPosition(DoublePoint(location - currentLocation));
+
+ currentLocation = visibleRectInDocument().location();
+ move(toFloatSize(location - currentLocation));
+}
+
void PinchViewport::setScale(float scale)
{
setScaleAndLocation(scale, m_offset);
« no previous file with comments | « Source/core/frame/PinchViewport.h ('k') | Source/core/frame/Settings.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698