 Chromium Code Reviews
 Chromium Code Reviews Issue 225303014:
  [Pinch-to-zoom] Moved scale factor into PinchViewport  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 225303014:
  [Pinch-to-zoom] Moved scale factor into PinchViewport  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| OLD | NEW | 
|---|---|
| 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 Loading... | |
| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 223 virtual float textZoomFactor() = 0; | 224 virtual float textZoomFactor() = 0; | 
| 224 | 225 | 
| 225 // Scales the text in the page by a factor of textZoomFactor. | 226 // Scales the text in the page by a factor of textZoomFactor. | 
| 226 // Note: this has no effect on plugins. | 227 // Note: this has no effect on plugins. | 
| 227 virtual float setTextZoomFactor(float) = 0; | 228 virtual float setTextZoomFactor(float) = 0; | 
| 228 | 229 | 
| 229 // Sets the initial page scale to the given factor. This scale setting overr ides | 230 // Sets the initial page scale to the given factor. This scale setting overr ides | 
| 230 // page scale set in the page's viewport meta tag. | 231 // page scale set in the page's viewport meta tag. | 
| 231 virtual void setInitialPageScaleOverride(float) = 0; | 232 virtual void setInitialPageScaleOverride(float) = 0; | 
| 232 | 233 | 
| 234 // TODO: Remove once all uses are converted to the "PinchViewport" methods b elow. | |
| 233 // Gets the scale factor of the page, where 1.0 is the normal size, > 1.0 | 235 // Gets the scale factor of the page, where 1.0 is the normal size, > 1.0 | 
| 234 // is scaled up, < 1.0 is scaled down. | 236 // is scaled up, < 1.0 is scaled down. | 
| 235 virtual float pageScaleFactor() const = 0; | 237 virtual float pageScaleFactor() const = 0; | 
| 236 | 238 | 
| 237 // Scales the page and the scroll offset by a given factor, while ensuring | 239 // TODO: Remove once all uses are converted to the "PinchViewport" methods b elow. | 
| 238 // that the new scroll position does not go beyond the edge of the page. | |
| 239 virtual void setPageScaleFactorPreservingScrollOffset(float) = 0; | |
| 240 | |
| 241 // Scales a page by a factor of scaleFactor and then sets a scroll position to (x, y). | 240 // Scales a page by a factor of scaleFactor and then sets a scroll position to (x, y). | 
| 242 // setPageScaleFactor() magnifies and shrinks a page without affecting layou t. | 241 // setPageScaleFactor() magnifies and shrinks a page without affecting layou t. | 
| 243 // On the other hand, zooming affects layout of the page. | 242 // On the other hand, zooming affects layout of the page. | 
| 244 virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin) = 0; | 243 virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin) = 0; | 
| 245 | 244 | 
| 245 // TODO: Remove once all uses are converted to the "PinchViewport" methods b elow. | |
| 246 // Temporary to keep old style pinch viewport working while we gradually bri ng up | |
| 247 // virtual viewport pinch. | |
| 248 virtual void setMainFrameScrollOffset(const WebPoint& origin) = 0; | |
| 249 | |
| 250 // Scales the page without affecting layout by using the pinch-to-zoom viewp ort. | |
| 251 virtual void setPinchViewportScaleFactor(float) = 0; | |
| 
aelias_OOO_until_Jul13
2014/04/10 16:23:49
On second thought, I would suggest that you not ch
 | |
| 252 | |
| 253 // Gets the scale factor set on the pinch-to-zoom viewport. | |
| 254 virtual float pinchViewportScaleFactor() const = 0; | |
| 255 | |
| 256 // Sets the offset of the pinch-to-zoom viewport within the main frame, in | |
| 257 // partial CSS pixels. The offset will be clamped so the pinch viewport | |
| 258 // stays within the frame's bounds. | |
| 259 virtual void setPinchViewportOffset(const WebFloatPoint&) = 0; | |
| 260 | |
| 261 // Gets the pinch viewport's current offset within the page's main frame, | |
| 262 // in partial CSS pixels. | |
| 263 virtual WebFloatPoint pinchViewportOffset() const = 0; | |
| 264 | |
| 246 // PageScaleFactor will be force-clamped between minPageScale and maxPageSca le | 265 // PageScaleFactor will be force-clamped between minPageScale and maxPageSca le | 
| 247 // (and these values will persist until setPageScaleFactorLimits is called | 266 // (and these values will persist until setPageScaleFactorLimits is called | 
| 248 // again). | 267 // again). | 
| 249 virtual void setPageScaleFactorLimits(float minPageScale, float maxPageScale ) = 0; | 268 virtual void setPageScaleFactorLimits(float minPageScale, float maxPageScale ) = 0; | 
| 
aelias_OOO_until_Jul13
2014/04/09 21:22:52
Here are three more "PageScaleFactor" methods if y
 | |
| 250 | 269 | 
| 251 virtual float minimumPageScaleFactor() const = 0; | 270 virtual float minimumPageScaleFactor() const = 0; | 
| 252 virtual float maximumPageScaleFactor() const = 0; | 271 virtual float maximumPageScaleFactor() const = 0; | 
| 253 | 272 | 
| 254 // Save the WebView's current scroll and scale state. Each call to this func tion | 273 // Save the WebView's current scroll and scale state. Each call to this func tion | 
| 255 // overwrites the previously saved scroll and scale state. | 274 // overwrites the previously saved scroll and scale state. | 
| 256 virtual void saveScrollAndScaleState() = 0; | 275 virtual void saveScrollAndScaleState() = 0; | 
| 257 | 276 | 
| 258 // Restore the previously saved scroll and scale state. After restoring the | 277 // Restore the previously saved scroll and scale state. After restoring the | 
| 259 // state, this function deletes any saved scroll and scale state. | 278 // state, this function deletes any saved scroll and scale state. | 
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 492 | 511 | 
| 493 // Testing functionality for TestRunner --------------------------------- | 512 // Testing functionality for TestRunner --------------------------------- | 
| 494 | 513 | 
| 495 protected: | 514 protected: | 
| 496 ~WebView() {} | 515 ~WebView() {} | 
| 497 }; | 516 }; | 
| 498 | 517 | 
| 499 } // namespace blink | 518 } // namespace blink | 
| 500 | 519 | 
| 501 #endif | 520 #endif | 
| OLD | NEW |