| 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 "core/page/Page.h" | 8 #include "core/page/Page.h" |
| 9 #include "platform/geometry/DoubleSize.h" |
| 9 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| 10 | 11 |
| 11 namespace blink { | 12 namespace blink { |
| 12 | 13 |
| 13 class FrameView; | 14 class FrameView; |
| 14 | 15 |
| 15 // This class scrolls the viewports to compensate for bounds clamping caused by | 16 // This class scrolls the viewports to compensate for bounds clamping caused by |
| 16 // viewport size changes. | 17 // viewport size changes. |
| 17 // | 18 // |
| 18 // It is needed when the layout viewport grows (causing its own scroll position | 19 // It is needed when the layout viewport grows (causing its own scroll position |
| 19 // to be clamped) and also when it shrinks (causing the visual viewport's scroll | 20 // to be clamped) and also when it shrinks (causing the visual viewport's scroll |
| 20 // position to be clamped). | 21 // position to be clamped). |
| 21 class ResizeViewportAnchor : public GarbageCollectedFinalized<ResizeViewportAnch
or> { | 22 class ResizeViewportAnchor final : public GarbageCollected<ResizeViewportAnchor>
{ |
| 22 WTF_MAKE_NONCOPYABLE(ResizeViewportAnchor); | 23 WTF_MAKE_NONCOPYABLE(ResizeViewportAnchor); |
| 23 public: | 24 public: |
| 24 ResizeViewportAnchor(Page& page) | 25 ResizeViewportAnchor(Page& page) |
| 25 : m_page(page) | 26 : m_page(page) |
| 26 , m_scopeCount(0) | 27 , m_scopeCount(0) |
| 27 { | 28 { |
| 28 } | 29 } |
| 29 | 30 |
| 30 class ResizeScope { | 31 class ResizeScope { |
| 31 STACK_ALLOCATED(); | 32 STACK_ALLOCATED(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 59 // ResizeScope. Note that this should NOT include other kinds of scrolling | 60 // ResizeScope. Note that this should NOT include other kinds of scrolling |
| 60 // that may occur during layout, such as from ScrollAnchor. | 61 // that may occur during layout, such as from ScrollAnchor. |
| 61 DoubleSize m_drift; | 62 DoubleSize m_drift; |
| 62 Member<Page> m_page; | 63 Member<Page> m_page; |
| 63 int m_scopeCount; | 64 int m_scopeCount; |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 } // namespace blink | 67 } // namespace blink |
| 67 | 68 |
| 68 #endif // ResizeViewportAnchor_h | 69 #endif // ResizeViewportAnchor_h |
| OLD | NEW |