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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 WEBKIT_EXPORT static double zoomFactorToZoomLevel(double factor); | 226 WEBKIT_EXPORT static double zoomFactorToZoomLevel(double factor); |
227 | 227 |
228 // Sets the initial page scale to the given factor. This scale setting overr
ides | 228 // Sets the initial page scale to the given factor. This scale setting overr
ides |
229 // page scale set in the page's viewport meta tag. | 229 // page scale set in the page's viewport meta tag. |
230 virtual void setInitialPageScaleOverride(float) = 0; | 230 virtual void setInitialPageScaleOverride(float) = 0; |
231 | 231 |
232 // Gets the scale factor of the page, where 1.0 is the normal size, > 1.0 | 232 // Gets the scale factor of the page, where 1.0 is the normal size, > 1.0 |
233 // is scaled up, < 1.0 is scaled down. | 233 // is scaled up, < 1.0 is scaled down. |
234 virtual float pageScaleFactor() const = 0; | 234 virtual float pageScaleFactor() const = 0; |
235 | 235 |
236 // Indicates whether the page scale factor has been set since navigating | |
237 // to a new page. | |
238 virtual bool isPageScaleFactorSet() const = 0; | |
239 | |
240 // Scales the page and the scroll offset by a given factor, while ensuring | 236 // Scales the page and the scroll offset by a given factor, while ensuring |
241 // that the new scroll position does not go beyond the edge of the page. | 237 // that the new scroll position does not go beyond the edge of the page. |
242 virtual void setPageScaleFactorPreservingScrollOffset(float) = 0; | 238 virtual void setPageScaleFactorPreservingScrollOffset(float) = 0; |
243 | 239 |
244 // 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). |
245 // setPageScaleFactor() magnifies and shrinks a page without affecting layou
t. | 241 // setPageScaleFactor() magnifies and shrinks a page without affecting layou
t. |
246 // On the other hand, zooming affects layout of the page. | 242 // On the other hand, zooming affects layout of the page. |
247 virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin) =
0; | 243 virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin) =
0; |
248 | 244 |
249 // PageScaleFactor will be force-clamped between minPageScale and maxPageSca
le | 245 // PageScaleFactor will be force-clamped between minPageScale and maxPageSca
le |
250 // (and these values will persist until setPageScaleFactorLimits is called | 246 // (and these values will persist until setPageScaleFactorLimits is called |
251 // again). | 247 // again). |
252 virtual void setPageScaleFactorLimits(float minPageScale, float maxPageScale
) = 0; | 248 virtual void setPageScaleFactorLimits(float minPageScale, float maxPageScale
) = 0; |
253 | 249 |
254 virtual float minimumPageScaleFactor() const = 0; | 250 virtual float minimumPageScaleFactor() const = 0; |
255 virtual float maximumPageScaleFactor() const = 0; | 251 virtual float maximumPageScaleFactor() const = 0; |
256 | 252 |
257 // Save the WebView's current scroll and scale state. Each call to this func
tion | 253 // Save the WebView's current scroll and scale state. Each call to this func
tion |
258 // overwrites the previously saved scroll and scale state. | 254 // overwrites the previously saved scroll and scale state. |
259 virtual void saveScrollAndScaleState() = 0; | 255 virtual void saveScrollAndScaleState() = 0; |
260 | 256 |
261 // Restore the previously saved scroll and scale state. After restoring the | 257 // Restore the previously saved scroll and scale state. After restoring the |
262 // state, this function deletes any saved scroll and scale state. | 258 // state, this function deletes any saved scroll and scale state. |
263 virtual void restoreScrollAndScaleState() = 0; | 259 virtual void restoreScrollAndScaleState() = 0; |
264 | 260 |
265 // Reset any saved values for the scroll and scale state. | 261 // Reset any saved values for the scroll and scale state. |
266 virtual void resetScrollAndScaleState() = 0; | 262 virtual void resetScrollAndScaleState() = 0; |
267 | 263 |
268 // Prevent the web page from setting a maximum scale via the viewport meta | 264 // Prevent the web page from setting min/max scale via the viewport meta |
269 // tag. This is an accessibility feature that lets folks zoom in to web | 265 // tag. This is an accessibility feature that lets folks zoom in to web |
270 // pages even if the web page tries to block scaling. | 266 // pages even if the web page tries to block scaling. |
271 virtual void setIgnoreViewportTagMaximumScale(bool) = 0; | 267 virtual void setIgnoreViewportTagScaleLimits(bool) = 0; |
| 268 |
| 269 // FIXME(aelias): Delete this after Chromium switches to the other name. |
| 270 void setIgnoreViewportTagMaximumScale(bool ignore) { setIgnoreViewportTagSca
leLimits(ignore); } |
272 | 271 |
273 // The ratio of the current device's screen DPI to the target device's scree
n DPI. | 272 // The ratio of the current device's screen DPI to the target device's scree
n DPI. |
274 virtual float deviceScaleFactor() const = 0; | 273 virtual float deviceScaleFactor() const = 0; |
275 | 274 |
276 // Sets the ratio as computed by computeViewportAttributes. | 275 // Sets the ratio as computed by computeViewportAttributes. |
277 virtual void setDeviceScaleFactor(float) = 0; | 276 virtual void setDeviceScaleFactor(float) = 0; |
278 | 277 |
279 | 278 |
280 // Fixed Layout -------------------------------------------------------- | 279 // Fixed Layout -------------------------------------------------------- |
281 | 280 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 | 501 |
503 // Testing functionality for TestRunner --------------------------------- | 502 // Testing functionality for TestRunner --------------------------------- |
504 | 503 |
505 protected: | 504 protected: |
506 ~WebView() {} | 505 ~WebView() {} |
507 }; | 506 }; |
508 | 507 |
509 } // namespace WebKit | 508 } // namespace WebKit |
510 | 509 |
511 #endif | 510 #endif |
OLD | NEW |