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

Unified Diff: public/web/WebView.h

Issue 225303014: [Pinch-to-zoom] Moved scale factor into PinchViewport (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed layout test breakage Created 6 years, 8 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/tests/WebViewTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/web/WebView.h
diff --git a/public/web/WebView.h b/public/web/WebView.h
index 349a9aa6c2ed86de158145fd41491b08bb3ac033..a3d7941514979b06d7f1dc9db06a2f2df4fbcc91 100644
--- a/public/web/WebView.h
+++ b/public/web/WebView.h
@@ -64,6 +64,7 @@ struct WebActiveWheelFlingParameters;
struct WebMediaPlayerAction;
struct WebPluginAction;
struct WebPoint;
+struct WebFloatPoint;
struct WebWindowFeatures;
class WebView : public WebWidget {
@@ -238,15 +239,31 @@ public:
// is scaled up, < 1.0 is scaled down.
virtual float pageScaleFactor() const = 0;
- // Scales the page and the scroll offset by a given factor, while ensuring
- // that the new scroll position does not go beyond the edge of the page.
- virtual void setPageScaleFactorPreservingScrollOffset(float) = 0;
-
+ // TODO: Obsolete, the origin parameter is ambiguous with two viewports. Remove
+ // once Chromium side users are removed.
// Scales a page by a factor of scaleFactor and then sets a scroll position to (x, y).
// setPageScaleFactor() magnifies and shrinks a page without affecting layout.
// On the other hand, zooming affects layout of the page.
virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin) = 0;
+ // TODO: Reevaluate if this is needed once all users are converted to using the
+ // virtual viewport pinch model.
+ // Temporary to keep old style pinch viewport working while we gradually bring up
+ // virtual viewport pinch.
+ virtual void setMainFrameScrollOffset(const WebPoint& origin) = 0;
+
+ // Scales the page without affecting layout by using the pinch-to-zoom viewport.
+ virtual void setPageScaleFactor(float) = 0;
+
+ // Sets the offset of the pinch-to-zoom viewport within the main frame, in
+ // partial CSS pixels. The offset will be clamped so the pinch viewport
+ // stays within the frame's bounds.
+ virtual void setPinchViewportOffset(const WebFloatPoint&) = 0;
+
+ // Gets the pinch viewport's current offset within the page's main frame,
+ // in partial CSS pixels.
+ virtual WebFloatPoint pinchViewportOffset() const = 0;
+
// PageScaleFactor will be force-clamped between minPageScale and maxPageScale
// (and these values will persist until setPageScaleFactorLimits is called
// again).
« no previous file with comments | « Source/web/tests/WebViewTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698