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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 #include "public/platform/WebDisplayMode.h" | 42 #include "public/platform/WebDisplayMode.h" |
43 #include "public/platform/WebFloatSize.h" | 43 #include "public/platform/WebFloatSize.h" |
44 #include "public/platform/WebGestureCurveTarget.h" | 44 #include "public/platform/WebGestureCurveTarget.h" |
45 #include "public/platform/WebInputEventResult.h" | 45 #include "public/platform/WebInputEventResult.h" |
46 #include "public/platform/WebLayer.h" | 46 #include "public/platform/WebLayer.h" |
47 #include "public/platform/WebPoint.h" | 47 #include "public/platform/WebPoint.h" |
48 #include "public/platform/WebRect.h" | 48 #include "public/platform/WebRect.h" |
49 #include "public/platform/WebSize.h" | 49 #include "public/platform/WebSize.h" |
50 #include "public/platform/WebString.h" | 50 #include "public/platform/WebString.h" |
51 #include "public/platform/WebVector.h" | 51 #include "public/platform/WebVector.h" |
52 #include "public/web/WebDeviceEmulationParams.h" | |
52 #include "public/web/WebInputEvent.h" | 53 #include "public/web/WebInputEvent.h" |
53 #include "public/web/WebNavigationPolicy.h" | 54 #include "public/web/WebNavigationPolicy.h" |
54 #include "public/web/WebPageImportanceSignals.h" | 55 #include "public/web/WebPageImportanceSignals.h" |
55 #include "public/web/WebView.h" | 56 #include "public/web/WebView.h" |
56 #include "web/ChromeClientImpl.h" | 57 #include "web/ChromeClientImpl.h" |
57 #include "web/ContextMenuClientImpl.h" | 58 #include "web/ContextMenuClientImpl.h" |
58 #include "web/EditorClientImpl.h" | 59 #include "web/EditorClientImpl.h" |
59 #include "web/MediaKeysClientImpl.h" | 60 #include "web/MediaKeysClientImpl.h" |
60 #include "web/PageWidgetDelegate.h" | 61 #include "web/PageWidgetDelegate.h" |
61 #include "web/SpellCheckerClientImpl.h" | 62 #include "web/SpellCheckerClientImpl.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
198 double setZoomLevel(double) override; | 199 double setZoomLevel(double) override; |
199 void zoomLimitsChanged(double minimumZoomLevel, double maximumZoomLevel) ove rride; | 200 void zoomLimitsChanged(double minimumZoomLevel, double maximumZoomLevel) ove rride; |
200 float textZoomFactor() override; | 201 float textZoomFactor() override; |
201 float setTextZoomFactor(float) override; | 202 float setTextZoomFactor(float) override; |
202 bool zoomToMultipleTargetsRect(const WebRect&) override; | 203 bool zoomToMultipleTargetsRect(const WebRect&) override; |
203 float pageScaleFactor() const override; | 204 float pageScaleFactor() const override; |
204 void setDefaultPageScaleLimits(float minScale, float maxScale) override; | 205 void setDefaultPageScaleLimits(float minScale, float maxScale) override; |
205 void setInitialPageScaleOverride(float) override; | 206 void setInitialPageScaleOverride(float) override; |
206 void setMaximumLegibleScale(float) override; | 207 void setMaximumLegibleScale(float) override; |
207 void setPageScaleFactor(float) override; | 208 void setPageScaleFactor(float) override; |
209 WebPoint mainFrameOffset() const override; | |
208 void setVisualViewportOffset(const WebFloatPoint&) override; | 210 void setVisualViewportOffset(const WebFloatPoint&) override; |
209 WebFloatPoint visualViewportOffset() const override; | 211 WebFloatPoint visualViewportOffset() const override; |
210 WebFloatSize visualViewportSize() const override; | 212 WebFloatSize visualViewportSize() const override; |
211 void resetScrollAndScaleState() override; | 213 void resetScrollAndScaleState() override; |
212 void setIgnoreViewportTagScaleLimits(bool) override; | 214 void setIgnoreViewportTagScaleLimits(bool) override; |
213 WebSize contentsPreferredMinimumSize() override; | 215 WebSize contentsPreferredMinimumSize() override; |
214 void setDisplayMode(WebDisplayMode) override; | 216 void setDisplayMode(WebDisplayMode) override; |
215 | 217 |
216 void setDeviceScaleFactor(float) override; | 218 void setDeviceScaleFactor(float) override; |
217 void setZoomFactorForDeviceScaleFactor(float) override; | 219 void setZoomFactorForDeviceScaleFactor(float) override; |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
531 double lastFrameTimeMonotonic() const { return m_lastFrameTimeMonotonic; } | 533 double lastFrameTimeMonotonic() const { return m_lastFrameTimeMonotonic; } |
532 | 534 |
533 ChromeClientImpl& chromeClient() const { return *m_chromeClientImpl.get(); } | 535 ChromeClientImpl& chromeClient() const { return *m_chromeClientImpl.get(); } |
534 | 536 |
535 private: | 537 private: |
536 InspectorOverlay* inspectorOverlay(); | 538 InspectorOverlay* inspectorOverlay(); |
537 | 539 |
538 void setPageScaleFactorAndLocation(float, const FloatPoint&); | 540 void setPageScaleFactorAndLocation(float, const FloatPoint&); |
539 void propagateZoomFactorToLocalFrameRoots(Frame*, float); | 541 void propagateZoomFactorToLocalFrameRoots(Frame*, float); |
540 | 542 |
543 // Override the page scale and scroll positions of main frame and visual vie wport. | |
544 void setScrollOverride(const WebDeviceEmulationParams&); | |
545 | |
546 // Clear the page scale and scroll position overrides. | |
547 void clearScrollOverride(); | |
548 | |
541 void scrollAndRescaleViewports(float scaleFactor, const IntPoint& mainFrameO rigin, const FloatPoint& visualViewportOrigin); | 549 void scrollAndRescaleViewports(float scaleFactor, const IntPoint& mainFrameO rigin, const FloatPoint& visualViewportOrigin); |
542 | 550 |
543 float maximumLegiblePageScale() const; | 551 float maximumLegiblePageScale() const; |
544 void refreshPageScaleFactorAfterLayout(); | 552 void refreshPageScaleFactorAfterLayout(); |
545 IntSize contentsSize() const; | 553 IntSize contentsSize() const; |
546 | 554 |
547 void performResize(); | 555 void performResize(); |
548 void resizeViewWhileAnchored(FrameView*, float topControlsHeight, bool topCo ntrolsShrinkLayout); | 556 void resizeViewWhileAnchored(FrameView*, float topControlsHeight, bool topCo ntrolsShrinkLayout); |
549 | 557 |
550 friend class WebView; // So WebView::Create can call our constructor | 558 friend class WebView; // So WebView::Create can call our constructor |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
671 float m_doubleTapZoomPageScaleFactor; | 679 float m_doubleTapZoomPageScaleFactor; |
672 // Have we sent a double-tap zoom and not yet heard back the scale? | 680 // Have we sent a double-tap zoom and not yet heard back the scale? |
673 bool m_doubleTapZoomPending; | 681 bool m_doubleTapZoomPending; |
674 | 682 |
675 // Used for testing purposes. | 683 // Used for testing purposes. |
676 bool m_enableFakePageScaleAnimationForTesting; | 684 bool m_enableFakePageScaleAnimationForTesting; |
677 IntPoint m_fakePageScaleAnimationTargetPosition; | 685 IntPoint m_fakePageScaleAnimationTargetPosition; |
678 float m_fakePageScaleAnimationPageScaleFactor; | 686 float m_fakePageScaleAnimationPageScaleFactor; |
679 bool m_fakePageScaleAnimationUseAnchor; | 687 bool m_fakePageScaleAnimationUseAnchor; |
680 | 688 |
689 bool m_scrollOverrideEnabled; | |
690 WebDeviceEmulationParams m_scrollOverrideParams; | |
Sami
2016/06/23 17:34:03
This is a pretty hefty object -- should we instead
Eric Seckler
2016/06/23 18:12:43
I agree, I will do that in combination with David'
| |
691 | |
681 bool m_doingDragAndDrop; | 692 bool m_doingDragAndDrop; |
682 | 693 |
683 bool m_ignoreInputEvents; | 694 bool m_ignoreInputEvents; |
684 | 695 |
685 float m_compositorDeviceScaleFactorOverride; | 696 float m_compositorDeviceScaleFactorOverride; |
686 WebSize m_rootLayerOffset; | 697 WebSize m_rootLayerOffset; |
687 float m_rootLayerScale; | 698 float m_rootLayerScale; |
688 | 699 |
689 // Webkit expects keyPress events to be suppressed if the associated keyDown | 700 // Webkit expects keyPress events to be suppressed if the associated keyDown |
690 // event was handled. Safari implements this behavior by peeking out the | 701 // event was handled. Safari implements this behavior by peeking out the |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
767 double m_lastFrameTimeMonotonic; | 778 double m_lastFrameTimeMonotonic; |
768 }; | 779 }; |
769 | 780 |
770 // We have no ways to check if the specified WebView is an instance of | 781 // We have no ways to check if the specified WebView is an instance of |
771 // WebViewImpl because WebViewImpl is the only implementation of WebView. | 782 // WebViewImpl because WebViewImpl is the only implementation of WebView. |
772 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); | 783 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); |
773 | 784 |
774 } // namespace blink | 785 } // namespace blink |
775 | 786 |
776 #endif | 787 #endif |
OLD | NEW |