| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 virtual void close() override; | 68 virtual void close() override; |
| 69 virtual WebSize size() override; | 69 virtual WebSize size() override; |
| 70 | 70 |
| 71 virtual void resize(const WebSize&) override; | 71 virtual void resize(const WebSize&) override; |
| 72 | 72 |
| 73 virtual void beginFrame(const WebBeginFrameArgs&) override; | 73 virtual void beginFrame(const WebBeginFrameArgs&) override; |
| 74 | 74 |
| 75 virtual void layout() override; | 75 virtual void layout() override; |
| 76 virtual void paint(WebCanvas*, const WebRect&) override; | 76 virtual void paint(WebCanvas*, const WebRect&) override; |
| 77 virtual bool handleInputEvent(const WebInputEvent&) override; | 77 virtual bool handleInputEvent(const WebInputEvent&) override; |
| 78 virtual void setCursorVisibilityState(bool isVisible) override; | |
| 79 virtual void mouseCaptureLost() override; | 78 virtual void mouseCaptureLost() override; |
| 80 virtual void setFocus(bool enable) override; | 79 virtual void setFocus(bool enable) override; |
| 81 virtual bool setComposition( | 80 virtual bool setComposition( |
| 82 const WebString& text, | 81 const WebString& text, |
| 83 const WebVector<WebCompositionUnderline>& underlines, | 82 const WebVector<WebCompositionUnderline>& underlines, |
| 84 int selectionStart, | 83 int selectionStart, |
| 85 int selectionEnd) override; | 84 int selectionEnd) override; |
| 86 virtual bool confirmComposition() override; | 85 virtual bool confirmComposition() override; |
| 87 virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior
) override; | 86 virtual bool confirmComposition(ConfirmCompositionBehavior selectionBehavior
) override; |
| 88 virtual bool confirmComposition(const WebString& text) override; | 87 virtual bool confirmComposition(const WebString& text) override; |
| 89 virtual bool compositionRange(size_t* location, size_t* length) override; | 88 virtual bool compositionRange(size_t* location, size_t* length) override; |
| 90 virtual WebTextInputInfo textInputInfo() override; | 89 virtual WebTextInputInfo textInputInfo() override; |
| 91 virtual WebColor backgroundColor() const override; | 90 virtual WebColor backgroundColor() const override; |
| 92 | 91 |
| 93 virtual void didShowCandidateWindow() override; | 92 virtual void didShowCandidateWindow() override; |
| 94 virtual void didUpdateCandidateWindow() override; | 93 virtual void didUpdateCandidateWindow() override; |
| 95 virtual void didHideCandidateWindow() override; | 94 virtual void didHideCandidateWindow() override; |
| 96 | 95 |
| 97 // WebView methods: | 96 // WebView methods: |
| 98 virtual void setMainFrame(WebFrame*) override; | 97 virtual void setMainFrame(WebFrame*) override; |
| 99 virtual void injectModule(const WebString&) override; | 98 virtual void injectModule(const WebString&) override; |
| 100 virtual void setSpellCheckClient(WebSpellCheckClient*) override; | 99 virtual void setSpellCheckClient(WebSpellCheckClient*) override; |
| 101 virtual WebSettings* settings() override; | 100 virtual WebSettings* settings() override; |
| 102 virtual WebString pageEncoding() const override; | |
| 103 virtual void setPageEncoding(const WebString&) override; | |
| 104 virtual bool isTransparent() const override; | 101 virtual bool isTransparent() const override; |
| 105 virtual void setIsTransparent(bool value) override; | 102 virtual void setIsTransparent(bool value) override; |
| 106 virtual void setBaseBackgroundColor(WebColor) override; | 103 virtual void setBaseBackgroundColor(WebColor) override; |
| 107 virtual bool tabsToLinks() const override; | |
| 108 virtual void setTabsToLinks(bool value) override; | |
| 109 virtual bool isActive() const override; | 104 virtual bool isActive() const override; |
| 110 virtual void setIsActive(bool value) override; | 105 virtual void setIsActive(bool value) override; |
| 111 virtual WebFrame* mainFrame() override; | 106 virtual WebFrame* mainFrame() override; |
| 112 virtual WebFrame* focusedFrame() override; | 107 virtual WebFrame* focusedFrame() override; |
| 113 virtual void setFocusedFrame(WebFrame*) override; | 108 virtual void setFocusedFrame(WebFrame*) override; |
| 114 virtual void setInitialFocus(bool reverse) override; | 109 virtual void setInitialFocus(bool reverse) override; |
| 115 virtual void clearFocusedElement() override; | 110 virtual void clearFocusedElement() override; |
| 116 virtual void advanceFocus(bool reverse) override; | 111 virtual void advanceFocus(bool reverse) override; |
| 117 | 112 |
| 118 virtual float deviceScaleFactor() const override; | 113 virtual float deviceScaleFactor() const override; |
| 119 virtual void setDeviceScaleFactor(float) override; | 114 virtual void setDeviceScaleFactor(float) override; |
| 120 | 115 |
| 121 virtual WebHitTestResult hitTestResultAt(const WebPoint&) override; | 116 virtual WebHitTestResult hitTestResultAt(const WebPoint&) override; |
| 122 virtual void spellingMarkers(WebVector<uint32_t>* markers) override; | 117 virtual void spellingMarkers(WebVector<uint32_t>* markers) override; |
| 123 virtual void removeSpellingMarkersUnderWords(const WebVector<WebString>& wor
ds) override; | 118 virtual void removeSpellingMarkersUnderWords(const WebVector<WebString>& wor
ds) override; |
| 124 virtual void setCompositorDeviceScaleFactorOverride(float) override; | |
| 125 | 119 |
| 126 virtual void setShowPaintRects(bool) override; | 120 virtual void setShowPaintRects(bool) override; |
| 127 void setShowDebugBorders(bool); | 121 void setShowDebugBorders(bool); |
| 128 virtual void setContinuousPaintingEnabled(bool) override; | |
| 129 virtual void setShowScrollBottleneckRects(bool) override; | 122 virtual void setShowScrollBottleneckRects(bool) override; |
| 130 | 123 |
| 131 virtual void acceptLanguagesChanged() override; | 124 virtual void acceptLanguagesChanged() override; |
| 132 | 125 |
| 133 // WebViewImpl | 126 // WebViewImpl |
| 134 HitTestResult coreHitTestResultAt(const WebPoint&); | 127 HitTestResult coreHitTestResultAt(const WebPoint&); |
| 135 | 128 |
| 136 void setIgnoreInputEvents(bool newValue); | |
| 137 void setBackgroundColorOverride(WebColor); | 129 void setBackgroundColorOverride(WebColor); |
| 138 | 130 |
| 139 Color baseBackgroundColor() const { return m_baseBackgroundColor; } | 131 Color baseBackgroundColor() const { return m_baseBackgroundColor; } |
| 140 | 132 |
| 141 LocalFrame* focusedCoreFrame() const; | 133 LocalFrame* focusedCoreFrame() const; |
| 142 | 134 |
| 143 // Returns the currently focused Element or null if no element has focus. | 135 // Returns the currently focused Element or null if no element has focus. |
| 144 Element* focusedElement() const; | 136 Element* focusedElement() const; |
| 145 | 137 |
| 146 static WebViewImpl* fromPage(Page*); | 138 static WebViewImpl* fromPage(Page*); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 166 // the page is shutting down, but will be valid at all other times. | 158 // the page is shutting down, but will be valid at all other times. |
| 167 WebLocalFrameImpl* mainFrameImpl(); | 159 WebLocalFrameImpl* mainFrameImpl(); |
| 168 | 160 |
| 169 // FIXME: Temporary method to accommodate out-of-process frame ancestors; | 161 // FIXME: Temporary method to accommodate out-of-process frame ancestors; |
| 170 // will be removed when there can be multiple WebWidgets for a single page. | 162 // will be removed when there can be multiple WebWidgets for a single page. |
| 171 WebLocalFrameImpl* localFrameRootTemporary() const; | 163 WebLocalFrameImpl* localFrameRootTemporary() const; |
| 172 | 164 |
| 173 // Event related methods: | 165 // Event related methods: |
| 174 void mouseDoubleClick(const WebMouseEvent&); | 166 void mouseDoubleClick(const WebMouseEvent&); |
| 175 | 167 |
| 176 bool detectContentOnTouch(const WebPoint&); | |
| 177 | |
| 178 // Notifies the WebView that a load has been committed. isNewNavigation | 168 // Notifies the WebView that a load has been committed. isNewNavigation |
| 179 // will be true if a new session history item should be created for that | 169 // will be true if a new session history item should be created for that |
| 180 // load. isNavigationWithinPage will be true if the navigation does | 170 // load. isNavigationWithinPage will be true if the navigation does |
| 181 // not take the user away from the current page. | 171 // not take the user away from the current page. |
| 182 void didCommitLoad(bool isNewNavigation, bool isNavigationWithinPage); | 172 void didCommitLoad(bool isNewNavigation, bool isNavigationWithinPage); |
| 183 | 173 |
| 184 // Indicates two things: | 174 // Indicates two things: |
| 185 // 1) This view may have a new layout now. | 175 // 1) This view may have a new layout now. |
| 186 // 2) Calling layout() is a no-op. | 176 // 2) Calling layout() is a no-op. |
| 187 // After calling WebWidget::layout(), expect to get this notification | 177 // After calling WebWidget::layout(), expect to get this notification |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 WebSize m_size; | 269 WebSize m_size; |
| 280 bool m_fixedLayoutSizeLock; | 270 bool m_fixedLayoutSizeLock; |
| 281 | 271 |
| 282 OwnPtr<Page> m_page; | 272 OwnPtr<Page> m_page; |
| 283 | 273 |
| 284 // An object that can be used to manipulate m_page->settings() without linki
ng | 274 // An object that can be used to manipulate m_page->settings() without linki
ng |
| 285 // against WebCore. This is lazily allocated the first time GetWebSettings() | 275 // against WebCore. This is lazily allocated the first time GetWebSettings() |
| 286 // is called. | 276 // is called. |
| 287 OwnPtr<WebSettingsImpl> m_webSettings; | 277 OwnPtr<WebSettingsImpl> m_webSettings; |
| 288 | 278 |
| 289 bool m_ignoreInputEvents; | |
| 290 | |
| 291 float m_compositorDeviceScaleFactorOverride; | |
| 292 WebSize m_rootLayerOffset; | 279 WebSize m_rootLayerOffset; |
| 293 float m_rootLayerScale; | 280 float m_rootLayerScale; |
| 294 | 281 |
| 295 // Webkit expects keyPress events to be suppressed if the associated keyDown | 282 // Webkit expects keyPress events to be suppressed if the associated keyDown |
| 296 // event was handled. Safari implements this behavior by peeking out the | 283 // event was handled. Safari implements this behavior by peeking out the |
| 297 // associated WM_CHAR event if the keydown was handled. We emulate | 284 // associated WM_CHAR event if the keydown was handled. We emulate |
| 298 // this behavior by setting this flag if the keyDown was handled. | 285 // this behavior by setting this flag if the keyDown was handled. |
| 299 bool m_suppressNextKeypressEvent; | 286 bool m_suppressNextKeypressEvent; |
| 300 | 287 |
| 301 // Represents whether or not this object should process incoming IME events. | 288 // Represents whether or not this object should process incoming IME events. |
| 302 bool m_imeAcceptEvents; | 289 bool m_imeAcceptEvents; |
| 303 | 290 |
| 304 // Whether the webview is rendering transparently. | 291 // Whether the webview is rendering transparently. |
| 305 bool m_isTransparent; | 292 bool m_isTransparent; |
| 306 | 293 |
| 307 // Whether the user can press tab to focus links. | |
| 308 bool m_tabsToLinks; | |
| 309 | |
| 310 // If set, the (plugin) node which has mouse capture. | 294 // If set, the (plugin) node which has mouse capture. |
| 311 RefPtr<Node> m_mouseCaptureNode; | 295 RefPtr<Node> m_mouseCaptureNode; |
| 312 RefPtr<UserGestureToken> m_mouseCaptureGestureToken; | 296 RefPtr<UserGestureToken> m_mouseCaptureGestureToken; |
| 313 | 297 |
| 314 IntRect m_rootLayerScrollDamage; | 298 IntRect m_rootLayerScrollDamage; |
| 315 WebLayer* m_rootLayer; | 299 WebLayer* m_rootLayer; |
| 316 bool m_matchesHeuristicsForGpuRasterization; | 300 bool m_matchesHeuristicsForGpuRasterization; |
| 317 // If true, the graphics context is being restored. | 301 // If true, the graphics context is being restored. |
| 318 bool m_recreatingGraphicsContext; | 302 bool m_recreatingGraphicsContext; |
| 319 static const WebInputEvent* m_currentInputEvent; | 303 static const WebInputEvent* m_currentInputEvent; |
| 320 | 304 |
| 321 WebPoint m_positionOnFlingStart; | 305 WebPoint m_positionOnFlingStart; |
| 322 WebPoint m_globalPositionOnFlingStart; | 306 WebPoint m_globalPositionOnFlingStart; |
| 323 int m_flingModifier; | 307 int m_flingModifier; |
| 324 bool m_flingSourceDevice; | 308 bool m_flingSourceDevice; |
| 325 | 309 |
| 326 bool m_showPaintRects; | 310 bool m_showPaintRects; |
| 327 bool m_showDebugBorders; | 311 bool m_showDebugBorders; |
| 328 bool m_continuousPaintingEnabled; | |
| 329 bool m_showScrollBottleneckRects; | 312 bool m_showScrollBottleneckRects; |
| 330 WebColor m_baseBackgroundColor; | 313 WebColor m_baseBackgroundColor; |
| 331 WebColor m_backgroundColorOverride; | 314 WebColor m_backgroundColorOverride; |
| 332 | 315 |
| 333 bool m_userGestureObserved; | 316 bool m_userGestureObserved; |
| 334 }; | 317 }; |
| 335 | 318 |
| 336 // We have no ways to check if the specified WebView is an instance of | 319 // We have no ways to check if the specified WebView is an instance of |
| 337 // WebViewImpl because WebViewImpl is the only implementation of WebView. | 320 // WebViewImpl because WebViewImpl is the only implementation of WebView. |
| 338 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); | 321 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); |
| 339 | 322 |
| 340 } // namespace blink | 323 } // namespace blink |
| 341 | 324 |
| 342 #endif // SKY_ENGINE_WEB_WEBVIEWIMPL_H_ | 325 #endif // SKY_ENGINE_WEB_WEBVIEWIMPL_H_ |
| OLD | NEW |