| 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 26 matching lines...) Expand all Loading... |
| 37 #include "core/page/ContextMenuProvider.h" | 37 #include "core/page/ContextMenuProvider.h" |
| 38 #include "core/page/EventWithHitTestResults.h" | 38 #include "core/page/EventWithHitTestResults.h" |
| 39 #include "platform/animation/CompositorAnimationTimeline.h" | 39 #include "platform/animation/CompositorAnimationTimeline.h" |
| 40 #include "platform/geometry/IntPoint.h" | 40 #include "platform/geometry/IntPoint.h" |
| 41 #include "platform/geometry/IntRect.h" | 41 #include "platform/geometry/IntRect.h" |
| 42 #include "platform/graphics/GraphicsLayer.h" | 42 #include "platform/graphics/GraphicsLayer.h" |
| 43 #include "platform/heap/Handle.h" | 43 #include "platform/heap/Handle.h" |
| 44 #include "platform/scheduler/child/web_scheduler.h" | 44 #include "platform/scheduler/child/web_scheduler.h" |
| 45 #include "platform/wtf/Compiler.h" | 45 #include "platform/wtf/Compiler.h" |
| 46 #include "platform/wtf/HashSet.h" | 46 #include "platform/wtf/HashSet.h" |
| 47 #include "platform/wtf/RefCounted.h" | |
| 48 #include "platform/wtf/Vector.h" | 47 #include "platform/wtf/Vector.h" |
| 49 #include "public/platform/WebDisplayMode.h" | 48 #include "public/platform/WebDisplayMode.h" |
| 50 #include "public/platform/WebFloatSize.h" | 49 #include "public/platform/WebFloatSize.h" |
| 51 #include "public/platform/WebGestureCurveTarget.h" | 50 #include "public/platform/WebGestureCurveTarget.h" |
| 52 #include "public/platform/WebGestureEvent.h" | 51 #include "public/platform/WebGestureEvent.h" |
| 53 #include "public/platform/WebInputEvent.h" | 52 #include "public/platform/WebInputEvent.h" |
| 54 #include "public/platform/WebInputEventResult.h" | 53 #include "public/platform/WebInputEventResult.h" |
| 55 #include "public/platform/WebLayer.h" | 54 #include "public/platform/WebLayer.h" |
| 56 #include "public/platform/WebPoint.h" | 55 #include "public/platform/WebPoint.h" |
| 57 #include "public/platform/WebRect.h" | 56 #include "public/platform/WebRect.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 class WebLocalFrame; | 90 class WebLocalFrame; |
| 92 class WebLocalFrameImpl; | 91 class WebLocalFrameImpl; |
| 93 class CompositorMutatorImpl; | 92 class CompositorMutatorImpl; |
| 94 class WebPlugin; | 93 class WebPlugin; |
| 95 class WebRemoteFrame; | 94 class WebRemoteFrame; |
| 96 class WebSettingsImpl; | 95 class WebSettingsImpl; |
| 97 class WebViewScheduler; | 96 class WebViewScheduler; |
| 98 | 97 |
| 99 class WEB_EXPORT WebViewImpl final | 98 class WEB_EXPORT WebViewImpl final |
| 100 : NON_EXPORTED_BASE(public WebViewBase), | 99 : NON_EXPORTED_BASE(public WebViewBase), |
| 101 public RefCounted<WebViewImpl>, | |
| 102 NON_EXPORTED_BASE(public WebGestureCurveTarget), | 100 NON_EXPORTED_BASE(public WebGestureCurveTarget), |
| 103 public PageWidgetEventHandler, | 101 public PageWidgetEventHandler, |
| 104 public WebScheduler::InterventionReporter, | 102 public WebScheduler::InterventionReporter, |
| 105 public WebViewScheduler::WebViewSchedulerSettings { | 103 public WebViewScheduler::WebViewSchedulerSettings { |
| 106 public: | 104 public: |
| 107 static WebViewImpl* Create(WebViewClient*, WebPageVisibilityState); | 105 static WebViewImpl* Create(WebViewClient*, WebPageVisibilityState); |
| 108 static HashSet<WebViewImpl*>& AllInstances(); | 106 static HashSet<WebViewImpl*>& AllInstances(); |
| 109 | 107 |
| 110 // WebWidget methods: | 108 // WebWidget methods: |
| 111 void Close() override; | 109 void Close() override; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 258 |
| 261 void DidUpdateFullscreenSize() override; | 259 void DidUpdateFullscreenSize() override; |
| 262 | 260 |
| 263 float DefaultMinimumPageScaleFactor() const override; | 261 float DefaultMinimumPageScaleFactor() const override; |
| 264 float DefaultMaximumPageScaleFactor() const override; | 262 float DefaultMaximumPageScaleFactor() const override; |
| 265 float MinimumPageScaleFactor() const override; | 263 float MinimumPageScaleFactor() const override; |
| 266 float MaximumPageScaleFactor() const override; | 264 float MaximumPageScaleFactor() const override; |
| 267 float ClampPageScaleFactorToLimits(float) const override; | 265 float ClampPageScaleFactorToLimits(float) const override; |
| 268 void ResetScaleStateImmediately() override; | 266 void ResetScaleStateImmediately() override; |
| 269 | 267 |
| 270 HitTestResult CoreHitTestResultAt(const WebPoint&); | 268 HitTestResult CoreHitTestResultAt(const WebPoint&) override; |
| 271 void InvalidateRect(const IntRect&) override; | 269 void InvalidateRect(const IntRect&) override; |
| 272 | 270 |
| 273 void SetBaseBackgroundColor(WebColor) override; | 271 void SetBaseBackgroundColor(WebColor) override; |
| 274 void SetBaseBackgroundColorOverride(WebColor) override; | 272 void SetBaseBackgroundColorOverride(WebColor) override; |
| 275 void ClearBaseBackgroundColorOverride() override; | 273 void ClearBaseBackgroundColorOverride() override; |
| 276 void SetBackgroundColorOverride(WebColor) override; | 274 void SetBackgroundColorOverride(WebColor) override; |
| 277 void ClearBackgroundColorOverride() override; | 275 void ClearBackgroundColorOverride() override; |
| 278 void SetZoomFactorOverride(float) override; | 276 void SetZoomFactorOverride(float) override; |
| 279 void SetCompositorDeviceScaleFactorOverride(float) override; | 277 void SetCompositorDeviceScaleFactorOverride(float) override; |
| 280 void SetDeviceEmulationTransform(const TransformationMatrix&) override; | 278 void SetDeviceEmulationTransform(const TransformationMatrix&) override; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 LinkHighlightImpl* GetLinkHighlight(int i) { | 453 LinkHighlightImpl* GetLinkHighlight(int i) { |
| 456 return link_highlights_[i].get(); | 454 return link_highlights_[i].get(); |
| 457 } | 455 } |
| 458 | 456 |
| 459 WebSettingsImpl* SettingsImpl() override; | 457 WebSettingsImpl* SettingsImpl() override; |
| 460 | 458 |
| 461 // Returns the bounding box of the block type node touched by the WebPoint. | 459 // Returns the bounding box of the block type node touched by the WebPoint. |
| 462 WebRect ComputeBlockBound(const WebPoint&, bool ignore_clipping); | 460 WebRect ComputeBlockBound(const WebPoint&, bool ignore_clipping); |
| 463 | 461 |
| 464 WebLayerTreeView* LayerTreeView() const override { return layer_tree_view_; } | 462 WebLayerTreeView* LayerTreeView() const override { return layer_tree_view_; } |
| 465 CompositorAnimationHost* AnimationHost() const { | 463 CompositorAnimationHost* AnimationHost() const override { |
| 466 return animation_host_.get(); | 464 return animation_host_.get(); |
| 467 } | 465 } |
| 468 | 466 |
| 469 bool MatchesHeuristicsForGpuRasterizationForTesting() const { | 467 bool MatchesHeuristicsForGpuRasterizationForTesting() const { |
| 470 return matches_heuristics_for_gpu_rasterization_; | 468 return matches_heuristics_for_gpu_rasterization_; |
| 471 } | 469 } |
| 472 | 470 |
| 473 void UpdateBrowserControlsState(WebBrowserControlsState constraint, | 471 void UpdateBrowserControlsState(WebBrowserControlsState constraint, |
| 474 WebBrowserControlsState current, | 472 WebBrowserControlsState current, |
| 475 bool animate) override; | 473 bool animate) override; |
| 476 | 474 |
| 477 BrowserControls& GetBrowserControls(); | 475 BrowserControls& GetBrowserControls(); |
| 478 // Called anytime browser controls layout height or content offset have | 476 // Called anytime browser controls layout height or content offset have |
| 479 // changed. | 477 // changed. |
| 480 void DidUpdateBrowserControls() override; | 478 void DidUpdateBrowserControls() override; |
| 481 | 479 |
| 482 void ForceNextWebGLContextCreationToFail() override; | 480 void ForceNextWebGLContextCreationToFail() override; |
| 483 void ForceNextDrawingBufferCreationToFail() override; | 481 void ForceNextDrawingBufferCreationToFail() override; |
| 484 | 482 |
| 485 CompositorWorkerProxyClient* CreateCompositorWorkerProxyClient(); | 483 CompositorWorkerProxyClient* CreateCompositorWorkerProxyClient() override; |
| 486 AnimationWorkletProxyClient* CreateAnimationWorkletProxyClient(); | 484 AnimationWorkletProxyClient* CreateAnimationWorkletProxyClient() override; |
| 487 | 485 |
| 488 IntSize MainFrameSize() override; | 486 IntSize MainFrameSize() override; |
| 489 WebDisplayMode DisplayMode() const override { return display_mode_; } | 487 WebDisplayMode DisplayMode() const override { return display_mode_; } |
| 490 | 488 |
| 491 PageScaleConstraintsSet& GetPageScaleConstraintsSet() const override; | 489 PageScaleConstraintsSet& GetPageScaleConstraintsSet() const override; |
| 492 | 490 |
| 493 FloatSize ElasticOverscroll() const override { return elastic_overscroll_; } | 491 FloatSize ElasticOverscroll() const override { return elastic_overscroll_; } |
| 494 | 492 |
| 495 double LastFrameTimeMonotonic() const override { | 493 double LastFrameTimeMonotonic() const override { |
| 496 return last_frame_time_monotonic_; | 494 return last_frame_time_monotonic_; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 522 void RefreshPageScaleFactorAfterLayout(); | 520 void RefreshPageScaleFactorAfterLayout(); |
| 523 IntSize ContentsSize() const; | 521 IntSize ContentsSize() const; |
| 524 | 522 |
| 525 void ResizeFrameView(WebLocalFrameImpl* webframe); | 523 void ResizeFrameView(WebLocalFrameImpl* webframe); |
| 526 void UpdateICBAndResizeViewport(); | 524 void UpdateICBAndResizeViewport(); |
| 527 void ResizeViewWhileAnchored(float browser_controls_height, | 525 void ResizeViewWhileAnchored(float browser_controls_height, |
| 528 bool browser_controls_shrink_layout); | 526 bool browser_controls_shrink_layout); |
| 529 | 527 |
| 530 // Overrides the compositor visibility. See the description of | 528 // Overrides the compositor visibility. See the description of |
| 531 // m_overrideCompositorVisibility for more details. | 529 // m_overrideCompositorVisibility for more details. |
| 532 void SetCompositorVisibility(bool); | 530 void SetCompositorVisibility(bool) override; |
| 533 | 531 |
| 534 // TODO(lfg): Remove once WebViewFrameWidget is deleted. | 532 // TODO(lfg): Remove once WebViewFrameWidget is deleted. |
| 535 void ScheduleAnimationForWidget(); | 533 void ScheduleAnimationForWidget() override; |
| 536 bool GetCompositionCharacterBounds(WebVector<WebRect>&) override; | 534 bool GetCompositionCharacterBounds(WebVector<WebRect>&) override; |
| 537 | 535 |
| 538 void UpdateBaseBackgroundColor(); | 536 void UpdateBaseBackgroundColor(); |
| 539 | 537 |
| 540 friend class WebView; // So WebView::Create can call our constructor | 538 friend class WebView; // So WebView::Create can call our constructor |
| 541 friend class WebViewFrameWidget; | 539 friend class WebViewFrameWidget; |
| 542 friend class WTF::RefCounted<WebViewImpl>; | 540 friend class WTF::RefCounted<WebViewImpl>; |
| 543 friend void SetCurrentInputEventForTest(const WebInputEvent*); | 541 friend void SetCurrentInputEventForTest(const WebInputEvent*); |
| 544 | 542 |
| 545 explicit WebViewImpl(WebViewClient*, WebPageVisibilityState); | 543 explicit WebViewImpl(WebViewClient*, WebPageVisibilityState); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 WebGestureDevice) const; | 585 WebGestureDevice) const; |
| 588 | 586 |
| 589 void EnablePopupMouseWheelEventListener(WebLocalFrameImpl* local_root); | 587 void EnablePopupMouseWheelEventListener(WebLocalFrameImpl* local_root); |
| 590 void DisablePopupMouseWheelEventListener(); | 588 void DisablePopupMouseWheelEventListener(); |
| 591 | 589 |
| 592 void CancelPagePopup(); | 590 void CancelPagePopup(); |
| 593 void UpdatePageOverlays(); | 591 void UpdatePageOverlays(); |
| 594 | 592 |
| 595 float DeviceScaleFactor() const; | 593 float DeviceScaleFactor() const; |
| 596 | 594 |
| 597 void SetRootGraphicsLayer(GraphicsLayer*); | 595 void SetRootGraphicsLayer(GraphicsLayer*) override; |
| 598 void SetRootLayer(WebLayer*); | 596 void SetRootLayer(WebLayer*) override; |
| 599 void AttachCompositorAnimationTimeline(CompositorAnimationTimeline*); | 597 void AttachCompositorAnimationTimeline(CompositorAnimationTimeline*); |
| 600 void DetachCompositorAnimationTimeline(CompositorAnimationTimeline*); | 598 void DetachCompositorAnimationTimeline(CompositorAnimationTimeline*); |
| 601 | 599 |
| 602 LocalFrame* FocusedLocalFrameInWidget() const; | 600 LocalFrame* FocusedLocalFrameInWidget() const; |
| 603 LocalFrame* FocusedLocalFrameAvailableForIme() const; | 601 LocalFrame* FocusedLocalFrameAvailableForIme() const; |
| 604 | 602 |
| 605 CompositorMutatorImpl& Mutator(); | 603 CompositorMutatorImpl& Mutator(); |
| 606 | 604 |
| 607 WebViewClient* client_; // Can be 0 (e.g. unittests, shared workers, etc.) | 605 WebViewClient* client_; // Can be 0 (e.g. unittests, shared workers, etc.) |
| 608 WebSpellCheckClient* spell_check_client_; | 606 WebSpellCheckClient* spell_check_client_; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 Persistent<ResizeViewportAnchor> resize_viewport_anchor_; | 745 Persistent<ResizeViewportAnchor> resize_viewport_anchor_; |
| 748 }; | 746 }; |
| 749 | 747 |
| 750 // We have no ways to check if the specified WebView is an instance of | 748 // We have no ways to check if the specified WebView is an instance of |
| 751 // WebViewImpl because WebViewImpl is the only implementation of WebView. | 749 // WebViewImpl because WebViewImpl is the only implementation of WebView. |
| 752 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); | 750 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); |
| 753 | 751 |
| 754 } // namespace blink | 752 } // namespace blink |
| 755 | 753 |
| 756 #endif | 754 #endif |
| OLD | NEW |