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

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: Add C++ tests, clamp visual viewport position. 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;
81 class TopControls; 82 class TopControls;
82 class UserGestureToken; 83 class UserGestureToken;
83 class WebActiveGestureAnimation; 84 class WebActiveGestureAnimation;
84 class WebDevToolsAgentImpl; 85 class WebDevToolsAgentImpl;
85 class WebElement; 86 class WebElement;
86 class WebLayerTreeView; 87 class WebLayerTreeView;
87 class WebLocalFrame; 88 class WebLocalFrame;
88 class WebLocalFrameImpl; 89 class WebLocalFrameImpl;
89 class WebImage; 90 class WebImage;
90 class CompositorMutatorImpl;
91 class WebPagePopupImpl; 91 class WebPagePopupImpl;
92 class WebPlugin; 92 class WebPlugin;
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)
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 double lastFrameTimeMonotonic() const { return m_lastFrameTimeMonotonic; } 520 double lastFrameTimeMonotonic() const { return m_lastFrameTimeMonotonic; }
521 521
522 ChromeClientImpl& chromeClient() const { return *m_chromeClientImpl.get(); } 522 ChromeClientImpl& chromeClient() const { return *m_chromeClientImpl.get(); }
523 523
524 private: 524 private:
525 InspectorOverlay* inspectorOverlay(); 525 InspectorOverlay* inspectorOverlay();
526 526
527 void setPageScaleFactorAndLocation(float, const FloatPoint&); 527 void setPageScaleFactorAndLocation(float, const FloatPoint&);
528 void propagateZoomFactorToLocalFrameRoots(Frame*, float); 528 void propagateZoomFactorToLocalFrameRoots(Frame*, float);
529 529
530 // Override the page scale and scroll positions of main frame and visual vie wport.
531 void setScrollAndScaleOverride(const WebDeviceEmulationParams&);
532 void clearScrollAndScaleOverride();
533
530 void scrollAndRescaleViewports(float scaleFactor, const IntPoint& mainFrameO rigin, const FloatPoint& visualViewportOrigin); 534 void scrollAndRescaleViewports(float scaleFactor, const IntPoint& mainFrameO rigin, const FloatPoint& visualViewportOrigin);
531 535
532 float maximumLegiblePageScale() const; 536 float maximumLegiblePageScale() const;
533 void refreshPageScaleFactorAfterLayout(); 537 void refreshPageScaleFactorAfterLayout();
534 IntSize contentsSize() const; 538 IntSize contentsSize() const;
535 539
536 void performResize(); 540 void performResize();
537 void resizeViewWhileAnchored(FrameView*, float topControlsHeight, bool topCo ntrolsShrinkLayout); 541 void resizeViewWhileAnchored(FrameView*, float topControlsHeight, bool topCo ntrolsShrinkLayout);
538 542
539 // Overrides the compositor visibility. See the description of 543 // Overrides the compositor visibility. See the description of
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 bool m_overrideCompositorVisibility; 775 bool m_overrideCompositorVisibility;
772 }; 776 };
773 777
774 // We have no ways to check if the specified WebView is an instance of 778 // We have no ways to check if the specified WebView is an instance of
775 // WebViewImpl because WebViewImpl is the only implementation of WebView. 779 // WebViewImpl because WebViewImpl is the only implementation of WebView.
776 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); 780 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true);
777 781
778 } // namespace blink 782 } // namespace blink
779 783
780 #endif 784 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698