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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « Source/web/tests/WebViewTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 class WebRange; 57 class WebRange;
58 class WebSettings; 58 class WebSettings;
59 class WebSpellCheckClient; 59 class WebSpellCheckClient;
60 class WebString; 60 class WebString;
61 class WebPasswordGeneratorClient; 61 class WebPasswordGeneratorClient;
62 class WebViewClient; 62 class WebViewClient;
63 struct WebActiveWheelFlingParameters; 63 struct WebActiveWheelFlingParameters;
64 struct WebMediaPlayerAction; 64 struct WebMediaPlayerAction;
65 struct WebPluginAction; 65 struct WebPluginAction;
66 struct WebPoint; 66 struct WebPoint;
67 struct WebFloatPoint;
67 struct WebWindowFeatures; 68 struct WebWindowFeatures;
68 69
69 class WebView : public WebWidget { 70 class WebView : public WebWidget {
70 public: 71 public:
71 BLINK_EXPORT static const double textSizeMultiplierRatio; 72 BLINK_EXPORT static const double textSizeMultiplierRatio;
72 BLINK_EXPORT static const double minTextSizeMultiplier; 73 BLINK_EXPORT static const double minTextSizeMultiplier;
73 BLINK_EXPORT static const double maxTextSizeMultiplier; 74 BLINK_EXPORT static const double maxTextSizeMultiplier;
74 BLINK_EXPORT static const float minPageScaleFactor; 75 BLINK_EXPORT static const float minPageScaleFactor;
75 BLINK_EXPORT static const float maxPageScaleFactor; 76 BLINK_EXPORT static const float maxPageScaleFactor;
76 77
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 virtual float setTextZoomFactor(float) = 0; 232 virtual float setTextZoomFactor(float) = 0;
232 233
233 // Sets the initial page scale to the given factor. This scale setting overr ides 234 // Sets the initial page scale to the given factor. This scale setting overr ides
234 // page scale set in the page's viewport meta tag. 235 // page scale set in the page's viewport meta tag.
235 virtual void setInitialPageScaleOverride(float) = 0; 236 virtual void setInitialPageScaleOverride(float) = 0;
236 237
237 // Gets the scale factor of the page, where 1.0 is the normal size, > 1.0 238 // Gets the scale factor of the page, where 1.0 is the normal size, > 1.0
238 // is scaled up, < 1.0 is scaled down. 239 // is scaled up, < 1.0 is scaled down.
239 virtual float pageScaleFactor() const = 0; 240 virtual float pageScaleFactor() const = 0;
240 241
241 // Scales the page and the scroll offset by a given factor, while ensuring 242 // TODO: Obsolete, the origin parameter is ambiguous with two viewports. Rem ove
242 // that the new scroll position does not go beyond the edge of the page. 243 // once Chromium side users are removed.
243 virtual void setPageScaleFactorPreservingScrollOffset(float) = 0;
244
245 // Scales a page by a factor of scaleFactor and then sets a scroll position to (x, y). 244 // Scales a page by a factor of scaleFactor and then sets a scroll position to (x, y).
246 // setPageScaleFactor() magnifies and shrinks a page without affecting layou t. 245 // setPageScaleFactor() magnifies and shrinks a page without affecting layou t.
247 // On the other hand, zooming affects layout of the page. 246 // On the other hand, zooming affects layout of the page.
248 virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin) = 0; 247 virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin) = 0;
249 248
249 // TODO: Reevaluate if this is needed once all users are converted to using the
250 // virtual viewport pinch model.
251 // Temporary to keep old style pinch viewport working while we gradually bri ng up
252 // virtual viewport pinch.
253 virtual void setMainFrameScrollOffset(const WebPoint& origin) = 0;
254
255 // Scales the page without affecting layout by using the pinch-to-zoom viewp ort.
256 virtual void setPageScaleFactor(float) = 0;
257
258 // Sets the offset of the pinch-to-zoom viewport within the main frame, in
259 // partial CSS pixels. The offset will be clamped so the pinch viewport
260 // stays within the frame's bounds.
261 virtual void setPinchViewportOffset(const WebFloatPoint&) = 0;
262
263 // Gets the pinch viewport's current offset within the page's main frame,
264 // in partial CSS pixels.
265 virtual WebFloatPoint pinchViewportOffset() const = 0;
266
250 // PageScaleFactor will be force-clamped between minPageScale and maxPageSca le 267 // PageScaleFactor will be force-clamped between minPageScale and maxPageSca le
251 // (and these values will persist until setPageScaleFactorLimits is called 268 // (and these values will persist until setPageScaleFactorLimits is called
252 // again). 269 // again).
253 virtual void setPageScaleFactorLimits(float minPageScale, float maxPageScale ) = 0; 270 virtual void setPageScaleFactorLimits(float minPageScale, float maxPageScale ) = 0;
254 271
255 virtual float minimumPageScaleFactor() const = 0; 272 virtual float minimumPageScaleFactor() const = 0;
256 virtual float maximumPageScaleFactor() const = 0; 273 virtual float maximumPageScaleFactor() const = 0;
257 274
258 // Save the WebView's current scroll and scale state. Each call to this func tion 275 // Save the WebView's current scroll and scale state. Each call to this func tion
259 // overwrites the previously saved scroll and scale state. 276 // overwrites the previously saved scroll and scale state.
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 508
492 // Testing functionality for TestRunner --------------------------------- 509 // Testing functionality for TestRunner ---------------------------------
493 510
494 protected: 511 protected:
495 ~WebView() {} 512 ~WebView() {}
496 }; 513 };
497 514
498 } // namespace blink 515 } // namespace blink
499 516
500 #endif 517 #endif
OLDNEW
« 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