diff options
Diffstat (limited to 'Source/web/WebViewImpl.h')
-rw-r--r-- | Source/web/WebViewImpl.h | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/Source/web/WebViewImpl.h b/Source/web/WebViewImpl.h index 9fccd8ea6..03795c80c 100644 --- a/Source/web/WebViewImpl.h +++ b/Source/web/WebViewImpl.h @@ -120,6 +120,7 @@ class WebPrerendererClient; class WebSettingsImpl; class WebTouchEvent; class WebViewBenchmarkSupport; +class FullscreenController; class WebViewImpl : public WebView , public RefCounted<WebViewImpl> @@ -127,10 +128,6 @@ class WebViewImpl : public WebView , public WebCore::PagePopupDriver , public PageWidgetEventHandler { public: - enum AutoZoomType { - DoubleTap, - FindInPage, - }; // WebWidget methods: virtual void close(); @@ -225,6 +222,7 @@ public: virtual void zoomLimitsChanged(double minimumZoomLevel, double maximumZoomLevel); virtual void setInitialPageScaleOverride(float); + virtual bool zoomToMultipleTargetsRect(const WebRect&); virtual float pageScaleFactor() const; virtual void setPageScaleFactorPreservingScrollOffset(float); virtual void setPageScaleFactor(float scaleFactor, const WebPoint& origin); @@ -528,17 +526,18 @@ public: // a plugin can update its own zoom, say because of its own UI. void fullFramePluginZoomLevelChanged(double zoomLevel); - void computeScaleAndScrollForHitRect(const WebRect& hitRect, AutoZoomType, float& scale, WebPoint& scroll, bool& isAnchor); + void computeScaleAndScrollForBlockRect(const WebRect& blockRect, float padding, float& scale, WebPoint& scroll, bool& doubleTapShouldZoomOut); WebCore::Node* bestTapNode(const WebCore::PlatformGestureEvent& tapEvent); void enableTapHighlight(const WebCore::PlatformGestureEvent& tapEvent); void computeScaleAndScrollForFocusedNode(WebCore::Node* focusedNode, float& scale, WebCore::IntPoint& scroll, bool& needAnimation); - void animateZoomAroundPoint(const WebCore::IntPoint&, AutoZoomType); - void enableFakeDoubleTapAnimationForTesting(bool); + void animateDoubleTapZoom(const WebCore::IntPoint&); + + void enableFakePageScaleAnimationForTesting(bool); bool fakeDoubleTapAnimationPendingForTesting() const { return m_doubleTapZoomPending; } - WebCore::IntPoint fakeDoubleTapTargetPositionForTesting() const { return m_fakeDoubleTapTargetPosition; } - float fakeDoubleTapPageScaleFactorForTesting() const { return m_fakeDoubleTapPageScaleFactor; } - bool fakeDoubleTapUseAnchorForTesting() const { return m_fakeDoubleTapUseAnchor; } + WebCore::IntPoint fakePageScaleAnimationTargetPositionForTesting() const { return m_fakePageScaleAnimationTargetPosition; } + float fakePageScaleAnimationPageScaleForTesting() const { return m_fakePageScaleAnimationPageScaleFactor; } + bool fakePageScaleAnimationUseAnchorForTesting() const { return m_fakePageScaleAnimationUseAnchor; } void enterFullScreenForElement(WebCore::Element*); void exitFullScreenForElement(WebCore::Element*); @@ -565,11 +564,15 @@ public: WebSettingsImpl* settingsImpl(); + // Returns the bounding box of the block type node touched by the WebRect. + WebRect computeBlockBounds(const WebRect&, bool ignoreClipping); + + WebCore::IntPoint clampOffsetAtScale(const WebCore::IntPoint& offset, float scale); + private: void refreshPageScaleFactorAfterLayout(); void setUserAgentPageScaleConstraints(WebCore::PageScaleConstraints newConstraints); float clampPageScaleFactorToLimits(float) const; - WebCore::IntPoint clampOffsetAtScale(const WebCore::IntPoint& offset, float scale); WebCore::IntSize contentsSize() const; void resetSavedScrollAndScaleState(); @@ -630,9 +633,6 @@ private: void reallocateRenderer(); void updateLayerTreeViewport(); - // Returns the bounding box of the block type node touched by the WebRect. - WebRect computeBlockBounds(const WebRect&, AutoZoomType); - // Helper function: Widens the width of |source| by the specified margins // while keeping it smaller than page width. WebRect widenRectWithinPageBounds(const WebRect& source, int targetMargin, int minimumMargin); @@ -709,8 +709,6 @@ private: // Saved page scale state. float m_savedPageScaleFactor; // 0 means that no page scale factor is saved. WebCore::IntSize m_savedScrollOffset; - float m_exitFullscreenPageScaleFactor; - WebCore::IntSize m_exitFullscreenScrollOffset; // The scale moved to by the latest double tap zoom, if any. float m_doubleTapZoomPageScaleFactor; @@ -718,10 +716,10 @@ private: bool m_doubleTapZoomPending; // Used for testing purposes. - bool m_enableFakeDoubleTapAnimationForTesting; - WebCore::IntPoint m_fakeDoubleTapTargetPosition; - float m_fakeDoubleTapPageScaleFactor; - bool m_fakeDoubleTapUseAnchor; + bool m_enableFakePageScaleAnimationForTesting; + WebCore::IntPoint m_fakePageScaleAnimationTargetPosition; + float m_fakePageScaleAnimationPageScaleFactor; + bool m_fakePageScaleAnimationUseAnchor; bool m_contextMenuAllowed; @@ -787,13 +785,6 @@ private: // If set, the (plugin) node which has mouse capture. RefPtr<WebCore::Node> m_mouseCaptureNode; - // If set, the WebView is transitioning to fullscreen for this element. - RefPtr<WebCore::Element> m_provisionalFullScreenElement; - - // If set, the WebView is in fullscreen mode for an element in this frame. - RefPtr<WebCore::Frame> m_fullScreenFrame; - bool m_isCancelingFullScreen; - WebViewBenchmarkSupportImpl m_benchmarkSupport; WebCore::IntRect m_rootLayerScrollDamage; @@ -831,6 +822,7 @@ private: bool m_flingSourceDevice; OwnPtr<LinkHighlight> m_linkHighlight; OwnPtr<ValidationMessageClientImpl> m_validationMessage; + OwnPtr<FullscreenController> m_fullscreenController; bool m_showFPSCounter; bool m_showPaintRects; |