OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/layout/ScrollAlignment.h" | 7 #include "core/layout/ScrollAlignment.h" |
8 #include "platform/geometry/DoubleRect.h" | 8 #include "platform/geometry/DoubleRect.h" |
9 #include "platform/geometry/LayoutRect.h" | 9 #include "platform/geometry/LayoutRect.h" |
10 #include "platform/scroll/ScrollableArea.h" | 10 #include "platform/scroll/ScrollableArea.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 DEFINE_INLINE_VIRTUAL_TRACE() { ScrollableArea::trace(visitor); } | 72 DEFINE_INLINE_VIRTUAL_TRACE() { ScrollableArea::trace(visitor); } |
73 | 73 |
74 protected: | 74 protected: |
75 ScrollableAreaStub(const IntSize& viewportSize, const IntSize& contentsSize) | 75 ScrollableAreaStub(const IntSize& viewportSize, const IntSize& contentsSize) |
76 : m_userInputScrollableX(true), | 76 : m_userInputScrollableX(true), |
77 m_userInputScrollableY(true), | 77 m_userInputScrollableY(true), |
78 m_viewportSize(viewportSize), | 78 m_viewportSize(viewportSize), |
79 m_contentsSize(contentsSize) {} | 79 m_contentsSize(contentsSize) {} |
80 | 80 |
81 void setScrollOffset(const DoublePoint& offset, ScrollType) override { | 81 void updateScrollPosition(const DoublePoint& offset, ScrollType) override { |
82 m_scrollPosition = offset; | 82 m_scrollPosition = offset; |
83 } | 83 } |
84 bool shouldUseIntegerScrollOffset() const override { return true; } | 84 bool shouldUseIntegerScrollOffset() const override { return true; } |
85 LayoutRect visualRectForScrollbarParts() const override { | 85 LayoutRect visualRectForScrollbarParts() const override { |
86 ASSERT_NOT_REACHED(); | 86 ASSERT_NOT_REACHED(); |
87 return LayoutRect(); | 87 return LayoutRect(); |
88 } | 88 } |
89 bool isActive() const override { return true; } | 89 bool isActive() const override { return true; } |
90 bool isScrollCornerVisible() const override { return true; } | 90 bool isScrollCornerVisible() const override { return true; } |
91 IntRect scrollCornerRect() const override { return IntRect(); } | 91 IntRect scrollCornerRect() const override { return IntRect(); } |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 alternateScroller->scrollPositionDouble()); | 510 alternateScroller->scrollPositionDouble()); |
511 EXPECT_POINT_EQ(DoublePoint(200, 200), | 511 EXPECT_POINT_EQ(DoublePoint(200, 200), |
512 rootFrameViewport->scrollPositionDouble()); | 512 rootFrameViewport->scrollPositionDouble()); |
513 EXPECT_POINT_EQ(DoublePoint(50, 50), layoutViewport->scrollPositionDouble()); | 513 EXPECT_POINT_EQ(DoublePoint(50, 50), layoutViewport->scrollPositionDouble()); |
514 | 514 |
515 EXPECT_POINT_EQ(DoublePoint(550, 450), | 515 EXPECT_POINT_EQ(DoublePoint(550, 450), |
516 rootFrameViewport->maximumScrollPositionDouble()); | 516 rootFrameViewport->maximumScrollPositionDouble()); |
517 } | 517 } |
518 | 518 |
519 } // namespace blink | 519 } // namespace blink |
OLD | NEW |