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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 class GraphicsLayerFactory; | 55 class GraphicsLayerFactory; |
56 class IntRect; | 56 class IntRect; |
57 class IntSize; | 57 class IntSize; |
58 class LocalFrame; | 58 class LocalFrame; |
59 | 59 |
60 // Represents the pinch-to-zoom viewport the user is currently seeing the page t
hrough. This | 60 // Represents the pinch-to-zoom viewport the user is currently seeing the page t
hrough. This |
61 // class corresponds to the InnerViewport on the compositor. It is a ScrollableA
rea; it's | 61 // class corresponds to the InnerViewport on the compositor. It is a ScrollableA
rea; it's |
62 // offset is set through the GraphicsLayer <-> CC sync mechanisms. Its contents
is the page's | 62 // offset is set through the GraphicsLayer <-> CC sync mechanisms. Its contents
is the page's |
63 // main FrameView, which corresponds to the outer viewport. The inner viewport i
s always contained | 63 // main FrameView, which corresponds to the outer viewport. The inner viewport i
s always contained |
64 // in the outer viewport and can pan within it. | 64 // in the outer viewport and can pan within it. |
65 class CORE_EXPORT PinchViewport final : public GraphicsLayerClient, public Scrol
lableArea { | 65 class CORE_EXPORT PinchViewport final : public NoBaseWillBeGarbageCollectedFinal
ized<PinchViewport>, public GraphicsLayerClient, public ScrollableArea { |
| 66 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PinchViewport); |
66 public: | 67 public: |
67 static PassOwnPtr<PinchViewport> create(FrameHost& host) | 68 static PassOwnPtrWillBeRawPtr<PinchViewport> create(FrameHost& host) |
68 { | 69 { |
69 return adoptPtr(new PinchViewport(host)); | 70 return adoptPtrWillBeNoop(new PinchViewport(host)); |
70 } | 71 } |
71 virtual ~PinchViewport(); | 72 virtual ~PinchViewport(); |
72 | 73 |
| 74 DECLARE_VIRTUAL_TRACE(); |
| 75 |
73 void attachToLayerTree(GraphicsLayer*, GraphicsLayerFactory*); | 76 void attachToLayerTree(GraphicsLayer*, GraphicsLayerFactory*); |
74 GraphicsLayer* rootGraphicsLayer() | 77 GraphicsLayer* rootGraphicsLayer() |
75 { | 78 { |
76 return m_rootTransformLayer.get(); | 79 return m_rootTransformLayer.get(); |
77 } | 80 } |
78 GraphicsLayer* containerLayer() | 81 GraphicsLayer* containerLayer() |
79 { | 82 { |
80 return m_innerViewportContainerLayer.get(); | 83 return m_innerViewportContainerLayer.get(); |
81 } | 84 } |
82 GraphicsLayer* scrollLayer() | 85 GraphicsLayer* scrollLayer() |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase, const IntRect& inClip) override; | 199 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase, const IntRect& inClip) override; |
197 virtual String debugName(const GraphicsLayer*) override; | 200 virtual String debugName(const GraphicsLayer*) override; |
198 | 201 |
199 void setupScrollbar(WebScrollbar::Orientation); | 202 void setupScrollbar(WebScrollbar::Orientation); |
200 FloatPoint clampOffsetToBoundaries(const FloatPoint&); | 203 FloatPoint clampOffsetToBoundaries(const FloatPoint&); |
201 | 204 |
202 LocalFrame* mainFrame() const; | 205 LocalFrame* mainFrame() const; |
203 | 206 |
204 FrameHost& frameHost() const | 207 FrameHost& frameHost() const |
205 { | 208 { |
206 return m_frameHost; | 209 ASSERT(m_frameHost); |
| 210 return *m_frameHost; |
207 } | 211 } |
208 | 212 |
209 // TODO(Oilpan): this back reference is safe, but not ideal. | 213 RawPtrWillBeMember<FrameHost> m_frameHost; |
210 // Turning it into a traced Member<> would require moving | |
211 // ScrollableArea to the heap. | |
212 FrameHost& m_frameHost; | |
213 OwnPtr<GraphicsLayer> m_rootTransformLayer; | 214 OwnPtr<GraphicsLayer> m_rootTransformLayer; |
214 OwnPtr<GraphicsLayer> m_innerViewportContainerLayer; | 215 OwnPtr<GraphicsLayer> m_innerViewportContainerLayer; |
215 OwnPtr<GraphicsLayer> m_overscrollElasticityLayer; | 216 OwnPtr<GraphicsLayer> m_overscrollElasticityLayer; |
216 OwnPtr<GraphicsLayer> m_pageScaleLayer; | 217 OwnPtr<GraphicsLayer> m_pageScaleLayer; |
217 OwnPtr<GraphicsLayer> m_innerViewportScrollLayer; | 218 OwnPtr<GraphicsLayer> m_innerViewportScrollLayer; |
218 OwnPtr<GraphicsLayer> m_overlayScrollbarHorizontal; | 219 OwnPtr<GraphicsLayer> m_overlayScrollbarHorizontal; |
219 OwnPtr<GraphicsLayer> m_overlayScrollbarVertical; | 220 OwnPtr<GraphicsLayer> m_overlayScrollbarVertical; |
220 OwnPtr<WebScrollbarLayer> m_webOverlayScrollbarHorizontal; | 221 OwnPtr<WebScrollbarLayer> m_webOverlayScrollbarHorizontal; |
221 OwnPtr<WebScrollbarLayer> m_webOverlayScrollbarVertical; | 222 OwnPtr<WebScrollbarLayer> m_webOverlayScrollbarVertical; |
222 | 223 |
223 // Offset of the pinch viewport from the main frame's origin, in CSS pixels. | 224 // Offset of the pinch viewport from the main frame's origin, in CSS pixels. |
224 FloatPoint m_offset; | 225 FloatPoint m_offset; |
225 float m_scale; | 226 float m_scale; |
226 IntSize m_size; | 227 IntSize m_size; |
227 float m_topControlsAdjustment; | 228 float m_topControlsAdjustment; |
228 }; | 229 }; |
229 | 230 |
230 } // namespace blink | 231 } // namespace blink |
231 | 232 |
232 #endif // PinchViewport_h | 233 #endif // PinchViewport_h |
OLD | NEW |