| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 class WebViewImpl : public WebView | 124 class WebViewImpl : public WebView |
| 125 , public RefCounted<WebViewImpl> | 125 , public RefCounted<WebViewImpl> |
| 126 , public WebGestureCurveTarget | 126 , public WebGestureCurveTarget |
| 127 , public WebCore::PagePopupDriver | 127 , public WebCore::PagePopupDriver |
| 128 , public PageWidgetEventHandler { | 128 , public PageWidgetEventHandler { |
| 129 public: | 129 public: |
| 130 enum AutoZoomType { | 130 enum AutoZoomType { |
| 131 DoubleTap, | 131 DoubleTap, |
| 132 FindInPage, | 132 FindInPage, |
| 133 MultipleTargets, |
| 133 }; | 134 }; |
| 134 | 135 |
| 135 // WebWidget methods: | 136 // WebWidget methods: |
| 136 virtual void close(); | 137 virtual void close(); |
| 137 virtual WebSize size(); | 138 virtual WebSize size(); |
| 138 virtual void willStartLiveResize(); | 139 virtual void willStartLiveResize(); |
| 139 virtual void resize(const WebSize&); | 140 virtual void resize(const WebSize&); |
| 140 virtual void willEndLiveResize(); | 141 virtual void willEndLiveResize(); |
| 141 virtual void willEnterFullScreen(); | 142 virtual void willEnterFullScreen(); |
| 142 virtual void didEnterFullScreen(); | 143 virtual void didEnterFullScreen(); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 virtual void clearFocusedNode(); | 217 virtual void clearFocusedNode(); |
| 217 virtual void scrollFocusedNodeIntoView(); | 218 virtual void scrollFocusedNodeIntoView(); |
| 218 virtual void scrollFocusedNodeIntoRect(const WebRect&); | 219 virtual void scrollFocusedNodeIntoRect(const WebRect&); |
| 219 virtual void zoomToFindInPageRect(const WebRect&); | 220 virtual void zoomToFindInPageRect(const WebRect&); |
| 220 virtual void advanceFocus(bool reverse); | 221 virtual void advanceFocus(bool reverse); |
| 221 virtual double zoomLevel(); | 222 virtual double zoomLevel(); |
| 222 virtual double setZoomLevel(bool textOnly, double zoomLevel); | 223 virtual double setZoomLevel(bool textOnly, double zoomLevel); |
| 223 virtual void zoomLimitsChanged(double minimumZoomLevel, | 224 virtual void zoomLimitsChanged(double minimumZoomLevel, |
| 224 double maximumZoomLevel); | 225 double maximumZoomLevel); |
| 225 virtual void setInitialPageScaleOverride(float); | 226 virtual void setInitialPageScaleOverride(float); |
| 227 virtual bool zoomToMultipleTargetsRect(const WebRect&); |
| 226 virtual float pageScaleFactor() const; | 228 virtual float pageScaleFactor() const; |
| 227 virtual void setPageScaleFactorPreservingScrollOffset(float); | 229 virtual void setPageScaleFactorPreservingScrollOffset(float); |
| 228 virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin); | 230 virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin); |
| 229 virtual void setPageScaleFactorLimits(float minPageScale, float maxPageScale
); | 231 virtual void setPageScaleFactorLimits(float minPageScale, float maxPageScale
); |
| 230 virtual float minimumPageScaleFactor() const; | 232 virtual float minimumPageScaleFactor() const; |
| 231 virtual float maximumPageScaleFactor() const; | 233 virtual float maximumPageScaleFactor() const; |
| 232 virtual void saveScrollAndScaleState(); | 234 virtual void saveScrollAndScaleState(); |
| 233 virtual void restoreScrollAndScaleState(); | 235 virtual void restoreScrollAndScaleState(); |
| 234 virtual void resetScrollAndScaleState(); | 236 virtual void resetScrollAndScaleState(); |
| 235 virtual void setIgnoreViewportTagScaleLimits(bool); | 237 virtual void setIgnoreViewportTagScaleLimits(bool); |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 // Called by a full frame plugin inside this view to inform it that its | 523 // Called by a full frame plugin inside this view to inform it that its |
| 522 // zoom level has been updated. The plugin should only call this function | 524 // zoom level has been updated. The plugin should only call this function |
| 523 // if the zoom change was triggered by the browser, it's only needed in case | 525 // if the zoom change was triggered by the browser, it's only needed in case |
| 524 // a plugin can update its own zoom, say because of its own UI. | 526 // a plugin can update its own zoom, say because of its own UI. |
| 525 void fullFramePluginZoomLevelChanged(double zoomLevel); | 527 void fullFramePluginZoomLevelChanged(double zoomLevel); |
| 526 | 528 |
| 527 void computeScaleAndScrollForHitRect(const WebRect& hitRect, AutoZoomType, f
loat& scale, WebPoint& scroll, bool& isAnchor); | 529 void computeScaleAndScrollForHitRect(const WebRect& hitRect, AutoZoomType, f
loat& scale, WebPoint& scroll, bool& isAnchor); |
| 528 WebCore::Node* bestTapNode(const WebCore::PlatformGestureEvent& tapEvent); | 530 WebCore::Node* bestTapNode(const WebCore::PlatformGestureEvent& tapEvent); |
| 529 void enableTapHighlight(const WebCore::PlatformGestureEvent& tapEvent); | 531 void enableTapHighlight(const WebCore::PlatformGestureEvent& tapEvent); |
| 530 void computeScaleAndScrollForFocusedNode(WebCore::Node* focusedNode, float&
scale, WebCore::IntPoint& scroll, bool& needAnimation); | 532 void computeScaleAndScrollForFocusedNode(WebCore::Node* focusedNode, float&
scale, WebCore::IntPoint& scroll, bool& needAnimation); |
| 531 void animateZoomAroundPoint(const WebCore::IntPoint&, AutoZoomType); | 533 |
| 534 // The rect has different meanings depending on zoom type: |
| 535 // - DoubleTap |
| 536 // Point where a double tap occured, will zoom to fit an element. |
| 537 // - FindInPage |
| 538 // Enclosing rect of the element we would like to zoom to. |
| 539 // - MultipleTargets |
| 540 // Window we would like to zoom into. |
| 541 bool animateZoomToRect(const WebCore::IntRect&, AutoZoomType); |
| 532 | 542 |
| 533 void enableFakeDoubleTapAnimationForTesting(bool); | 543 void enableFakeDoubleTapAnimationForTesting(bool); |
| 534 bool fakeDoubleTapAnimationPendingForTesting() const { return m_doubleTapZoo
mPending; } | 544 bool fakeDoubleTapAnimationPendingForTesting() const { return m_doubleTapZoo
mPending; } |
| 535 WebCore::IntPoint fakeDoubleTapTargetPositionForTesting() const { return m_f
akeDoubleTapTargetPosition; } | 545 WebCore::IntPoint fakeDoubleTapTargetPositionForTesting() const { return m_f
akeDoubleTapTargetPosition; } |
| 536 float fakeDoubleTapPageScaleFactorForTesting() const { return m_fakeDoubleTa
pPageScaleFactor; } | 546 float fakeDoubleTapPageScaleFactorForTesting() const { return m_fakeDoubleTa
pPageScaleFactor; } |
| 537 bool fakeDoubleTapUseAnchorForTesting() const { return m_fakeDoubleTapUseAnc
hor; } | 547 bool fakeDoubleTapUseAnchorForTesting() const { return m_fakeDoubleTapUseAnc
hor; } |
| 538 | 548 |
| 539 void enterFullScreenForElement(WebCore::Element*); | 549 void enterFullScreenForElement(WebCore::Element*); |
| 540 void exitFullScreenForElement(WebCore::Element*); | 550 void exitFullScreenForElement(WebCore::Element*); |
| 541 | 551 |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 bool m_showFPSCounter; | 842 bool m_showFPSCounter; |
| 833 bool m_showPaintRects; | 843 bool m_showPaintRects; |
| 834 bool m_showDebugBorders; | 844 bool m_showDebugBorders; |
| 835 bool m_continuousPaintingEnabled; | 845 bool m_continuousPaintingEnabled; |
| 836 bool m_showScrollBottleneckRects; | 846 bool m_showScrollBottleneckRects; |
| 837 }; | 847 }; |
| 838 | 848 |
| 839 } // namespace WebKit | 849 } // namespace WebKit |
| 840 | 850 |
| 841 #endif | 851 #endif |
| OLD | NEW |