| 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 RootFrameViewport_h | 5 #ifndef RootFrameViewport_h |
| 6 #define RootFrameViewport_h | 6 #define RootFrameViewport_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "platform/scroll/ScrollableArea.h" | 9 #include "platform/scroll/ScrollableArea.h" |
| 10 | 10 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 enum ViewportToScrollFirst { VisualViewport, LayoutViewport }; | 109 enum ViewportToScrollFirst { VisualViewport, LayoutViewport }; |
| 110 | 110 |
| 111 DoublePoint scrollOffsetFromScrollAnimators() const; | 111 DoublePoint scrollOffsetFromScrollAnimators() const; |
| 112 | 112 |
| 113 void distributeScrollBetweenViewports(const DoublePoint&, | 113 void distributeScrollBetweenViewports(const DoublePoint&, |
| 114 ScrollType, | 114 ScrollType, |
| 115 ScrollBehavior, | 115 ScrollBehavior, |
| 116 ViewportToScrollFirst); | 116 ViewportToScrollFirst); |
| 117 | 117 |
| 118 // If either of the layout or visual viewports are scrolled explicitly (i.e. n
ot | 118 // If either of the layout or visual viewports are scrolled explicitly (i.e. |
| 119 // through this class), their updated offset will not be reflected in this cla
ss' | 119 // not through this class), their updated offset will not be reflected in this |
| 120 // animator so use this method to pull updated values when necessary. | 120 // class' animator so use this method to pull updated values when necessary. |
| 121 void updateScrollAnimator(); | 121 void updateScrollAnimator(); |
| 122 | 122 |
| 123 ScrollableArea& visualViewport() const { | 123 ScrollableArea& visualViewport() const { |
| 124 ASSERT(m_visualViewport); | 124 ASSERT(m_visualViewport); |
| 125 return *m_visualViewport; | 125 return *m_visualViewport; |
| 126 } | 126 } |
| 127 | 127 |
| 128 Member<ScrollableArea> m_visualViewport; | 128 Member<ScrollableArea> m_visualViewport; |
| 129 Member<ScrollableArea> m_layoutViewport; | 129 Member<ScrollableArea> m_layoutViewport; |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 DEFINE_TYPE_CASTS(RootFrameViewport, | 132 DEFINE_TYPE_CASTS(RootFrameViewport, |
| 133 ScrollableArea, | 133 ScrollableArea, |
| 134 scrollableArea, | 134 scrollableArea, |
| 135 scrollableArea->isRootFrameViewport(), | 135 scrollableArea->isRootFrameViewport(), |
| 136 scrollableArea.isRootFrameViewport()); | 136 scrollableArea.isRootFrameViewport()); |
| 137 | 137 |
| 138 } // namespace blink | 138 } // namespace blink |
| 139 | 139 |
| 140 #endif // RootFrameViewport_h | 140 #endif // RootFrameViewport_h |
| OLD | NEW |