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

Unified Diff: third_party/WebKit/Source/core/frame/VisualViewport.h

Issue 2096633002: Adds scroll position/scale emulation to DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/VisualViewport.h
diff --git a/third_party/WebKit/Source/core/frame/VisualViewport.h b/third_party/WebKit/Source/core/frame/VisualViewport.h
index d15d2345bc75053aadaea36228c1a0fb9e6614e1..d700b8dc485065685d182acc838d542e68b33fc1 100644
--- a/third_party/WebKit/Source/core/frame/VisualViewport.h
+++ b/third_party/WebKit/Source/core/frame/VisualViewport.h
@@ -103,6 +103,11 @@ public:
void move(const FloatSize&);
FloatPoint location() const { return m_offset; }
+ // Override the visual viewport location and scale with a fixed value.
+ void setScaleAndScrollOverride(float scale, const FloatPoint& location);
+ // Clear the scroll position override.
+ void clearScaleAndScrollOverride();
+
// Sets the size of the inner viewport when unscaled in CSS pixels.
void setSize(const IntSize&);
IntSize size() const { return m_size; }
@@ -239,6 +244,9 @@ private:
void setupScrollbar(WebScrollbar::Orientation);
FloatPoint clampOffsetToBoundaries(const FloatPoint&);
+ FloatPoint applyScrollOverrideToLocation(const FloatPoint& location);
+ float applyScaleOverrideToScale(float scale);
+
LocalFrame* mainFrame() const;
FrameHost& frameHost() const
@@ -265,6 +273,10 @@ private:
float m_topControlsAdjustment;
float m_maxPageScale;
bool m_trackPinchZoomStatsForPage;
+
+ bool m_scaleAndScrollOverrideEnabled;
+ float m_scaleAndScrollOverrideScale;
+ FloatPoint m_scaleAndScrollOverrideLocation;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698