OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ResizeViewportAnchor_h | 5 #ifndef ResizeViewportAnchor_h |
6 #define ResizeViewportAnchor_h | 6 #define ResizeViewportAnchor_h |
7 | 7 |
8 #include "platform/geometry/FloatPoint.h" | 8 #include "platform/geometry/FloatPoint.h" |
9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
10 #include "web/ViewportAnchor.h" | 10 #include "web/ViewportAnchor.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class FrameView; | 14 class FrameView; |
15 class PinchViewport; | 15 class PinchViewport; |
16 | 16 |
17 // The resize anchor saves the current scroll offset of the visual viewport and | 17 // The resize anchor saves the current scroll offset of the visual viewport and |
18 // restores to that scroll offset so that document location appears exactly | 18 // restores to that scroll offset so that document location appears exactly |
19 // unchanged to the user. | 19 // unchanged to the user. |
20 class ResizeViewportAnchor : public ViewportAnchor { | 20 class ResizeViewportAnchor : public ViewportAnchor { |
| 21 STACK_ALLOCATED(); |
21 public: | 22 public: |
22 ResizeViewportAnchor(FrameView& rootFrameView, PinchViewport&); | 23 ResizeViewportAnchor(FrameView& rootFrameView, PinchViewport&); |
23 virtual ~ResizeViewportAnchor() { } | 24 ~ResizeViewportAnchor(); |
24 | |
25 virtual void setAnchor(); | |
26 virtual void restoreToAnchor(); | |
27 | 25 |
28 private: | 26 private: |
29 // Inner viewport origin in the reference frame of the root document, in CSS | 27 // Inner viewport origin in the reference frame of the root document, in CSS |
30 // pixels. | 28 // pixels. |
31 FloatPoint m_pinchViewportInDocument; | 29 FloatPoint m_pinchViewportInDocument; |
32 }; | 30 }; |
33 | 31 |
34 } // namespace blink | 32 } // namespace blink |
35 | 33 |
36 #endif | 34 #endif // ResizeViewportAnchor_h |
OLD | NEW |