| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 class WebRemoteFrame; | 93 class WebRemoteFrame; |
| 94 class WebSelection; | 94 class WebSelection; |
| 95 class WebSettingsImpl; | 95 class WebSettingsImpl; |
| 96 class WebViewScheduler; | 96 class WebViewScheduler; |
| 97 | 97 |
| 98 class WEB_EXPORT WebViewImpl final : WTF_NON_EXPORTED_BASE(public WebView) | 98 class WEB_EXPORT WebViewImpl final : WTF_NON_EXPORTED_BASE(public WebView) |
| 99 , public RefCounted<WebViewImpl> | 99 , public RefCounted<WebViewImpl> |
| 100 , WTF_NON_EXPORTED_BASE(public WebGestureCurveTarget) | 100 , WTF_NON_EXPORTED_BASE(public WebGestureCurveTarget) |
| 101 , public PageWidgetEventHandler { | 101 , public PageWidgetEventHandler { |
| 102 public: | 102 public: |
| 103 static WebViewImpl* create(WebViewClient*); | 103 static WebViewImpl* create(WebViewClient*, WebPageVisibilityState); |
| 104 static HashSet<WebViewImpl*>& allInstances(); | 104 static HashSet<WebViewImpl*>& allInstances(); |
| 105 | 105 |
| 106 // WebWidget methods: | 106 // WebWidget methods: |
| 107 void close() override; | 107 void close() override; |
| 108 WebSize size() override; | 108 WebSize size() override; |
| 109 void resize(const WebSize&) override; | 109 void resize(const WebSize&) override; |
| 110 void resizeVisualViewport(const WebSize&) override; | 110 void resizeVisualViewport(const WebSize&) override; |
| 111 void didEnterFullScreen() override; | 111 void didEnterFullScreen() override; |
| 112 void didExitFullScreen() override; | 112 void didExitFullScreen() override; |
| 113 | 113 |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 | 532 |
| 533 void scrollAndRescaleViewports(float scaleFactor, const IntPoint& mainFrameO
rigin, const FloatPoint& visualViewportOrigin); | 533 void scrollAndRescaleViewports(float scaleFactor, const IntPoint& mainFrameO
rigin, const FloatPoint& visualViewportOrigin); |
| 534 | 534 |
| 535 float maximumLegiblePageScale() const; | 535 float maximumLegiblePageScale() const; |
| 536 void refreshPageScaleFactorAfterLayout(); | 536 void refreshPageScaleFactorAfterLayout(); |
| 537 IntSize contentsSize() const; | 537 IntSize contentsSize() const; |
| 538 | 538 |
| 539 void performResize(); | 539 void performResize(); |
| 540 void resizeViewWhileAnchored(FrameView*, float topControlsHeight, bool topCo
ntrolsShrinkLayout); | 540 void resizeViewWhileAnchored(FrameView*, float topControlsHeight, bool topCo
ntrolsShrinkLayout); |
| 541 | 541 |
| 542 // Overrides the compositor visibility. See the description of |
| 543 // m_overrideCompositorVisibility for more details. |
| 544 void setCompositorVisibility(bool); |
| 545 |
| 542 friend class WebView; // So WebView::Create can call our constructor | 546 friend class WebView; // So WebView::Create can call our constructor |
| 547 friend class WebViewFrameWidget; |
| 543 friend class WTF::RefCounted<WebViewImpl>; | 548 friend class WTF::RefCounted<WebViewImpl>; |
| 544 friend void setCurrentInputEventForTest(const WebInputEvent*); | 549 friend void setCurrentInputEventForTest(const WebInputEvent*); |
| 545 | 550 |
| 546 enum DragAction { | 551 enum DragAction { |
| 547 DragEnter, | 552 DragEnter, |
| 548 DragOver | 553 DragOver |
| 549 }; | 554 }; |
| 550 | 555 |
| 551 explicit WebViewImpl(WebViewClient*); | 556 explicit WebViewImpl(WebViewClient*, WebPageVisibilityState); |
| 552 ~WebViewImpl() override; | 557 ~WebViewImpl() override; |
| 553 | 558 |
| 554 int textInputFlags(); | 559 int textInputFlags(); |
| 555 | 560 |
| 556 WebString inputModeOfFocusedElement(); | 561 WebString inputModeOfFocusedElement(); |
| 557 | 562 |
| 558 // Returns true if the event was actually processed. | 563 // Returns true if the event was actually processed. |
| 559 bool keyEventDefault(const WebKeyboardEvent&); | 564 bool keyEventDefault(const WebKeyboardEvent&); |
| 560 | 565 |
| 561 bool confirmComposition(const WebString& text, ConfirmCompositionBehavior); | 566 bool confirmComposition(const WebString& text, ConfirmCompositionBehavior); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 Persistent<EventListener> m_popupMouseWheelEventListener; | 755 Persistent<EventListener> m_popupMouseWheelEventListener; |
| 751 | 756 |
| 752 WebPageImportanceSignals m_pageImportanceSignals; | 757 WebPageImportanceSignals m_pageImportanceSignals; |
| 753 | 758 |
| 754 const std::unique_ptr<WebViewScheduler> m_scheduler; | 759 const std::unique_ptr<WebViewScheduler> m_scheduler; |
| 755 | 760 |
| 756 // Manages the layer tree created for this page in Slimming Paint v2. | 761 // Manages the layer tree created for this page in Slimming Paint v2. |
| 757 PaintArtifactCompositor m_paintArtifactCompositor; | 762 PaintArtifactCompositor m_paintArtifactCompositor; |
| 758 | 763 |
| 759 double m_lastFrameTimeMonotonic; | 764 double m_lastFrameTimeMonotonic; |
| 765 |
| 766 // TODO(lfg): This is used in order to disable compositor visibility while |
| 767 // the page is still visible. This is needed until the WebView and WebWidget |
| 768 // split is complete, since in out-of-process iframes the page can be |
| 769 // visible, but the WebView should not be used as a widget. |
| 770 bool m_overrideCompositorVisibility; |
| 760 }; | 771 }; |
| 761 | 772 |
| 762 // We have no ways to check if the specified WebView is an instance of | 773 // We have no ways to check if the specified WebView is an instance of |
| 763 // WebViewImpl because WebViewImpl is the only implementation of WebView. | 774 // WebViewImpl because WebViewImpl is the only implementation of WebView. |
| 764 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); | 775 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); |
| 765 | 776 |
| 766 } // namespace blink | 777 } // namespace blink |
| 767 | 778 |
| 768 #endif | 779 #endif |
| OLD | NEW |