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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 // in partial CSS pixels. | 283 // in partial CSS pixels. |
284 virtual WebFloatPoint visualViewportOffset() const = 0; | 284 virtual WebFloatPoint visualViewportOffset() const = 0; |
285 | 285 |
286 // Get the visual viewport's size in CSS pixels. | 286 // Get the visual viewport's size in CSS pixels. |
287 virtual WebFloatSize visualViewportSize() const = 0; | 287 virtual WebFloatSize visualViewportSize() const = 0; |
288 | 288 |
289 // Sets the default minimum, and maximum page scale. These will be overridden | 289 // Sets the default minimum, and maximum page scale. These will be overridden |
290 // by the page or by the overrides below if they are set. | 290 // by the page or by the overrides below if they are set. |
291 virtual void setDefaultPageScaleLimits(float minScale, float maxScale) = 0; | 291 virtual void setDefaultPageScaleLimits(float minScale, float maxScale) = 0; |
292 | 292 |
293 // Sets the initial page scale to the given factor. This scale setting overrid
es | 293 // Sets the initial page scale to the given factor. This scale setting |
| 294 // overrides |
294 // page scale set in the page's viewport meta tag. | 295 // page scale set in the page's viewport meta tag. |
295 virtual void setInitialPageScaleOverride(float) = 0; | 296 virtual void setInitialPageScaleOverride(float) = 0; |
296 | 297 |
297 // Sets the maximum page scale considered to be legible. Automatic zooms (e.g,
double-tap | 298 // Sets the maximum page scale considered to be legible. Automatic zooms (e.g, |
298 // or find in page) will have the page scale limited to this value times the f
ont scale | 299 // double-tap or find in page) will have the page scale limited to this value |
299 // factor. Manual pinch zoom will not be affected by this limit. | 300 // times the font scale factor. Manual pinch zoom will not be affected by this |
| 301 // limit. |
300 virtual void setMaximumLegibleScale(float) = 0; | 302 virtual void setMaximumLegibleScale(float) = 0; |
301 | 303 |
302 // Reset any saved values for the scroll and scale state. | 304 // Reset any saved values for the scroll and scale state. |
303 virtual void resetScrollAndScaleState() = 0; | 305 virtual void resetScrollAndScaleState() = 0; |
304 | 306 |
305 // Prevent the web page from setting min/max scale via the viewport meta | 307 // Prevent the web page from setting min/max scale via the viewport meta |
306 // tag. This is an accessibility feature that lets folks zoom in to web | 308 // tag. This is an accessibility feature that lets folks zoom in to web |
307 // pages even if the web page tries to block scaling. | 309 // pages even if the web page tries to block scaling. |
308 virtual void setIgnoreViewportTagScaleLimits(bool) = 0; | 310 virtual void setIgnoreViewportTagScaleLimits(bool) = 0; |
309 | 311 |
310 // Returns the "preferred" contents size, defined as the preferred minimum wid
th of the main document's contents | 312 // Returns the "preferred" contents size, defined as the preferred minimum |
311 // and the minimum height required to display the main document without scroll
bars. | 313 // width of the main document's contents and the minimum height required to |
312 // The returned size has the page zoom factor applied. | 314 // display the main document without scrollbars. The returned size has the |
| 315 // page zoom factor applied. |
313 virtual WebSize contentsPreferredMinimumSize() = 0; | 316 virtual WebSize contentsPreferredMinimumSize() = 0; |
314 | 317 |
315 // Sets the display mode of the web app. | 318 // Sets the display mode of the web app. |
316 virtual void setDisplayMode(WebDisplayMode) = 0; | 319 virtual void setDisplayMode(WebDisplayMode) = 0; |
317 | 320 |
318 // Sets the ratio as computed by computePageScaleConstraints. | 321 // Sets the ratio as computed by computePageScaleConstraints. |
319 // TODO(oshima): Remove this once the device scale factor implementation is fu
lly | 322 // TODO(oshima): Remove this once the device scale factor implementation is |
320 // migrated to use zooming mechanism. | 323 // fully migrated to use zooming mechanism. |
321 virtual void setDeviceScaleFactor(float) = 0; | 324 virtual void setDeviceScaleFactor(float) = 0; |
322 | 325 |
323 // Sets the additional zoom factor used for device scale factor. This is used | 326 // Sets the additional zoom factor used for device scale factor. This is used |
324 // to scale the content by the device scale factor, without affecting zoom lev
el. | 327 // to scale the content by the device scale factor, without affecting zoom |
| 328 // level. |
325 virtual void setZoomFactorForDeviceScaleFactor(float) = 0; | 329 virtual void setZoomFactorForDeviceScaleFactor(float) = 0; |
326 | 330 |
327 // Set and reset the device color profile. | 331 // Set and reset the device color profile. |
328 virtual void setDeviceColorProfile(const WebVector<char>&) = 0; | 332 virtual void setDeviceColorProfile(const WebVector<char>&) = 0; |
329 | 333 |
330 // Resize the view at the same time as changing the state of the top | 334 // Resize the view at the same time as changing the state of the top |
331 // controls. If |topControlsShrinkLayout| is true, the embedder shrunk the | 335 // controls. If |topControlsShrinkLayout| is true, the embedder shrunk the |
332 // WebView size by the top controls height. | 336 // WebView size by the top controls height. |
333 virtual void resizeWithTopControls(const WebSize&, | 337 virtual void resizeWithTopControls(const WebSize&, |
334 float topControlsHeight, | 338 float topControlsHeight, |
335 bool topControlsShrinkLayout) = 0; | 339 bool topControlsShrinkLayout) = 0; |
336 | 340 |
337 // Auto-Resize ----------------------------------------------------------- | 341 // Auto-Resize ----------------------------------------------------------- |
338 | 342 |
339 // In auto-resize mode, the view is automatically adjusted to fit the html | 343 // In auto-resize mode, the view is automatically adjusted to fit the html |
340 // content within the given bounds. | 344 // content within the given bounds. |
341 virtual void enableAutoResizeMode(const WebSize& minSize, | 345 virtual void enableAutoResizeMode(const WebSize& minSize, |
342 const WebSize& maxSize) = 0; | 346 const WebSize& maxSize) = 0; |
343 | 347 |
344 // Turn off auto-resize. | 348 // Turn off auto-resize. |
345 virtual void disableAutoResizeMode() = 0; | 349 virtual void disableAutoResizeMode() = 0; |
346 | 350 |
347 // Media --------------------------------------------------------------- | 351 // Media --------------------------------------------------------------- |
348 | 352 |
349 // Performs the specified media player action on the node at the given locatio
n. | 353 // Performs the specified media player action on the node at the given |
| 354 // location. |
350 virtual void performMediaPlayerAction(const WebMediaPlayerAction&, | 355 virtual void performMediaPlayerAction(const WebMediaPlayerAction&, |
351 const WebPoint& location) = 0; | 356 const WebPoint& location) = 0; |
352 | 357 |
353 // Performs the specified plugin action on the node at the given location. | 358 // Performs the specified plugin action on the node at the given location. |
354 virtual void performPluginAction(const WebPluginAction&, | 359 virtual void performPluginAction(const WebPluginAction&, |
355 const WebPoint& location) = 0; | 360 const WebPoint& location) = 0; |
356 | 361 |
357 // Data exchange ------------------------------------------------------- | 362 // Data exchange ------------------------------------------------------- |
358 | 363 |
359 // Do a hit test at given point and return the HitTestResult. | 364 // Do a hit test at given point and return the HitTestResult. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 unsigned inactiveBackgroundColor, | 464 unsigned inactiveBackgroundColor, |
460 unsigned inactiveForegroundColor) = 0; | 465 unsigned inactiveForegroundColor) = 0; |
461 | 466 |
462 // Modal dialog support ------------------------------------------------ | 467 // Modal dialog support ------------------------------------------------ |
463 | 468 |
464 // Call these methods before and after running a nested, modal event loop | 469 // Call these methods before and after running a nested, modal event loop |
465 // to suspend script callbacks and resource loads. | 470 // to suspend script callbacks and resource loads. |
466 BLINK_EXPORT static void willEnterModalLoop(); | 471 BLINK_EXPORT static void willEnterModalLoop(); |
467 BLINK_EXPORT static void didExitModalLoop(); | 472 BLINK_EXPORT static void didExitModalLoop(); |
468 | 473 |
469 // Called to inform the WebView that a wheel fling animation was started exter
nally (for instance | 474 // Called to inform the WebView that a wheel fling animation was started |
470 // by the compositor) but must be completed by the WebView. | 475 // externally (for instance by the compositor) but must be completed by the |
| 476 // WebView. |
471 virtual void transferActiveWheelFlingAnimation( | 477 virtual void transferActiveWheelFlingAnimation( |
472 const WebActiveWheelFlingParameters&) = 0; | 478 const WebActiveWheelFlingParameters&) = 0; |
473 | 479 |
474 // Cancels an active fling, returning true if a fling was active. | 480 // Cancels an active fling, returning true if a fling was active. |
475 virtual bool endActiveFlingAnimation() = 0; | 481 virtual bool endActiveFlingAnimation() = 0; |
476 | 482 |
477 // Returns true if there's an active fling animation. | 483 // Returns true if there's an active fling animation. |
478 virtual bool isFlinging() const = 0; | 484 virtual bool isFlinging() const = 0; |
479 | 485 |
480 virtual void setShowPaintRects(bool) = 0; | 486 virtual void setShowPaintRects(bool) = 0; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 // completed. | 531 // completed. |
526 WebWidget* widget() { return this; } | 532 WebWidget* widget() { return this; } |
527 | 533 |
528 protected: | 534 protected: |
529 ~WebView() {} | 535 ~WebView() {} |
530 }; | 536 }; |
531 | 537 |
532 } // namespace blink | 538 } // namespace blink |
533 | 539 |
534 #endif | 540 #endif |
OLD | NEW |