| 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 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef SKY_ENGINE_WEB_WEBVIEWIMPL_H_ | 31 #ifndef SKY_ENGINE_WEB_WEBVIEWIMPL_H_ |
| 32 #define SKY_ENGINE_WEB_WEBVIEWIMPL_H_ | 32 #define SKY_ENGINE_WEB_WEBVIEWIMPL_H_ |
| 33 | 33 |
| 34 #include "sky/engine/core/html/ime/InputMethodContext.h" | 34 #include "sky/engine/core/html/ime/InputMethodContext.h" |
| 35 #include "sky/engine/platform/geometry/IntPoint.h" | 35 #include "sky/engine/platform/geometry/IntPoint.h" |
| 36 #include "sky/engine/platform/geometry/IntRect.h" | 36 #include "sky/engine/platform/geometry/IntRect.h" |
| 37 #include "sky/engine/platform/graphics/GraphicsLayer.h" | |
| 38 #include "sky/engine/public/platform/WebGestureCurveTarget.h" | 37 #include "sky/engine/public/platform/WebGestureCurveTarget.h" |
| 39 #include "sky/engine/public/platform/WebLayer.h" | 38 #include "sky/engine/public/platform/WebLayer.h" |
| 40 #include "sky/engine/public/platform/WebPoint.h" | 39 #include "sky/engine/public/platform/WebPoint.h" |
| 41 #include "sky/engine/public/platform/WebRect.h" | 40 #include "sky/engine/public/platform/WebRect.h" |
| 42 #include "sky/engine/public/platform/WebSize.h" | 41 #include "sky/engine/public/platform/WebSize.h" |
| 43 #include "sky/engine/public/platform/WebString.h" | 42 #include "sky/engine/public/platform/WebString.h" |
| 44 #include "sky/engine/public/web/WebInputEvent.h" | 43 #include "sky/engine/public/web/WebInputEvent.h" |
| 45 #include "sky/engine/public/web/WebNavigationPolicy.h" | 44 #include "sky/engine/public/web/WebNavigationPolicy.h" |
| 46 #include "sky/engine/public/web/WebView.h" | 45 #include "sky/engine/public/web/WebView.h" |
| 47 #include "sky/engine/web/ChromeClientImpl.h" | 46 #include "sky/engine/web/ChromeClientImpl.h" |
| 48 #include "sky/engine/web/EditorClientImpl.h" | 47 #include "sky/engine/web/EditorClientImpl.h" |
| 49 #include "sky/engine/web/PageWidgetDelegate.h" | 48 #include "sky/engine/web/PageWidgetDelegate.h" |
| 50 #include "sky/engine/web/SpellCheckerClientImpl.h" | 49 #include "sky/engine/web/SpellCheckerClientImpl.h" |
| 51 #include "sky/engine/wtf/OwnPtr.h" | 50 #include "sky/engine/wtf/OwnPtr.h" |
| 52 #include "sky/engine/wtf/RefCounted.h" | 51 #include "sky/engine/wtf/RefCounted.h" |
| 53 #include "sky/engine/wtf/Vector.h" | 52 #include "sky/engine/wtf/Vector.h" |
| 54 | 53 |
| 55 namespace blink { | 54 namespace blink { |
| 56 | 55 |
| 57 class Frame; | 56 class Frame; |
| 58 class LinkHighlight; | |
| 59 class UserGestureToken; | 57 class UserGestureToken; |
| 60 class WebActiveGestureAnimation; | 58 class WebActiveGestureAnimation; |
| 61 class WebLocalFrameImpl; | 59 class WebLocalFrameImpl; |
| 62 class WebImage; | 60 class WebImage; |
| 63 class WebSettingsImpl; | 61 class WebSettingsImpl; |
| 64 | 62 |
| 65 class WebViewImpl final : public WebView | 63 class WebViewImpl final : public WebView |
| 66 , public RefCounted<WebViewImpl> | 64 , public RefCounted<WebViewImpl> |
| 67 , public WebGestureCurveTarget | 65 , public WebGestureCurveTarget |
| 68 , public PageWidgetEventHandler { | 66 , public PageWidgetEventHandler { |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 244 |
| 247 virtual void setVisibilityState(WebPageVisibilityState, bool) override; | 245 virtual void setVisibilityState(WebPageVisibilityState, bool) override; |
| 248 | 246 |
| 249 // Returns true if the event leads to scrolling. | 247 // Returns true if the event leads to scrolling. |
| 250 static bool mapKeyCodeForScroll( | 248 static bool mapKeyCodeForScroll( |
| 251 int keyCode, | 249 int keyCode, |
| 252 ScrollDirection*, | 250 ScrollDirection*, |
| 253 ScrollGranularity*); | 251 ScrollGranularity*); |
| 254 | 252 |
| 255 void computeScaleAndScrollForBlockRect(const WebPoint& hitPoint, const WebRe
ct& blockRect, float padding, float defaultScaleWhenAlreadyLegible, float& scale
, WebPoint& scroll); | 253 void computeScaleAndScrollForBlockRect(const WebPoint& hitPoint, const WebRe
ct& blockRect, float padding, float defaultScaleWhenAlreadyLegible, float& scale
, WebPoint& scroll); |
| 256 Node* bestTapNode(const PlatformGestureEvent& tapEvent); | |
| 257 void enableTapHighlightAtPoint(const PlatformGestureEvent& tapEvent); | |
| 258 void enableTapHighlights(Vector<RawPtr<Node> >&); | |
| 259 void computeScaleAndScrollForFocusedNode(Node* focusedNode, float& scale, In
tPoint& scroll, bool& needAnimation); | 254 void computeScaleAndScrollForFocusedNode(Node* focusedNode, float& scale, In
tPoint& scroll, bool& needAnimation); |
| 260 | 255 |
| 261 // Exposed for the purpose of overriding device metrics. | 256 // Exposed for the purpose of overriding device metrics. |
| 262 void sendResizeEventAndRepaint(); | 257 void sendResizeEventAndRepaint(); |
| 263 | 258 |
| 264 // Exposed for testing purposes. | 259 // Exposed for testing purposes. |
| 265 bool hasHorizontalScrollbar(); | 260 bool hasHorizontalScrollbar(); |
| 266 bool hasVerticalScrollbar(); | 261 bool hasVerticalScrollbar(); |
| 267 | 262 |
| 268 // Heuristic-based function for determining if we should disable workarounds | |
| 269 // for viewing websites that are not optimized for mobile devices. | |
| 270 bool shouldDisableDesktopWorkarounds(); | |
| 271 | |
| 272 // Exposed for tests. | |
| 273 unsigned numLinkHighlights() { return m_linkHighlights.size(); } | |
| 274 LinkHighlight* linkHighlight(int i) { return m_linkHighlights[i].get(); } | |
| 275 | |
| 276 WebSettingsImpl* settingsImpl(); | 263 WebSettingsImpl* settingsImpl(); |
| 277 | 264 |
| 278 // Returns the bounding box of the block type node touched by the WebRect. | 265 // Returns the bounding box of the block type node touched by the WebRect. |
| 279 WebRect computeBlockBounds(const WebRect&, bool ignoreClipping); | 266 WebRect computeBlockBounds(const WebRect&, bool ignoreClipping); |
| 280 | 267 |
| 281 IntPoint clampOffsetAtScale(const IntPoint& offset, float scale); | 268 IntPoint clampOffsetAtScale(const IntPoint& offset, float scale); |
| 282 | 269 |
| 283 // Exposed for tests. | 270 // Exposed for tests. |
| 284 WebVector<WebCompositionUnderline> compositionUnderlines() const; | 271 WebVector<WebCompositionUnderline> compositionUnderlines() const; |
| 285 | 272 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 bool m_matchesHeuristicsForGpuRasterization; | 387 bool m_matchesHeuristicsForGpuRasterization; |
| 401 // If true, the graphics context is being restored. | 388 // If true, the graphics context is being restored. |
| 402 bool m_recreatingGraphicsContext; | 389 bool m_recreatingGraphicsContext; |
| 403 static const WebInputEvent* m_currentInputEvent; | 390 static const WebInputEvent* m_currentInputEvent; |
| 404 | 391 |
| 405 OwnPtr<WebActiveGestureAnimation> m_gestureAnimation; | 392 OwnPtr<WebActiveGestureAnimation> m_gestureAnimation; |
| 406 WebPoint m_positionOnFlingStart; | 393 WebPoint m_positionOnFlingStart; |
| 407 WebPoint m_globalPositionOnFlingStart; | 394 WebPoint m_globalPositionOnFlingStart; |
| 408 int m_flingModifier; | 395 int m_flingModifier; |
| 409 bool m_flingSourceDevice; | 396 bool m_flingSourceDevice; |
| 410 Vector<OwnPtr<LinkHighlight> > m_linkHighlights; | |
| 411 | 397 |
| 412 bool m_showFPSCounter; | 398 bool m_showFPSCounter; |
| 413 bool m_showPaintRects; | 399 bool m_showPaintRects; |
| 414 bool m_showDebugBorders; | 400 bool m_showDebugBorders; |
| 415 bool m_continuousPaintingEnabled; | 401 bool m_continuousPaintingEnabled; |
| 416 bool m_showScrollBottleneckRects; | 402 bool m_showScrollBottleneckRects; |
| 417 WebColor m_baseBackgroundColor; | 403 WebColor m_baseBackgroundColor; |
| 418 WebColor m_backgroundColorOverride; | 404 WebColor m_backgroundColorOverride; |
| 419 | 405 |
| 420 bool m_userGestureObserved; | 406 bool m_userGestureObserved; |
| 421 }; | 407 }; |
| 422 | 408 |
| 423 // We have no ways to check if the specified WebView is an instance of | 409 // We have no ways to check if the specified WebView is an instance of |
| 424 // WebViewImpl because WebViewImpl is the only implementation of WebView. | 410 // WebViewImpl because WebViewImpl is the only implementation of WebView. |
| 425 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); | 411 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); |
| 426 | 412 |
| 427 } // namespace blink | 413 } // namespace blink |
| 428 | 414 |
| 429 #endif // SKY_ENGINE_WEB_WEBVIEWIMPL_H_ | 415 #endif // SKY_ENGINE_WEB_WEBVIEWIMPL_H_ |
| OLD | NEW |