| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 class GraphicsLayer; | 54 class GraphicsLayer; |
| 55 class IntRect; | 55 class IntRect; |
| 56 class IntSize; | 56 class IntSize; |
| 57 class LocalFrame; | 57 class LocalFrame; |
| 58 | 58 |
| 59 // Represents the visual viewport the user is currently seeing the page through.
This | 59 // Represents the visual viewport the user is currently seeing the page through.
This |
| 60 // class corresponds to the InnerViewport on the compositor. It is a ScrollableA
rea; it's | 60 // class corresponds to the InnerViewport on the compositor. It is a ScrollableA
rea; it's |
| 61 // offset is set through the GraphicsLayer <-> CC sync mechanisms. Its contents
is the page's | 61 // offset is set through the GraphicsLayer <-> CC sync mechanisms. Its contents
is the page's |
| 62 // main FrameView, which corresponds to the outer viewport. The inner viewport i
s always contained | 62 // main FrameView, which corresponds to the outer viewport. The inner viewport i
s always contained |
| 63 // in the outer viewport and can pan within it. | 63 // in the outer viewport and can pan within it. |
| 64 class CORE_EXPORT VisualViewport final : public NoBaseWillBeGarbageCollectedFina
lized<VisualViewport>, public GraphicsLayerClient, public ScrollableArea { | 64 class CORE_EXPORT VisualViewport final : public GarbageCollectedFinalized<Visual
Viewport>, public GraphicsLayerClient, public ScrollableArea { |
| 65 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(VisualViewport); | 65 USING_GARBAGE_COLLECTED_MIXIN(VisualViewport); |
| 66 public: | 66 public: |
| 67 static PassOwnPtrWillBeRawPtr<VisualViewport> create(FrameHost& host) | 67 static RawPtr<VisualViewport> create(FrameHost& host) |
| 68 { | 68 { |
| 69 return adoptPtrWillBeNoop(new VisualViewport(host)); | 69 return new VisualViewport(host); |
| 70 } | 70 } |
| 71 ~VisualViewport() override; | 71 ~VisualViewport() override; |
| 72 | 72 |
| 73 DECLARE_VIRTUAL_TRACE(); | 73 DECLARE_VIRTUAL_TRACE(); |
| 74 | 74 |
| 75 void attachToLayerTree(GraphicsLayer*); | 75 void attachToLayerTree(GraphicsLayer*); |
| 76 | 76 |
| 77 GraphicsLayer* rootGraphicsLayer() | 77 GraphicsLayer* rootGraphicsLayer() |
| 78 { | 78 { |
| 79 return m_rootTransformLayer.get(); | 79 return m_rootTransformLayer.get(); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 FloatPoint clampOffsetToBoundaries(const FloatPoint&); | 221 FloatPoint clampOffsetToBoundaries(const FloatPoint&); |
| 222 | 222 |
| 223 LocalFrame* mainFrame() const; | 223 LocalFrame* mainFrame() const; |
| 224 | 224 |
| 225 FrameHost& frameHost() const | 225 FrameHost& frameHost() const |
| 226 { | 226 { |
| 227 ASSERT(m_frameHost); | 227 ASSERT(m_frameHost); |
| 228 return *m_frameHost; | 228 return *m_frameHost; |
| 229 } | 229 } |
| 230 | 230 |
| 231 RawPtrWillBeMember<FrameHost> m_frameHost; | 231 Member<FrameHost> m_frameHost; |
| 232 OwnPtr<GraphicsLayer> m_rootTransformLayer; | 232 OwnPtr<GraphicsLayer> m_rootTransformLayer; |
| 233 OwnPtr<GraphicsLayer> m_innerViewportContainerLayer; | 233 OwnPtr<GraphicsLayer> m_innerViewportContainerLayer; |
| 234 OwnPtr<GraphicsLayer> m_overscrollElasticityLayer; | 234 OwnPtr<GraphicsLayer> m_overscrollElasticityLayer; |
| 235 OwnPtr<GraphicsLayer> m_pageScaleLayer; | 235 OwnPtr<GraphicsLayer> m_pageScaleLayer; |
| 236 OwnPtr<GraphicsLayer> m_innerViewportScrollLayer; | 236 OwnPtr<GraphicsLayer> m_innerViewportScrollLayer; |
| 237 OwnPtr<GraphicsLayer> m_overlayScrollbarHorizontal; | 237 OwnPtr<GraphicsLayer> m_overlayScrollbarHorizontal; |
| 238 OwnPtr<GraphicsLayer> m_overlayScrollbarVertical; | 238 OwnPtr<GraphicsLayer> m_overlayScrollbarVertical; |
| 239 OwnPtr<WebScrollbarLayer> m_webOverlayScrollbarHorizontal; | 239 OwnPtr<WebScrollbarLayer> m_webOverlayScrollbarHorizontal; |
| 240 OwnPtr<WebScrollbarLayer> m_webOverlayScrollbarVertical; | 240 OwnPtr<WebScrollbarLayer> m_webOverlayScrollbarVertical; |
| 241 | 241 |
| 242 // Offset of the visual viewport from the main frame's origin, in CSS pixels
. | 242 // Offset of the visual viewport from the main frame's origin, in CSS pixels
. |
| 243 FloatPoint m_offset; | 243 FloatPoint m_offset; |
| 244 float m_scale; | 244 float m_scale; |
| 245 IntSize m_size; | 245 IntSize m_size; |
| 246 float m_topControlsAdjustment; | 246 float m_topControlsAdjustment; |
| 247 float m_maxPageScale; | 247 float m_maxPageScale; |
| 248 bool m_trackPinchZoomStatsForPage; | 248 bool m_trackPinchZoomStatsForPage; |
| 249 }; | 249 }; |
| 250 | 250 |
| 251 } // namespace blink | 251 } // namespace blink |
| 252 | 252 |
| 253 #endif // VisualViewport_h | 253 #endif // VisualViewport_h |
| OLD | NEW |