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 #include "core/frame/RootFrameViewport.h" | 5 #include "core/frame/RootFrameViewport.h" |
6 | 6 |
7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
8 #include "core/layout/ScrollAlignment.h" | 8 #include "core/layout/ScrollAlignment.h" |
9 #include "platform/geometry/DoubleRect.h" | 9 #include "platform/geometry/DoubleRect.h" |
10 #include "platform/geometry/FloatRect.h" | 10 #include "platform/geometry/FloatRect.h" |
11 #include "platform/geometry/LayoutRect.h" | 11 #include "platform/geometry/LayoutRect.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 RootFrameViewport::RootFrameViewport(ScrollableArea& visualViewport, ScrollableA
rea& layoutViewport) | 15 RootFrameViewport::RootFrameViewport(ScrollableArea& visualViewport, ScrollableA
rea& layoutViewport) |
16 : m_visualViewport(visualViewport) | 16 : m_visualViewport(visualViewport) |
17 , m_layoutViewport(layoutViewport) | 17 , m_layoutViewport(layoutViewport) |
18 { | 18 { |
19 } | 19 } |
20 | 20 |
| 21 void RootFrameViewport::setLayoutViewport(ScrollableArea& newLayoutViewport) |
| 22 { |
| 23 m_layoutViewport = &newLayoutViewport; |
| 24 } |
| 25 |
21 void RootFrameViewport::updateScrollAnimator() | 26 void RootFrameViewport::updateScrollAnimator() |
22 { | 27 { |
23 scrollAnimator().setCurrentPosition(toFloatPoint(scrollOffsetFromScrollAnima
tors())); | 28 scrollAnimator().setCurrentPosition(toFloatPoint(scrollOffsetFromScrollAnima
tors())); |
24 } | 29 } |
25 | 30 |
26 DoublePoint RootFrameViewport::scrollOffsetFromScrollAnimators() const | 31 DoublePoint RootFrameViewport::scrollOffsetFromScrollAnimators() const |
27 { | 32 { |
28 return visualViewport().scrollAnimator().currentPosition() + layoutViewport(
).scrollAnimator().currentPosition(); | 33 return visualViewport().scrollAnimator().currentPosition() + layoutViewport(
).scrollAnimator().currentPosition(); |
29 } | 34 } |
30 | 35 |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 } | 347 } |
343 | 348 |
344 DEFINE_TRACE(RootFrameViewport) | 349 DEFINE_TRACE(RootFrameViewport) |
345 { | 350 { |
346 visitor->trace(m_visualViewport); | 351 visitor->trace(m_visualViewport); |
347 visitor->trace(m_layoutViewport); | 352 visitor->trace(m_layoutViewport); |
348 ScrollableArea::trace(visitor); | 353 ScrollableArea::trace(visitor); |
349 } | 354 } |
350 | 355 |
351 } // namespace blink | 356 } // namespace blink |
OLD | NEW |