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

Side by Side 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, 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 void initializeScrollbars(); 96 void initializeScrollbars();
97 97
98 // Sets the location of the visual viewport relative to the outer viewport. The 98 // Sets the location of the visual viewport relative to the outer viewport. The
99 // coordinates are in partial CSS pixels. 99 // coordinates are in partial CSS pixels.
100 void setLocation(const FloatPoint&); 100 void setLocation(const FloatPoint&);
101 // FIXME: This should be called moveBy 101 // FIXME: This should be called moveBy
102 void move(const FloatPoint&); 102 void move(const FloatPoint&);
103 void move(const FloatSize&); 103 void move(const FloatSize&);
104 FloatPoint location() const { return m_offset; } 104 FloatPoint location() const { return m_offset; }
105 105
106 // Override the visual viewport location and scale with a fixed value.
107 void setScaleAndScrollOverride(float scale, const FloatPoint& location);
108 // Clear the scroll position override.
109 void clearScaleAndScrollOverride();
110
106 // Sets the size of the inner viewport when unscaled in CSS pixels. 111 // Sets the size of the inner viewport when unscaled in CSS pixels.
107 void setSize(const IntSize&); 112 void setSize(const IntSize&);
108 IntSize size() const { return m_size; } 113 IntSize size() const { return m_size; }
109 114
110 // Gets the scaled size, i.e. the viewport in root view space. 115 // Gets the scaled size, i.e. the viewport in root view space.
111 FloatSize visibleSize() const; 116 FloatSize visibleSize() const;
112 117
113 // Resets the viewport to initial state. 118 // Resets the viewport to initial state.
114 void reset(); 119 void reset();
115 120
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 237
233 // GraphicsLayerClient implementation. 238 // GraphicsLayerClient implementation.
234 bool needsRepaint(const GraphicsLayer&) const { ASSERT_NOT_REACHED(); return true; } 239 bool needsRepaint(const GraphicsLayer&) const { ASSERT_NOT_REACHED(); return true; }
235 IntRect computeInterestRect(const GraphicsLayer*, const IntRect&) const; 240 IntRect computeInterestRect(const GraphicsLayer*, const IntRect&) const;
236 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPain tingPhase, const IntRect&) const override; 241 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPain tingPhase, const IntRect&) const override;
237 String debugName(const GraphicsLayer*) const override; 242 String debugName(const GraphicsLayer*) const override;
238 243
239 void setupScrollbar(WebScrollbar::Orientation); 244 void setupScrollbar(WebScrollbar::Orientation);
240 FloatPoint clampOffsetToBoundaries(const FloatPoint&); 245 FloatPoint clampOffsetToBoundaries(const FloatPoint&);
241 246
247 FloatPoint applyScrollOverrideToLocation(const FloatPoint& location);
248 float applyScaleOverrideToScale(float scale);
249
242 LocalFrame* mainFrame() const; 250 LocalFrame* mainFrame() const;
243 251
244 FrameHost& frameHost() const 252 FrameHost& frameHost() const
245 { 253 {
246 ASSERT(m_frameHost); 254 ASSERT(m_frameHost);
247 return *m_frameHost; 255 return *m_frameHost;
248 } 256 }
249 257
250 Member<FrameHost> m_frameHost; 258 Member<FrameHost> m_frameHost;
251 OwnPtr<GraphicsLayer> m_rootTransformLayer; 259 OwnPtr<GraphicsLayer> m_rootTransformLayer;
252 OwnPtr<GraphicsLayer> m_innerViewportContainerLayer; 260 OwnPtr<GraphicsLayer> m_innerViewportContainerLayer;
253 OwnPtr<GraphicsLayer> m_overscrollElasticityLayer; 261 OwnPtr<GraphicsLayer> m_overscrollElasticityLayer;
254 OwnPtr<GraphicsLayer> m_pageScaleLayer; 262 OwnPtr<GraphicsLayer> m_pageScaleLayer;
255 OwnPtr<GraphicsLayer> m_innerViewportScrollLayer; 263 OwnPtr<GraphicsLayer> m_innerViewportScrollLayer;
256 OwnPtr<GraphicsLayer> m_overlayScrollbarHorizontal; 264 OwnPtr<GraphicsLayer> m_overlayScrollbarHorizontal;
257 OwnPtr<GraphicsLayer> m_overlayScrollbarVertical; 265 OwnPtr<GraphicsLayer> m_overlayScrollbarVertical;
258 OwnPtr<WebScrollbarLayer> m_webOverlayScrollbarHorizontal; 266 OwnPtr<WebScrollbarLayer> m_webOverlayScrollbarHorizontal;
259 OwnPtr<WebScrollbarLayer> m_webOverlayScrollbarVertical; 267 OwnPtr<WebScrollbarLayer> m_webOverlayScrollbarVertical;
260 268
261 // Offset of the visual viewport from the main frame's origin, in CSS pixels . 269 // Offset of the visual viewport from the main frame's origin, in CSS pixels .
262 FloatPoint m_offset; 270 FloatPoint m_offset;
263 float m_scale; 271 float m_scale;
264 IntSize m_size; 272 IntSize m_size;
265 float m_topControlsAdjustment; 273 float m_topControlsAdjustment;
266 float m_maxPageScale; 274 float m_maxPageScale;
267 bool m_trackPinchZoomStatsForPage; 275 bool m_trackPinchZoomStatsForPage;
276
277 bool m_scaleAndScrollOverrideEnabled;
278 float m_scaleAndScrollOverrideScale;
279 FloatPoint m_scaleAndScrollOverrideLocation;
268 }; 280 };
269 281
270 } // namespace blink 282 } // namespace blink
271 283
272 #endif // VisualViewport_h 284 #endif // VisualViewport_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698