| 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 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 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 WebViewImpl_h | 31 #ifndef WebViewImpl_h |
| 32 #define WebViewImpl_h | 32 #define WebViewImpl_h |
| 33 | 33 |
| 34 #include <memory> | 34 #include <memory> |
| 35 #include "core/exported/WebViewBase.h" |
| 35 #include "core/frame/ResizeViewportAnchor.h" | 36 #include "core/frame/ResizeViewportAnchor.h" |
| 36 #include "core/page/ContextMenuProvider.h" | 37 #include "core/page/ContextMenuProvider.h" |
| 37 #include "core/page/EventWithHitTestResults.h" | 38 #include "core/page/EventWithHitTestResults.h" |
| 38 #include "platform/animation/CompositorAnimationTimeline.h" | 39 #include "platform/animation/CompositorAnimationTimeline.h" |
| 39 #include "platform/geometry/IntPoint.h" | 40 #include "platform/geometry/IntPoint.h" |
| 40 #include "platform/geometry/IntRect.h" | 41 #include "platform/geometry/IntRect.h" |
| 41 #include "platform/graphics/GraphicsLayer.h" | 42 #include "platform/graphics/GraphicsLayer.h" |
| 42 #include "platform/heap/Handle.h" | 43 #include "platform/heap/Handle.h" |
| 43 #include "platform/scheduler/child/web_scheduler.h" | 44 #include "platform/scheduler/child/web_scheduler.h" |
| 44 #include "platform/wtf/Compiler.h" | 45 #include "platform/wtf/Compiler.h" |
| 45 #include "platform/wtf/HashSet.h" | 46 #include "platform/wtf/HashSet.h" |
| 46 #include "platform/wtf/RefCounted.h" | 47 #include "platform/wtf/RefCounted.h" |
| 47 #include "platform/wtf/Vector.h" | 48 #include "platform/wtf/Vector.h" |
| 48 #include "public/platform/WebDisplayMode.h" | 49 #include "public/platform/WebDisplayMode.h" |
| 49 #include "public/platform/WebFloatSize.h" | 50 #include "public/platform/WebFloatSize.h" |
| 50 #include "public/platform/WebGestureCurveTarget.h" | 51 #include "public/platform/WebGestureCurveTarget.h" |
| 51 #include "public/platform/WebGestureEvent.h" | 52 #include "public/platform/WebGestureEvent.h" |
| 52 #include "public/platform/WebInputEvent.h" | 53 #include "public/platform/WebInputEvent.h" |
| 53 #include "public/platform/WebInputEventResult.h" | 54 #include "public/platform/WebInputEventResult.h" |
| 54 #include "public/platform/WebLayer.h" | 55 #include "public/platform/WebLayer.h" |
| 55 #include "public/platform/WebPoint.h" | 56 #include "public/platform/WebPoint.h" |
| 56 #include "public/platform/WebRect.h" | 57 #include "public/platform/WebRect.h" |
| 57 #include "public/platform/WebSize.h" | 58 #include "public/platform/WebSize.h" |
| 58 #include "public/platform/WebString.h" | 59 #include "public/platform/WebString.h" |
| 59 #include "public/platform/WebVector.h" | 60 #include "public/platform/WebVector.h" |
| 60 #include "public/web/WebNavigationPolicy.h" | 61 #include "public/web/WebNavigationPolicy.h" |
| 61 #include "public/web/WebPageImportanceSignals.h" | 62 #include "public/web/WebPageImportanceSignals.h" |
| 62 #include "public/web/WebView.h" | |
| 63 #include "web/ChromeClientImpl.h" | 63 #include "web/ChromeClientImpl.h" |
| 64 #include "web/ContextMenuClientImpl.h" | 64 #include "web/ContextMenuClientImpl.h" |
| 65 #include "web/EditorClientImpl.h" | 65 #include "web/EditorClientImpl.h" |
| 66 #include "web/MediaKeysClientImpl.h" | 66 #include "web/MediaKeysClientImpl.h" |
| 67 #include "web/PageWidgetDelegate.h" | 67 #include "web/PageWidgetDelegate.h" |
| 68 #include "web/SpellCheckerClientImpl.h" | 68 #include "web/SpellCheckerClientImpl.h" |
| 69 #include "web/StorageClientImpl.h" | 69 #include "web/StorageClientImpl.h" |
| 70 #include "web/WebExport.h" | 70 #include "web/WebExport.h" |
| 71 #include "web/WebPagePopupImpl.h" | 71 #include "web/WebPagePopupImpl.h" |
| 72 | 72 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 90 class WebLayerTreeView; | 90 class WebLayerTreeView; |
| 91 class WebLocalFrame; | 91 class WebLocalFrame; |
| 92 class WebLocalFrameImpl; | 92 class WebLocalFrameImpl; |
| 93 class CompositorMutatorImpl; | 93 class CompositorMutatorImpl; |
| 94 class WebPlugin; | 94 class WebPlugin; |
| 95 class WebRemoteFrame; | 95 class WebRemoteFrame; |
| 96 class WebSettingsImpl; | 96 class WebSettingsImpl; |
| 97 class WebViewScheduler; | 97 class WebViewScheduler; |
| 98 | 98 |
| 99 class WEB_EXPORT WebViewImpl final | 99 class WEB_EXPORT WebViewImpl final |
| 100 : NON_EXPORTED_BASE(public WebView), | 100 : NON_EXPORTED_BASE(public WebViewBase), |
| 101 public RefCounted<WebViewImpl>, | 101 public RefCounted<WebViewImpl>, |
| 102 NON_EXPORTED_BASE(public WebGestureCurveTarget), | 102 NON_EXPORTED_BASE(public WebGestureCurveTarget), |
| 103 public PageWidgetEventHandler, | 103 public PageWidgetEventHandler, |
| 104 public WebScheduler::InterventionReporter, | 104 public WebScheduler::InterventionReporter, |
| 105 public WebViewScheduler::WebViewSchedulerSettings { | 105 public WebViewScheduler::WebViewSchedulerSettings { |
| 106 public: | 106 public: |
| 107 static WebViewImpl* Create(WebViewClient*, WebPageVisibilityState); | 107 static WebViewImpl* Create(WebViewClient*, WebPageVisibilityState); |
| 108 static HashSet<WebViewImpl*>& AllInstances(); | 108 static HashSet<WebViewImpl*>& AllInstances(); |
| 109 | 109 |
| 110 // WebWidget methods: | 110 // WebWidget methods: |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 WebFrame* MainFrame() override; | 178 WebFrame* MainFrame() override; |
| 179 WebFrame* FindFrameByName(const WebString& name, | 179 WebFrame* FindFrameByName(const WebString& name, |
| 180 WebFrame* relative_to_frame) override; | 180 WebFrame* relative_to_frame) override; |
| 181 WebLocalFrame* FocusedFrame() override; | 181 WebLocalFrame* FocusedFrame() override; |
| 182 void SetFocusedFrame(WebFrame*) override; | 182 void SetFocusedFrame(WebFrame*) override; |
| 183 void FocusDocumentView(WebFrame*) override; | 183 void FocusDocumentView(WebFrame*) override; |
| 184 void SetInitialFocus(bool reverse) override; | 184 void SetInitialFocus(bool reverse) override; |
| 185 void ClearFocusedElement() override; | 185 void ClearFocusedElement() override; |
| 186 bool ScrollFocusedEditableElementIntoRect(const WebRect&) override; | 186 bool ScrollFocusedEditableElementIntoRect(const WebRect&) override; |
| 187 void SmoothScroll(int target_x, int target_y, long duration_ms) override; | 187 void SmoothScroll(int target_x, int target_y, long duration_ms) override; |
| 188 void ZoomToFindInPageRect(const WebRect&); | 188 void ZoomToFindInPageRect(const WebRect&) override; |
| 189 void AdvanceFocus(bool reverse) override; | 189 void AdvanceFocus(bool reverse) override; |
| 190 void AdvanceFocusAcrossFrames(WebFocusType, | 190 void AdvanceFocusAcrossFrames(WebFocusType, |
| 191 WebRemoteFrame* from, | 191 WebRemoteFrame* from, |
| 192 WebLocalFrame* to) override; | 192 WebLocalFrame* to) override; |
| 193 double ZoomLevel() override; | 193 double ZoomLevel() override; |
| 194 double SetZoomLevel(double) override; | 194 double SetZoomLevel(double) override; |
| 195 void ZoomLimitsChanged(double minimum_zoom_level, | 195 void ZoomLimitsChanged(double minimum_zoom_level, |
| 196 double maximum_zoom_level) override; | 196 double maximum_zoom_level) override; |
| 197 float TextZoomFactor() override; | 197 float TextZoomFactor() override; |
| 198 float SetTextZoomFactor(float) override; | 198 float SetTextZoomFactor(float) override; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 void ShowContextMenu() override; | 237 void ShowContextMenu() override; |
| 238 void DidCloseContextMenu() override; | 238 void DidCloseContextMenu() override; |
| 239 void HidePopups() override; | 239 void HidePopups() override; |
| 240 void SetPageOverlayColor(WebColor) override; | 240 void SetPageOverlayColor(WebColor) override; |
| 241 WebPageImportanceSignals* PageImportanceSignals() override; | 241 WebPageImportanceSignals* PageImportanceSignals() override; |
| 242 void TransferActiveWheelFlingAnimation( | 242 void TransferActiveWheelFlingAnimation( |
| 243 const WebActiveWheelFlingParameters&) override; | 243 const WebActiveWheelFlingParameters&) override; |
| 244 bool EndActiveFlingAnimation() override; | 244 bool EndActiveFlingAnimation() override; |
| 245 bool IsFlinging() const override { return !!gesture_animation_.get(); } | 245 bool IsFlinging() const override { return !!gesture_animation_.get(); } |
| 246 void SetShowPaintRects(bool) override; | 246 void SetShowPaintRects(bool) override; |
| 247 void SetShowDebugBorders(bool); | 247 void SetShowDebugBorders(bool) override; |
| 248 void SetShowFPSCounter(bool) override; | 248 void SetShowFPSCounter(bool) override; |
| 249 void SetShowScrollBottleneckRects(bool) override; | 249 void SetShowScrollBottleneckRects(bool) override; |
| 250 void AcceptLanguagesChanged() override; | 250 void AcceptLanguagesChanged() override; |
| 251 | 251 |
| 252 // WebScheduler::InterventionReporter implementation: | 252 // WebScheduler::InterventionReporter implementation: |
| 253 void ReportIntervention(const WebString& message) override; | 253 void ReportIntervention(const WebString& message) override; |
| 254 | 254 |
| 255 // WebViewScheduler::WebViewSchedulerSettings implementation: | 255 // WebViewScheduler::WebViewSchedulerSettings implementation: |
| 256 float ExpensiveBackgroundThrottlingCPUBudget() override; | 256 float ExpensiveBackgroundThrottlingCPUBudget() override; |
| 257 float ExpensiveBackgroundThrottlingInitialBudget() override; | 257 float ExpensiveBackgroundThrottlingInitialBudget() override; |
| 258 float ExpensiveBackgroundThrottlingMaxBudget() override; | 258 float ExpensiveBackgroundThrottlingMaxBudget() override; |
| 259 float ExpensiveBackgroundThrottlingMaxDelay() override; | 259 float ExpensiveBackgroundThrottlingMaxDelay() override; |
| 260 | 260 |
| 261 void DidUpdateFullscreenSize(); | 261 void DidUpdateFullscreenSize() override; |
| 262 | 262 |
| 263 float DefaultMinimumPageScaleFactor() const; | 263 float DefaultMinimumPageScaleFactor() const override; |
| 264 float DefaultMaximumPageScaleFactor() const; | 264 float DefaultMaximumPageScaleFactor() const override; |
| 265 float MinimumPageScaleFactor() const; | 265 float MinimumPageScaleFactor() const override; |
| 266 float MaximumPageScaleFactor() const; | 266 float MaximumPageScaleFactor() const override; |
| 267 float ClampPageScaleFactorToLimits(float) const; | 267 float ClampPageScaleFactorToLimits(float) const override; |
| 268 void ResetScaleStateImmediately(); | 268 void ResetScaleStateImmediately() override; |
| 269 | 269 |
| 270 HitTestResult CoreHitTestResultAt(const WebPoint&); | 270 HitTestResult CoreHitTestResultAt(const WebPoint&); |
| 271 void InvalidateRect(const IntRect&); | 271 void InvalidateRect(const IntRect&); |
| 272 | 272 |
| 273 void SetBaseBackgroundColor(WebColor); | 273 void SetBaseBackgroundColor(WebColor) override; |
| 274 void SetBaseBackgroundColorOverride(WebColor); | 274 void SetBaseBackgroundColorOverride(WebColor) override; |
| 275 void ClearBaseBackgroundColorOverride(); | 275 void ClearBaseBackgroundColorOverride() override; |
| 276 void SetBackgroundColorOverride(WebColor); | 276 void SetBackgroundColorOverride(WebColor) override; |
| 277 void ClearBackgroundColorOverride(); | 277 void ClearBackgroundColorOverride() override; |
| 278 void SetZoomFactorOverride(float); | 278 void SetZoomFactorOverride(float) override; |
| 279 void SetCompositorDeviceScaleFactorOverride(float); | 279 void SetCompositorDeviceScaleFactorOverride(float) override; |
| 280 void SetDeviceEmulationTransform(const TransformationMatrix&); | 280 void SetDeviceEmulationTransform(const TransformationMatrix&) override; |
| 281 TransformationMatrix GetDeviceEmulationTransformForTesting() const; | 281 TransformationMatrix GetDeviceEmulationTransformForTesting() const; |
| 282 | 282 |
| 283 Color BaseBackgroundColor() const; | 283 Color BaseBackgroundColor() const override; |
| 284 bool BackgroundColorOverrideEnabled() const { | 284 bool BackgroundColorOverrideEnabled() const override { |
| 285 return background_color_override_enabled_; | 285 return background_color_override_enabled_; |
| 286 } | 286 } |
| 287 WebColor BackgroundColorOverride() const { | 287 WebColor BackgroundColorOverride() const override { |
| 288 return background_color_override_; | 288 return background_color_override_; |
| 289 } | 289 } |
| 290 | 290 |
| 291 Frame* FocusedCoreFrame() const; | 291 Frame* FocusedCoreFrame() const override; |
| 292 | 292 |
| 293 // Returns the currently focused Element or null if no element has focus. | 293 // Returns the currently focused Element or null if no element has focus. |
| 294 Element* FocusedElement() const; | 294 Element* FocusedElement() const; |
| 295 | 295 |
| 296 static WebViewImpl* FromPage(Page*); | 296 static WebViewImpl* FromPage(Page*); |
| 297 | 297 |
| 298 WebViewClient* Client() { return client_; } | 298 WebViewClient* Client() override { return client_; } |
| 299 | 299 |
| 300 WebSpellCheckClient* SpellCheckClient() { return spell_check_client_; } | 300 WebSpellCheckClient* SpellCheckClient() override { |
| 301 return spell_check_client_; |
| 302 } |
| 301 | 303 |
| 302 // Returns the page object associated with this view. This may be null when | 304 // Returns the page object associated with this view. This may be null when |
| 303 // the page is shutting down, but will be valid at all other times. | 305 // the page is shutting down, but will be valid at all other times. |
| 304 Page* GetPage() const { return page_.Get(); } | 306 Page* GetPage() const override { return page_.Get(); } |
| 305 | 307 |
| 306 WebDevToolsAgentImpl* MainFrameDevToolsAgentImpl(); | 308 WebDevToolsAgentImpl* MainFrameDevToolsAgentImpl(); |
| 307 | 309 |
| 308 DevToolsEmulator* GetDevToolsEmulator() const { | 310 DevToolsEmulator* GetDevToolsEmulator() const override { |
| 309 return dev_tools_emulator_.Get(); | 311 return dev_tools_emulator_.Get(); |
| 310 } | 312 } |
| 311 | 313 |
| 312 // Returns the main frame associated with this view. This may be null when | 314 // Returns the main frame associated with this view. This may be null when |
| 313 // the page is shutting down, but will be valid at all other times. | 315 // the page is shutting down, but will be valid at all other times. |
| 314 WebLocalFrameImpl* MainFrameImpl() const; | 316 WebLocalFrameImpl* MainFrameImpl() const override; |
| 315 | 317 |
| 316 // Event related methods: | 318 // Event related methods: |
| 317 void MouseContextMenu(const WebMouseEvent&); | 319 void MouseContextMenu(const WebMouseEvent&); |
| 318 void MouseDoubleClick(const WebMouseEvent&); | 320 void MouseDoubleClick(const WebMouseEvent&); |
| 319 | 321 |
| 320 bool StartPageScaleAnimation(const IntPoint& target_position, | 322 bool StartPageScaleAnimation(const IntPoint& target_position, |
| 321 bool use_anchor, | 323 bool use_anchor, |
| 322 float new_scale, | 324 float new_scale, |
| 323 double duration_in_seconds); | 325 double duration_in_seconds); |
| 324 | 326 |
| 325 // WebGestureCurveTarget implementation for fling. | 327 // WebGestureCurveTarget implementation for fling. |
| 326 bool ScrollBy(const WebFloatSize& delta, | 328 bool ScrollBy(const WebFloatSize& delta, |
| 327 const WebFloatSize& velocity) override; | 329 const WebFloatSize& velocity) override; |
| 328 | 330 |
| 329 // Handles context menu events orignated via the the keyboard. These | 331 // Handles context menu events orignated via the the keyboard. These |
| 330 // include the VK_APPS virtual key and the Shift+F10 combine. Code is | 332 // include the VK_APPS virtual key and the Shift+F10 combine. Code is |
| 331 // based on the Webkit function bool WebView::handleContextMenuEvent(WPARAM | 333 // based on the Webkit function bool WebView::handleContextMenuEvent(WPARAM |
| 332 // wParam, LPARAM lParam) in webkit\webkit\win\WebView.cpp. The only | 334 // wParam, LPARAM lParam) in webkit\webkit\win\WebView.cpp. The only |
| 333 // significant change in this function is the code to convert from a | 335 // significant change in this function is the code to convert from a |
| 334 // Keyboard event to the Right Mouse button down event. | 336 // Keyboard event to the Right Mouse button down event. |
| 335 WebInputEventResult SendContextMenuEvent(const WebKeyboardEvent&); | 337 WebInputEventResult SendContextMenuEvent(const WebKeyboardEvent&) override; |
| 336 | 338 |
| 337 void ShowContextMenuAtPoint(float x, float y, ContextMenuProvider*); | 339 void ShowContextMenuAtPoint(float x, float y, ContextMenuProvider*) override; |
| 338 | 340 |
| 339 void ShowContextMenuForElement(WebElement); | 341 void ShowContextMenuForElement(WebElement) override; |
| 340 | 342 |
| 341 // Notifies the WebView that a load has been committed. isNewNavigation | 343 // Notifies the WebView that a load has been committed. isNewNavigation |
| 342 // will be true if a new session history item should be created for that | 344 // will be true if a new session history item should be created for that |
| 343 // load. isNavigationWithinPage will be true if the navigation does | 345 // load. isNavigationWithinPage will be true if the navigation does |
| 344 // not take the user away from the current page. | 346 // not take the user away from the current page. |
| 345 void DidCommitLoad(bool is_new_navigation, bool is_navigation_within_page); | 347 void DidCommitLoad(bool is_new_navigation, |
| 348 bool is_navigation_within_page) override; |
| 346 | 349 |
| 347 void PostLayoutResize(WebLocalFrameImpl* webframe); | 350 void PostLayoutResize(WebLocalFrameImpl* webframe); |
| 348 | 351 |
| 349 // Indicates two things: | 352 // Indicates two things: |
| 350 // 1) This view may have a new layout now. | 353 // 1) This view may have a new layout now. |
| 351 // 2) Calling updateAllLifecyclePhases() is a no-op. | 354 // 2) Calling updateAllLifecyclePhases() is a no-op. |
| 352 // After calling WebWidget::updateAllLifecyclePhases(), expect to get this | 355 // After calling WebWidget::updateAllLifecyclePhases(), expect to get this |
| 353 // notification unless the view did not need a layout. | 356 // notification unless the view did not need a layout. |
| 354 void LayoutUpdated(WebLocalFrameImpl*); | 357 void LayoutUpdated(WebLocalFrameImpl*); |
| 355 | 358 |
| 356 void DidChangeContentsSize(); | 359 void DidChangeContentsSize() override; |
| 357 void PageScaleFactorChanged(); | 360 void PageScaleFactorChanged() override; |
| 358 void MainFrameScrollOffsetChanged(); | 361 void MainFrameScrollOffsetChanged() override; |
| 359 | 362 |
| 360 // Returns true if popup menus should be rendered by the browser, false if | 363 // Returns true if popup menus should be rendered by the browser, false if |
| 361 // they should be rendered by WebKit (which is the default). | 364 // they should be rendered by WebKit (which is the default). |
| 362 static bool UseExternalPopupMenus(); | 365 static bool UseExternalPopupMenus(); |
| 363 | 366 |
| 364 bool ShouldAutoResize() const { return should_auto_resize_; } | 367 bool ShouldAutoResize() const override { return should_auto_resize_; } |
| 365 | 368 |
| 366 IntSize MinAutoSize() const { return min_auto_size_; } | 369 IntSize MinAutoSize() const override { return min_auto_size_; } |
| 367 | 370 |
| 368 IntSize MaxAutoSize() const { return max_auto_size_; } | 371 IntSize MaxAutoSize() const override { return max_auto_size_; } |
| 369 | 372 |
| 370 void UpdateMainFrameLayoutSize(); | 373 void UpdateMainFrameLayoutSize() override; |
| 371 void UpdatePageDefinedViewportConstraints(const ViewportDescription&); | 374 void UpdatePageDefinedViewportConstraints(const ViewportDescription&); |
| 372 | 375 |
| 373 PagePopup* OpenPagePopup(PagePopupClient*); | 376 PagePopup* OpenPagePopup(PagePopupClient*); |
| 374 void ClosePagePopup(PagePopup*); | 377 void ClosePagePopup(PagePopup*); |
| 375 void CleanupPagePopup(); | 378 void CleanupPagePopup(); |
| 376 LocalDOMWindow* PagePopupWindow() const; | 379 LocalDOMWindow* PagePopupWindow() const; |
| 377 | 380 |
| 378 // Returns the input event we're currently processing. This is used in some | 381 // Returns the input event we're currently processing. This is used in some |
| 379 // cases where the WebCore DOM event doesn't have the information we need. | 382 // cases where the WebCore DOM event doesn't have the information we need. |
| 380 static const WebInputEvent* CurrentInputEvent() { | 383 static const WebInputEvent* CurrentInputEvent() { |
| 381 return current_input_event_; | 384 return current_input_event_; |
| 382 } | 385 } |
| 383 | 386 |
| 384 GraphicsLayer* RootGraphicsLayer(); | 387 GraphicsLayer* RootGraphicsLayer(); |
| 385 void RegisterViewportLayersWithCompositor(); | 388 void RegisterViewportLayersWithCompositor(); |
| 386 PaintLayerCompositor* Compositor() const; | 389 PaintLayerCompositor* Compositor() const; |
| 387 CompositorAnimationTimeline* LinkHighlightsTimeline() const { | 390 CompositorAnimationTimeline* LinkHighlightsTimeline() const override { |
| 388 return link_highlights_timeline_.get(); | 391 return link_highlights_timeline_.get(); |
| 389 } | 392 } |
| 390 | 393 |
| 391 WebViewScheduler* Scheduler() const override; | 394 WebViewScheduler* Scheduler() const override; |
| 392 void SetVisibilityState(WebPageVisibilityState, bool) override; | 395 void SetVisibilityState(WebPageVisibilityState, bool) override; |
| 393 | 396 |
| 394 bool HasOpenedPopup() const { return page_popup_.Get(); } | 397 bool HasOpenedPopup() const { return page_popup_.Get(); } |
| 395 | 398 |
| 396 // Called by a full frame plugin inside this view to inform it that its | 399 // Called by a full frame plugin inside this view to inform it that its |
| 397 // zoom level has been updated. The plugin should only call this function | 400 // zoom level has been updated. The plugin should only call this function |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 // Exposed for testing purposes. | 449 // Exposed for testing purposes. |
| 447 bool HasHorizontalScrollbar(); | 450 bool HasHorizontalScrollbar(); |
| 448 bool HasVerticalScrollbar(); | 451 bool HasVerticalScrollbar(); |
| 449 | 452 |
| 450 // Exposed for tests. | 453 // Exposed for tests. |
| 451 unsigned NumLinkHighlights() { return link_highlights_.size(); } | 454 unsigned NumLinkHighlights() { return link_highlights_.size(); } |
| 452 LinkHighlightImpl* GetLinkHighlight(int i) { | 455 LinkHighlightImpl* GetLinkHighlight(int i) { |
| 453 return link_highlights_[i].get(); | 456 return link_highlights_[i].get(); |
| 454 } | 457 } |
| 455 | 458 |
| 456 WebSettingsImpl* SettingsImpl(); | 459 WebSettingsImpl* SettingsImpl() override; |
| 457 | 460 |
| 458 // Returns the bounding box of the block type node touched by the WebPoint. | 461 // Returns the bounding box of the block type node touched by the WebPoint. |
| 459 WebRect ComputeBlockBound(const WebPoint&, bool ignore_clipping); | 462 WebRect ComputeBlockBound(const WebPoint&, bool ignore_clipping); |
| 460 | 463 |
| 461 WebLayerTreeView* LayerTreeView() const { return layer_tree_view_; } | 464 WebLayerTreeView* LayerTreeView() const override { return layer_tree_view_; } |
| 462 CompositorAnimationHost* AnimationHost() const { | 465 CompositorAnimationHost* AnimationHost() const { |
| 463 return animation_host_.get(); | 466 return animation_host_.get(); |
| 464 } | 467 } |
| 465 | 468 |
| 466 bool MatchesHeuristicsForGpuRasterizationForTesting() const { | 469 bool MatchesHeuristicsForGpuRasterizationForTesting() const { |
| 467 return matches_heuristics_for_gpu_rasterization_; | 470 return matches_heuristics_for_gpu_rasterization_; |
| 468 } | 471 } |
| 469 | 472 |
| 470 void UpdateBrowserControlsState(WebBrowserControlsState constraint, | 473 void UpdateBrowserControlsState(WebBrowserControlsState constraint, |
| 471 WebBrowserControlsState current, | 474 WebBrowserControlsState current, |
| 472 bool animate) override; | 475 bool animate) override; |
| 473 | 476 |
| 474 BrowserControls& GetBrowserControls(); | 477 BrowserControls& GetBrowserControls(); |
| 475 // Called anytime browser controls layout height or content offset have | 478 // Called anytime browser controls layout height or content offset have |
| 476 // changed. | 479 // changed. |
| 477 void DidUpdateBrowserControls(); | 480 void DidUpdateBrowserControls(); |
| 478 | 481 |
| 479 void ForceNextWebGLContextCreationToFail() override; | 482 void ForceNextWebGLContextCreationToFail() override; |
| 480 void ForceNextDrawingBufferCreationToFail() override; | 483 void ForceNextDrawingBufferCreationToFail() override; |
| 481 | 484 |
| 482 CompositorWorkerProxyClient* CreateCompositorWorkerProxyClient(); | 485 CompositorWorkerProxyClient* CreateCompositorWorkerProxyClient(); |
| 483 AnimationWorkletProxyClient* CreateAnimationWorkletProxyClient(); | 486 AnimationWorkletProxyClient* CreateAnimationWorkletProxyClient(); |
| 484 | 487 |
| 485 IntSize MainFrameSize(); | 488 IntSize MainFrameSize() override; |
| 486 WebDisplayMode DisplayMode() const { return display_mode_; } | 489 WebDisplayMode DisplayMode() const override { return display_mode_; } |
| 487 | 490 |
| 488 PageScaleConstraintsSet& GetPageScaleConstraintsSet() const; | 491 PageScaleConstraintsSet& GetPageScaleConstraintsSet() const override; |
| 489 | 492 |
| 490 FloatSize ElasticOverscroll() const { return elastic_overscroll_; } | 493 FloatSize ElasticOverscroll() const { return elastic_overscroll_; } |
| 491 | 494 |
| 492 double LastFrameTimeMonotonic() const { return last_frame_time_monotonic_; } | 495 double LastFrameTimeMonotonic() const { return last_frame_time_monotonic_; } |
| 493 | 496 |
| 494 ChromeClientImpl& ChromeClient() const { return *chrome_client_impl_.Get(); } | 497 ChromeClientImpl& ChromeClient() const { return *chrome_client_impl_.Get(); } |
| 495 | 498 |
| 496 // Returns the currently active WebInputMethodController which is the one | 499 // Returns the currently active WebInputMethodController which is the one |
| 497 // corresponding to the focused frame. It will return nullptr if there is no | 500 // corresponding to the focused frame. It will return nullptr if there is no |
| 498 // focused frame, or if the there is one but it belongs to a different local | 501 // focused frame, or if the there is one but it belongs to a different local |
| 499 // root. | 502 // root. |
| 500 WebInputMethodControllerImpl* GetActiveWebInputMethodController() const; | 503 WebInputMethodControllerImpl* GetActiveWebInputMethodController() const; |
| 501 | 504 |
| 502 void SetLastHiddenPagePopup(WebPagePopupImpl* page_popup) { | 505 void SetLastHiddenPagePopup(WebPagePopupImpl* page_popup) override { |
| 503 last_hidden_page_popup_ = page_popup; | 506 last_hidden_page_popup_ = page_popup; |
| 504 } | 507 } |
| 505 | 508 |
| 506 private: | 509 private: |
| 507 InspectorOverlayAgent* GetInspectorOverlay(); | 510 InspectorOverlayAgent* GetInspectorOverlay(); |
| 508 | 511 |
| 509 void SetPageScaleFactorAndLocation(float, const FloatPoint&); | 512 void SetPageScaleFactorAndLocation(float, const FloatPoint&); |
| 510 void PropagateZoomFactorToLocalFrameRoots(Frame*, float); | 513 void PropagateZoomFactorToLocalFrameRoots(Frame*, float); |
| 511 | 514 |
| 512 void ScrollAndRescaleViewports(float scale_factor, | 515 void ScrollAndRescaleViewports(float scale_factor, |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 Persistent<ResizeViewportAnchor> resize_viewport_anchor_; | 744 Persistent<ResizeViewportAnchor> resize_viewport_anchor_; |
| 742 }; | 745 }; |
| 743 | 746 |
| 744 // We have no ways to check if the specified WebView is an instance of | 747 // We have no ways to check if the specified WebView is an instance of |
| 745 // WebViewImpl because WebViewImpl is the only implementation of WebView. | 748 // WebViewImpl because WebViewImpl is the only implementation of WebView. |
| 746 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); | 749 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); |
| 747 | 750 |
| 748 } // namespace blink | 751 } // namespace blink |
| 749 | 752 |
| 750 #endif | 753 #endif |
| OLD | NEW |