| 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/public/platform/WebGestureCurveTarget.h" | |
| 38 #include "sky/engine/public/platform/WebInputEvent.h" | 37 #include "sky/engine/public/platform/WebInputEvent.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/WebNavigationPolicy.h" | 43 #include "sky/engine/public/web/WebNavigationPolicy.h" |
| 45 #include "sky/engine/public/web/WebView.h" | 44 #include "sky/engine/public/web/WebView.h" |
| 46 #include "sky/engine/web/ChromeClientImpl.h" | 45 #include "sky/engine/web/ChromeClientImpl.h" |
| 47 #include "sky/engine/web/EditorClientImpl.h" | 46 #include "sky/engine/web/EditorClientImpl.h" |
| 48 #include "sky/engine/web/PageWidgetDelegate.h" | 47 #include "sky/engine/web/PageWidgetDelegate.h" |
| 49 #include "sky/engine/web/SpellCheckerClientImpl.h" | 48 #include "sky/engine/web/SpellCheckerClientImpl.h" |
| 50 #include "sky/engine/wtf/OwnPtr.h" | 49 #include "sky/engine/wtf/OwnPtr.h" |
| 51 #include "sky/engine/wtf/RefCounted.h" | 50 #include "sky/engine/wtf/RefCounted.h" |
| 52 #include "sky/engine/wtf/Vector.h" | 51 #include "sky/engine/wtf/Vector.h" |
| 53 | 52 |
| 54 namespace blink { | 53 namespace blink { |
| 55 | 54 |
| 56 class Frame; | 55 class Frame; |
| 57 class UserGestureToken; | 56 class UserGestureToken; |
| 58 class WebActiveGestureAnimation; | |
| 59 class WebLocalFrameImpl; | 57 class WebLocalFrameImpl; |
| 60 class WebImage; | 58 class WebImage; |
| 61 class WebSettingsImpl; | 59 class WebSettingsImpl; |
| 62 | 60 |
| 63 class WebViewImpl final : public WebView | 61 class WebViewImpl final : public WebView |
| 64 , public RefCounted<WebViewImpl> | 62 , public RefCounted<WebViewImpl> |
| 65 , public WebGestureCurveTarget | |
| 66 , public PageWidgetEventHandler { | 63 , public PageWidgetEventHandler { |
| 67 public: | 64 public: |
| 68 static WebViewImpl* create(WebViewClient*); | 65 static WebViewImpl* create(WebViewClient*); |
| 69 | 66 |
| 70 // WebWidget methods: | 67 // WebWidget methods: |
| 71 virtual void close() override; | 68 virtual void close() override; |
| 72 virtual WebSize size() override; | 69 virtual WebSize size() override; |
| 73 | 70 |
| 74 virtual void resize(const WebSize&) override; | 71 virtual void resize(const WebSize&) override; |
| 75 | 72 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 102 virtual void injectModule(const WebString&) override; | 99 virtual void injectModule(const WebString&) override; |
| 103 virtual void setSpellCheckClient(WebSpellCheckClient*) override; | 100 virtual void setSpellCheckClient(WebSpellCheckClient*) override; |
| 104 virtual WebSettings* settings() override; | 101 virtual WebSettings* settings() override; |
| 105 virtual WebString pageEncoding() const override; | 102 virtual WebString pageEncoding() const override; |
| 106 virtual void setPageEncoding(const WebString&) override; | 103 virtual void setPageEncoding(const WebString&) override; |
| 107 virtual bool isTransparent() const override; | 104 virtual bool isTransparent() const override; |
| 108 virtual void setIsTransparent(bool value) override; | 105 virtual void setIsTransparent(bool value) override; |
| 109 virtual void setBaseBackgroundColor(WebColor) override; | 106 virtual void setBaseBackgroundColor(WebColor) override; |
| 110 virtual bool tabsToLinks() const override; | 107 virtual bool tabsToLinks() const override; |
| 111 virtual void setTabsToLinks(bool value) override; | 108 virtual void setTabsToLinks(bool value) override; |
| 112 virtual bool tabKeyCyclesThroughElements() const override; | |
| 113 virtual void setTabKeyCyclesThroughElements(bool value) override; | |
| 114 virtual bool isActive() const override; | 109 virtual bool isActive() const override; |
| 115 virtual void setIsActive(bool value) override; | 110 virtual void setIsActive(bool value) override; |
| 116 virtual WebFrame* mainFrame() override; | 111 virtual WebFrame* mainFrame() override; |
| 117 virtual WebFrame* focusedFrame() override; | 112 virtual WebFrame* focusedFrame() override; |
| 118 virtual void setFocusedFrame(WebFrame*) override; | 113 virtual void setFocusedFrame(WebFrame*) override; |
| 119 virtual void setInitialFocus(bool reverse) override; | 114 virtual void setInitialFocus(bool reverse) override; |
| 120 virtual void clearFocusedElement() override; | 115 virtual void clearFocusedElement() override; |
| 121 virtual void advanceFocus(bool reverse) override; | 116 virtual void advanceFocus(bool reverse) override; |
| 122 | 117 |
| 123 virtual float deviceScaleFactor() const override; | 118 virtual float deviceScaleFactor() const override; |
| 124 virtual void setDeviceScaleFactor(float) override; | 119 virtual void setDeviceScaleFactor(float) override; |
| 125 | 120 |
| 126 virtual WebHitTestResult hitTestResultAt(const WebPoint&) override; | 121 virtual WebHitTestResult hitTestResultAt(const WebPoint&) override; |
| 127 virtual void spellingMarkers(WebVector<uint32_t>* markers) override; | 122 virtual void spellingMarkers(WebVector<uint32_t>* markers) override; |
| 128 virtual void removeSpellingMarkersUnderWords(const WebVector<WebString>& wor
ds) override; | 123 virtual void removeSpellingMarkersUnderWords(const WebVector<WebString>& wor
ds) override; |
| 129 virtual void setCompositorDeviceScaleFactorOverride(float) override; | 124 virtual void setCompositorDeviceScaleFactorOverride(float) override; |
| 130 | 125 |
| 131 virtual void transferActiveWheelFlingAnimation(const WebActiveWheelFlingPara
meters&) override; | |
| 132 virtual bool endActiveFlingAnimation() override; | |
| 133 virtual void setShowPaintRects(bool) override; | 126 virtual void setShowPaintRects(bool) override; |
| 134 void setShowDebugBorders(bool); | 127 void setShowDebugBorders(bool); |
| 135 virtual void setShowFPSCounter(bool) override; | |
| 136 virtual void setContinuousPaintingEnabled(bool) override; | 128 virtual void setContinuousPaintingEnabled(bool) override; |
| 137 virtual void setShowScrollBottleneckRects(bool) override; | 129 virtual void setShowScrollBottleneckRects(bool) override; |
| 138 | 130 |
| 139 virtual void acceptLanguagesChanged() override; | 131 virtual void acceptLanguagesChanged() override; |
| 140 | 132 |
| 141 // WebViewImpl | 133 // WebViewImpl |
| 142 HitTestResult coreHitTestResultAt(const WebPoint&); | 134 HitTestResult coreHitTestResultAt(const WebPoint&); |
| 143 | 135 |
| 144 void setIgnoreInputEvents(bool newValue); | 136 void setIgnoreInputEvents(bool newValue); |
| 145 void setBackgroundColorOverride(WebColor); | 137 void setBackgroundColorOverride(WebColor); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 176 | 168 |
| 177 // FIXME: Temporary method to accommodate out-of-process frame ancestors; | 169 // FIXME: Temporary method to accommodate out-of-process frame ancestors; |
| 178 // will be removed when there can be multiple WebWidgets for a single page. | 170 // will be removed when there can be multiple WebWidgets for a single page. |
| 179 WebLocalFrameImpl* localFrameRootTemporary() const; | 171 WebLocalFrameImpl* localFrameRootTemporary() const; |
| 180 | 172 |
| 181 // Event related methods: | 173 // Event related methods: |
| 182 void mouseDoubleClick(const WebMouseEvent&); | 174 void mouseDoubleClick(const WebMouseEvent&); |
| 183 | 175 |
| 184 bool detectContentOnTouch(const WebPoint&); | 176 bool detectContentOnTouch(const WebPoint&); |
| 185 | 177 |
| 186 // WebGestureCurveTarget implementation for fling. | |
| 187 virtual bool scrollBy(const WebFloatSize& delta, const WebFloatSize& velocit
y) override; | |
| 188 | |
| 189 // Notifies the WebView that a load has been committed. isNewNavigation | 178 // Notifies the WebView that a load has been committed. isNewNavigation |
| 190 // will be true if a new session history item should be created for that | 179 // will be true if a new session history item should be created for that |
| 191 // load. isNavigationWithinPage will be true if the navigation does | 180 // load. isNavigationWithinPage will be true if the navigation does |
| 192 // not take the user away from the current page. | 181 // not take the user away from the current page. |
| 193 void didCommitLoad(bool isNewNavigation, bool isNavigationWithinPage); | 182 void didCommitLoad(bool isNewNavigation, bool isNavigationWithinPage); |
| 194 | 183 |
| 195 // Indicates two things: | 184 // Indicates two things: |
| 196 // 1) This view may have a new layout now. | 185 // 1) This view may have a new layout now. |
| 197 // 2) Calling layout() is a no-op. | 186 // 2) Calling layout() is a no-op. |
| 198 // After calling WebWidget::layout(), expect to get this notification | 187 // After calling WebWidget::layout(), expect to get this notification |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 RefPtr<Node> m_mouseCaptureNode; | 311 RefPtr<Node> m_mouseCaptureNode; |
| 323 RefPtr<UserGestureToken> m_mouseCaptureGestureToken; | 312 RefPtr<UserGestureToken> m_mouseCaptureGestureToken; |
| 324 | 313 |
| 325 IntRect m_rootLayerScrollDamage; | 314 IntRect m_rootLayerScrollDamage; |
| 326 WebLayer* m_rootLayer; | 315 WebLayer* m_rootLayer; |
| 327 bool m_matchesHeuristicsForGpuRasterization; | 316 bool m_matchesHeuristicsForGpuRasterization; |
| 328 // If true, the graphics context is being restored. | 317 // If true, the graphics context is being restored. |
| 329 bool m_recreatingGraphicsContext; | 318 bool m_recreatingGraphicsContext; |
| 330 static const WebInputEvent* m_currentInputEvent; | 319 static const WebInputEvent* m_currentInputEvent; |
| 331 | 320 |
| 332 OwnPtr<WebActiveGestureAnimation> m_gestureAnimation; | |
| 333 WebPoint m_positionOnFlingStart; | 321 WebPoint m_positionOnFlingStart; |
| 334 WebPoint m_globalPositionOnFlingStart; | 322 WebPoint m_globalPositionOnFlingStart; |
| 335 int m_flingModifier; | 323 int m_flingModifier; |
| 336 bool m_flingSourceDevice; | 324 bool m_flingSourceDevice; |
| 337 | 325 |
| 338 bool m_showFPSCounter; | |
| 339 bool m_showPaintRects; | 326 bool m_showPaintRects; |
| 340 bool m_showDebugBorders; | 327 bool m_showDebugBorders; |
| 341 bool m_continuousPaintingEnabled; | 328 bool m_continuousPaintingEnabled; |
| 342 bool m_showScrollBottleneckRects; | 329 bool m_showScrollBottleneckRects; |
| 343 WebColor m_baseBackgroundColor; | 330 WebColor m_baseBackgroundColor; |
| 344 WebColor m_backgroundColorOverride; | 331 WebColor m_backgroundColorOverride; |
| 345 | 332 |
| 346 bool m_userGestureObserved; | 333 bool m_userGestureObserved; |
| 347 }; | 334 }; |
| 348 | 335 |
| 349 // We have no ways to check if the specified WebView is an instance of | 336 // We have no ways to check if the specified WebView is an instance of |
| 350 // WebViewImpl because WebViewImpl is the only implementation of WebView. | 337 // WebViewImpl because WebViewImpl is the only implementation of WebView. |
| 351 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); | 338 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); |
| 352 | 339 |
| 353 } // namespace blink | 340 } // namespace blink |
| 354 | 341 |
| 355 #endif // SKY_ENGINE_WEB_WEBVIEWIMPL_H_ | 342 #endif // SKY_ENGINE_WEB_WEBVIEWIMPL_H_ |
| OLD | NEW |