| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 ScrollType, | 117 ScrollType, |
| 118 ScrollBehavior, | 118 ScrollBehavior, |
| 119 ViewportToScrollFirst); | 119 ViewportToScrollFirst); |
| 120 | 120 |
| 121 // If either of the layout or visual viewports are scrolled explicitly (i.e. | 121 // If either of the layout or visual viewports are scrolled explicitly (i.e. |
| 122 // not through this class), their updated offset will not be reflected in this | 122 // not through this class), their updated offset will not be reflected in this |
| 123 // class' animator so use this method to pull updated values when necessary. | 123 // class' animator so use this method to pull updated values when necessary. |
| 124 void UpdateScrollAnimator(); | 124 void UpdateScrollAnimator(); |
| 125 | 125 |
| 126 ScrollableArea& VisualViewport() const { | 126 ScrollableArea& VisualViewport() const { |
| 127 ASSERT(visual_viewport_); | 127 DCHECK(visual_viewport_); |
| 128 return *visual_viewport_; | 128 return *visual_viewport_; |
| 129 } | 129 } |
| 130 | 130 |
| 131 Member<ScrollableArea> visual_viewport_; | 131 Member<ScrollableArea> visual_viewport_; |
| 132 Member<ScrollableArea> layout_viewport_; | 132 Member<ScrollableArea> layout_viewport_; |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 DEFINE_TYPE_CASTS(RootFrameViewport, | 135 DEFINE_TYPE_CASTS(RootFrameViewport, |
| 136 ScrollableArea, | 136 ScrollableArea, |
| 137 scrollableArea, | 137 scrollableArea, |
| 138 scrollableArea->IsRootFrameViewport(), | 138 scrollableArea->IsRootFrameViewport(), |
| 139 scrollableArea.IsRootFrameViewport()); | 139 scrollableArea.IsRootFrameViewport()); |
| 140 | 140 |
| 141 } // namespace blink | 141 } // namespace blink |
| 142 | 142 |
| 143 #endif // RootFrameViewport_h | 143 #endif // RootFrameViewport_h |
| OLD | NEW |