OLD | NEW |
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // Sets scale and location in one operation, preventing intermediate clampin
g. | 116 // Sets scale and location in one operation, preventing intermediate clampin
g. |
117 void setScaleAndLocation(float scale, const FloatPoint& location); | 117 void setScaleAndLocation(float scale, const FloatPoint& location); |
118 void setScale(float); | 118 void setScale(float); |
119 float scale() const { return m_scale; } | 119 float scale() const { return m_scale; } |
120 | 120 |
121 // Update scale factor, magnifying or minifying by magnifyDelta, centered ar
ound | 121 // Update scale factor, magnifying or minifying by magnifyDelta, centered ar
ound |
122 // the point specified by anchor in window coordinates. Returns false if pag
e | 122 // the point specified by anchor in window coordinates. Returns false if pag
e |
123 // scale factor is left unchanged. | 123 // scale factor is left unchanged. |
124 bool magnifyScaleAroundAnchor(float magnifyDelta, const FloatPoint& anchor); | 124 bool magnifyScaleAroundAnchor(float magnifyDelta, const FloatPoint& anchor); |
125 | 125 |
126 void registerLayersWithTreeView(blink::WebLayerTreeView*) const; | 126 void registerLayersWithTreeView(WebLayerTreeView*) const; |
127 void clearLayersForTreeView(blink::WebLayerTreeView*) const; | 127 void clearLayersForTreeView(WebLayerTreeView*) const; |
128 | 128 |
129 ScrollResult wheelEvent(const PlatformWheelEvent&); | 129 ScrollResult wheelEvent(const PlatformWheelEvent&); |
130 | 130 |
131 // The portion of the unzoomed frame visible in the inner "pinch" viewport, | 131 // The portion of the unzoomed frame visible in the inner "pinch" viewport, |
132 // in partial CSS pixels. Relative to the main frame. | 132 // in partial CSS pixels. Relative to the main frame. |
133 FloatRect visibleRect() const; | 133 FloatRect visibleRect() const; |
134 | 134 |
135 // The viewport rect relative to the document origin, in partial CSS pixels. | 135 // The viewport rect relative to the document origin, in partial CSS pixels. |
136 // FIXME: This should be a DoubleRect since scroll offsets are now doubles. | 136 // FIXME: This should be a DoubleRect since scroll offsets are now doubles. |
137 FloatRect visibleRectInDocument() const; | 137 FloatRect visibleRectInDocument() const; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 virtual GraphicsLayer* layerForHorizontalScrollbar() const override; | 201 virtual GraphicsLayer* layerForHorizontalScrollbar() const override; |
202 virtual GraphicsLayer* layerForVerticalScrollbar() const override; | 202 virtual GraphicsLayer* layerForVerticalScrollbar() const override; |
203 | 203 |
204 private: | 204 private: |
205 explicit PinchViewport(FrameHost&); | 205 explicit PinchViewport(FrameHost&); |
206 | 206 |
207 // GraphicsLayerClient implementation. | 207 // GraphicsLayerClient implementation. |
208 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase, const IntRect& inClip) override; | 208 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase, const IntRect& inClip) override; |
209 virtual String debugName(const GraphicsLayer*) override; | 209 virtual String debugName(const GraphicsLayer*) override; |
210 | 210 |
211 void setupScrollbar(blink::WebScrollbar::Orientation); | 211 void setupScrollbar(WebScrollbar::Orientation); |
212 FloatPoint clampOffsetToBoundaries(const FloatPoint&); | 212 FloatPoint clampOffsetToBoundaries(const FloatPoint&); |
213 | 213 |
214 LocalFrame* mainFrame() const; | 214 LocalFrame* mainFrame() const; |
215 | 215 |
216 FrameHost& frameHost() const | 216 FrameHost& frameHost() const |
217 { | 217 { |
218 ASSERT(m_frameHost); | 218 ASSERT(m_frameHost); |
219 return *m_frameHost; | 219 return *m_frameHost; |
220 } | 220 } |
221 | 221 |
222 RawPtrWillBeMember<FrameHost> m_frameHost; | 222 RawPtrWillBeMember<FrameHost> m_frameHost; |
223 OwnPtr<GraphicsLayer> m_rootTransformLayer; | 223 OwnPtr<GraphicsLayer> m_rootTransformLayer; |
224 OwnPtr<GraphicsLayer> m_innerViewportContainerLayer; | 224 OwnPtr<GraphicsLayer> m_innerViewportContainerLayer; |
225 OwnPtr<GraphicsLayer> m_overscrollElasticityLayer; | 225 OwnPtr<GraphicsLayer> m_overscrollElasticityLayer; |
226 OwnPtr<GraphicsLayer> m_pageScaleLayer; | 226 OwnPtr<GraphicsLayer> m_pageScaleLayer; |
227 OwnPtr<GraphicsLayer> m_innerViewportScrollLayer; | 227 OwnPtr<GraphicsLayer> m_innerViewportScrollLayer; |
228 OwnPtr<GraphicsLayer> m_overlayScrollbarHorizontal; | 228 OwnPtr<GraphicsLayer> m_overlayScrollbarHorizontal; |
229 OwnPtr<GraphicsLayer> m_overlayScrollbarVertical; | 229 OwnPtr<GraphicsLayer> m_overlayScrollbarVertical; |
230 OwnPtr<blink::WebScrollbarLayer> m_webOverlayScrollbarHorizontal; | 230 OwnPtr<WebScrollbarLayer> m_webOverlayScrollbarHorizontal; |
231 OwnPtr<blink::WebScrollbarLayer> m_webOverlayScrollbarVertical; | 231 OwnPtr<WebScrollbarLayer> m_webOverlayScrollbarVertical; |
232 | 232 |
233 // Offset of the pinch viewport from the main frame's origin, in CSS pixels. | 233 // Offset of the pinch viewport from the main frame's origin, in CSS pixels. |
234 FloatPoint m_offset; | 234 FloatPoint m_offset; |
235 float m_scale; | 235 float m_scale; |
236 IntSize m_size; | 236 IntSize m_size; |
237 float m_topControlsAdjustment; | 237 float m_topControlsAdjustment; |
238 }; | 238 }; |
239 | 239 |
240 } // namespace blink | 240 } // namespace blink |
241 | 241 |
242 #endif // PinchViewport_h | 242 #endif // PinchViewport_h |
OLD | NEW |