Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.h

Issue 2096633002: Adds scroll position/scale emulation to DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: setNeedsCompositingUpdate now using InputChange. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 #include "web/StorageClientImpl.h" 62 #include "web/StorageClientImpl.h"
63 #include "web/WebExport.h" 63 #include "web/WebExport.h"
64 #include "wtf/Compiler.h" 64 #include "wtf/Compiler.h"
65 #include "wtf/HashSet.h" 65 #include "wtf/HashSet.h"
66 #include "wtf/RefCounted.h" 66 #include "wtf/RefCounted.h"
67 #include "wtf/Vector.h" 67 #include "wtf/Vector.h"
68 #include <memory> 68 #include <memory>
69 69
70 namespace blink { 70 namespace blink {
71 71
72 class CompositorMutatorImpl;
72 class DataObject; 73 class DataObject;
73 class DevToolsEmulator; 74 class DevToolsEmulator;
74 class Frame; 75 class Frame;
75 class FullscreenController; 76 class FullscreenController;
76 class InspectorOverlay; 77 class InspectorOverlay;
77 class LinkHighlightImpl; 78 class LinkHighlightImpl;
78 class PageOverlay; 79 class PageOverlay;
79 class PageScaleConstraintsSet; 80 class PageScaleConstraintsSet;
80 class PaintLayerCompositor; 81 class PaintLayerCompositor;
82 class ScrollAndScaleEmulator;
81 class TopControls; 83 class TopControls;
82 class UserGestureToken; 84 class UserGestureToken;
83 class WebActiveGestureAnimation; 85 class WebActiveGestureAnimation;
84 class WebDevToolsAgentImpl; 86 class WebDevToolsAgentImpl;
85 class WebElement; 87 class WebElement;
86 class WebLayerTreeView; 88 class WebLayerTreeView;
87 class WebLocalFrame; 89 class WebLocalFrame;
88 class WebLocalFrameImpl; 90 class WebLocalFrameImpl;
89 class WebImage; 91 class WebImage;
90 class CompositorMutatorImpl;
91 class WebPagePopupImpl; 92 class WebPagePopupImpl;
92 class WebPlugin; 93 class WebPlugin;
93 class WebRemoteFrame; 94 class WebRemoteFrame;
94 class WebSelection; 95 class WebSelection;
95 class WebSettingsImpl; 96 class WebSettingsImpl;
96 class WebViewScheduler; 97 class WebViewScheduler;
97 98
98 class WEB_EXPORT WebViewImpl final : WTF_NON_EXPORTED_BASE(public WebView) 99 class WEB_EXPORT WebViewImpl final : WTF_NON_EXPORTED_BASE(public WebView)
99 , public RefCounted<WebViewImpl> 100 , public RefCounted<WebViewImpl>
100 , WTF_NON_EXPORTED_BASE(public WebGestureCurveTarget) 101 , WTF_NON_EXPORTED_BASE(public WebGestureCurveTarget)
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 double lastFrameTimeMonotonic() const { return m_lastFrameTimeMonotonic; } 524 double lastFrameTimeMonotonic() const { return m_lastFrameTimeMonotonic; }
524 525
525 ChromeClientImpl& chromeClient() const { return *m_chromeClientImpl.get(); } 526 ChromeClientImpl& chromeClient() const { return *m_chromeClientImpl.get(); }
526 527
527 private: 528 private:
528 InspectorOverlay* inspectorOverlay(); 529 InspectorOverlay* inspectorOverlay();
529 530
530 void setPageScaleFactorAndLocation(float, const FloatPoint&); 531 void setPageScaleFactorAndLocation(float, const FloatPoint&);
531 void propagateZoomFactorToLocalFrameRoots(Frame*, float); 532 void propagateZoomFactorToLocalFrameRoots(Frame*, float);
532 533
534 // Override the page scale and scroll positions of main frame and visual vie wport.
535 void setScrollAndScaleOverride(const WebDeviceEmulationParams&);
536
537 // Clear the page scale and scroll position overrides.
538 void clearScrollAndScaleOverride();
539
533 void scrollAndRescaleViewports(float scaleFactor, const IntPoint& mainFrameO rigin, const FloatPoint& visualViewportOrigin); 540 void scrollAndRescaleViewports(float scaleFactor, const IntPoint& mainFrameO rigin, const FloatPoint& visualViewportOrigin);
534 541
535 float maximumLegiblePageScale() const; 542 float maximumLegiblePageScale() const;
536 void refreshPageScaleFactorAfterLayout(); 543 void refreshPageScaleFactorAfterLayout();
537 IntSize contentsSize() const; 544 IntSize contentsSize() const;
538 545
539 void performResize(); 546 void performResize();
540 void resizeViewWhileAnchored(FrameView*, float topControlsHeight, bool topCo ntrolsShrinkLayout); 547 void resizeViewWhileAnchored(FrameView*, float topControlsHeight, bool topCo ntrolsShrinkLayout);
541 548
542 // Overrides the compositor visibility. See the description of 549 // Overrides the compositor visibility. See the description of
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 float m_doubleTapZoomPageScaleFactor; 675 float m_doubleTapZoomPageScaleFactor;
669 // Have we sent a double-tap zoom and not yet heard back the scale? 676 // Have we sent a double-tap zoom and not yet heard back the scale?
670 bool m_doubleTapZoomPending; 677 bool m_doubleTapZoomPending;
671 678
672 // Used for testing purposes. 679 // Used for testing purposes.
673 bool m_enableFakePageScaleAnimationForTesting; 680 bool m_enableFakePageScaleAnimationForTesting;
674 IntPoint m_fakePageScaleAnimationTargetPosition; 681 IntPoint m_fakePageScaleAnimationTargetPosition;
675 float m_fakePageScaleAnimationPageScaleFactor; 682 float m_fakePageScaleAnimationPageScaleFactor;
676 bool m_fakePageScaleAnimationUseAnchor; 683 bool m_fakePageScaleAnimationUseAnchor;
677 684
685 RefPtr<ScrollAndScaleEmulator> m_scrollAndScaleEmulator;
bokan 2016/07/04 22:44:09 I think this should move to FrameHost (see reply t
Eric Seckler 2016/07/05 16:46:51 Done.
686
678 bool m_doingDragAndDrop; 687 bool m_doingDragAndDrop;
679 688
680 bool m_ignoreInputEvents; 689 bool m_ignoreInputEvents;
681 690
682 float m_compositorDeviceScaleFactorOverride; 691 float m_compositorDeviceScaleFactorOverride;
683 WebSize m_rootLayerOffset; 692 WebSize m_rootLayerOffset;
684 float m_rootLayerScale; 693 float m_rootLayerScale;
685 694
686 // Webkit expects keyPress events to be suppressed if the associated keyDown 695 // Webkit expects keyPress events to be suppressed if the associated keyDown
687 // event was handled. Safari implements this behavior by peeking out the 696 // event was handled. Safari implements this behavior by peeking out the
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 bool m_overrideCompositorVisibility; 779 bool m_overrideCompositorVisibility;
771 }; 780 };
772 781
773 // We have no ways to check if the specified WebView is an instance of 782 // We have no ways to check if the specified WebView is an instance of
774 // WebViewImpl because WebViewImpl is the only implementation of WebView. 783 // WebViewImpl because WebViewImpl is the only implementation of WebView.
775 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); 784 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true);
776 785
777 } // namespace blink 786 } // namespace blink
778 787
779 #endif 788 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698