| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 void setScrollOffset(const ScrollOffset&, | 57 void setScrollOffset(const ScrollOffset&, |
| 58 ScrollType, | 58 ScrollType, |
| 59 ScrollBehavior = ScrollBehaviorInstant) override; | 59 ScrollBehavior = ScrollBehaviorInstant) override; |
| 60 LayoutRect scrollIntoView(const LayoutRect& rectInContent, | 60 LayoutRect scrollIntoView(const LayoutRect& rectInContent, |
| 61 const ScrollAlignment& alignX, | 61 const ScrollAlignment& alignX, |
| 62 const ScrollAlignment& alignY, | 62 const ScrollAlignment& alignY, |
| 63 ScrollType = ProgrammaticScroll) override; | 63 ScrollType = ProgrammaticScroll) override; |
| 64 IntRect visibleContentRect( | 64 IntRect visibleContentRect( |
| 65 IncludeScrollbarsInRect = ExcludeScrollbars) const override; | 65 IncludeScrollbarsInRect = ExcludeScrollbars) const override; |
| 66 bool shouldUseIntegerScrollOffset() const override; | 66 bool shouldUseIntegerScrollOffset() const override; |
| 67 LayoutRect visualRectForScrollbarParts() const override { | |
| 68 ASSERT_NOT_REACHED(); | |
| 69 return LayoutRect(); | |
| 70 } | |
| 71 bool isActive() const override; | |
| 72 int scrollSize(ScrollbarOrientation) const override; | 67 int scrollSize(ScrollbarOrientation) const override; |
| 73 bool isScrollCornerVisible() const override; | 68 bool isScrollCornerVisible() const override; |
| 74 IntRect scrollCornerRect() const override; | 69 IntRect scrollCornerRect() const override; |
| 75 void updateScrollOffset(const ScrollOffset&, ScrollType) override; | 70 void updateScrollOffset(const ScrollOffset&, ScrollType) override; |
| 76 IntSize scrollOffsetInt() const override; | 71 IntSize scrollOffsetInt() const override; |
| 77 ScrollOffset scrollOffset() const override; | 72 ScrollOffset scrollOffset() const override; |
| 78 IntSize minimumScrollOffsetInt() const override; | 73 IntSize minimumScrollOffsetInt() const override; |
| 79 IntSize maximumScrollOffsetInt() const override; | 74 IntSize maximumScrollOffsetInt() const override; |
| 80 ScrollOffset maximumScrollOffset() const override; | 75 ScrollOffset maximumScrollOffset() const override; |
| 81 IntSize contentsSize() const override; | 76 IntSize contentsSize() const override; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 100 void updateCompositorScrollAnimations() override; | 95 void updateCompositorScrollAnimations() override; |
| 101 void cancelProgrammaticScrollAnimation() override; | 96 void cancelProgrammaticScrollAnimation() override; |
| 102 ScrollBehavior scrollBehaviorStyle() const override; | 97 ScrollBehavior scrollBehaviorStyle() const override; |
| 103 Widget* getWidget() override; | 98 Widget* getWidget() override; |
| 104 void clearScrollAnimators() override; | 99 void clearScrollAnimators() override; |
| 105 LayoutBox* layoutBox() const override; | 100 LayoutBox* layoutBox() const override; |
| 106 FloatQuad localToVisibleContentQuad(const FloatQuad&, | 101 FloatQuad localToVisibleContentQuad(const FloatQuad&, |
| 107 const LayoutObject*, | 102 const LayoutObject*, |
| 108 unsigned = 0) const final; | 103 unsigned = 0) const final; |
| 109 | 104 |
| 105 // Scrollbar related |
| 106 // TODO(crbug.com/661236): Seperate the scrollbar related logic from |
| 107 // ScrollableArea. |
| 108 Scrollbar* horizontalScrollbar() const override; |
| 109 Scrollbar* verticalScrollbar() const override; |
| 110 bool isActive() const override; |
| 111 bool hasOverlayScrollbars() const override; |
| 112 void setScrollbarNeedsPaintInvalidation(ScrollbarOrientation) override; |
| 113 LayoutRect visualRectForScrollbarParts() const override; |
| 114 ScrollbarOverlayColorTheme getScrollbarOverlayColorTheme() const override; |
| 115 void getTickmarks(Vector<IntRect>& rects) const override; |
| 116 void mouseEnteredScrollbar(Scrollbar&) const override; |
| 117 void mouseExitedScrollbar(Scrollbar&) const override; |
| 118 void scrollbarVisibilityChanged() override; |
| 119 IntRect convertFromScrollbarToContainingWidget(const Scrollbar&, |
| 120 const IntRect&) const override; |
| 121 IntRect convertFromContainingWidgetToScrollbar(const Scrollbar&, |
| 122 const IntRect&) const override; |
| 123 IntPoint convertFromScrollbarToContainingWidget( |
| 124 const Scrollbar&, |
| 125 const IntPoint&) const override; |
| 126 IntPoint convertFromContainingWidgetToScrollbar( |
| 127 const Scrollbar&, |
| 128 const IntPoint&) const override; |
| 129 ScrollOffset scrollAnimatorDesiredTargetOffset() const override; |
| 130 void setScrollCornerNeedsPaintInvalidation() override; |
| 131 |
| 132 void setTickmarks(const Vector<IntRect>&); |
| 133 |
| 110 private: | 134 private: |
| 111 RootFrameViewport(ScrollableArea& visualViewport, | 135 RootFrameViewport(ScrollableArea& visualViewport, |
| 112 ScrollableArea& layoutViewport); | 136 ScrollableArea& layoutViewport); |
| 113 | 137 |
| 114 enum ViewportToScrollFirst { VisualViewport, LayoutViewport }; | 138 enum ViewportToScrollFirst { VisualViewport, LayoutViewport }; |
| 115 | 139 |
| 116 ScrollOffset scrollOffsetFromScrollAnimators() const; | 140 ScrollOffset scrollOffsetFromScrollAnimators() const; |
| 117 | 141 |
| 118 void distributeScrollBetweenViewports(const ScrollOffset&, | 142 void distributeScrollBetweenViewports(const ScrollOffset&, |
| 119 ScrollType, | 143 ScrollType, |
| 120 ScrollBehavior, | 144 ScrollBehavior, |
| 121 ViewportToScrollFirst); | 145 ViewportToScrollFirst); |
| 122 | 146 |
| 123 // If either of the layout or visual viewports are scrolled explicitly (i.e. | 147 // If either of the layout or visual viewports are scrolled explicitly (i.e. |
| 124 // not through this class), their updated offset will not be reflected in this | 148 // not through this class), their updated offset will not be reflected in this |
| 125 // class' animator so use this method to pull updated values when necessary. | 149 // class' animator so use this method to pull updated values when necessary. |
| 126 void updateScrollAnimator(); | 150 void updateScrollAnimator(); |
| 127 | 151 |
| 128 ScrollableArea& visualViewport() const { | 152 ScrollableArea& visualViewport() const { |
| 129 ASSERT(m_visualViewport); | 153 ASSERT(m_visualViewport); |
| 130 return *m_visualViewport; | 154 return *m_visualViewport; |
| 131 } | 155 } |
| 132 | 156 |
| 157 Vector<IntRect> m_tickmarks; |
| 158 |
| 133 Member<ScrollableArea> m_visualViewport; | 159 Member<ScrollableArea> m_visualViewport; |
| 134 Member<ScrollableArea> m_layoutViewport; | 160 Member<ScrollableArea> m_layoutViewport; |
| 135 }; | 161 }; |
| 136 | 162 |
| 137 DEFINE_TYPE_CASTS(RootFrameViewport, | 163 DEFINE_TYPE_CASTS(RootFrameViewport, |
| 138 ScrollableArea, | 164 ScrollableArea, |
| 139 scrollableArea, | 165 scrollableArea, |
| 140 scrollableArea->isRootFrameViewport(), | 166 scrollableArea->isRootFrameViewport(), |
| 141 scrollableArea.isRootFrameViewport()); | 167 scrollableArea.isRootFrameViewport()); |
| 142 | 168 |
| 143 } // namespace blink | 169 } // namespace blink |
| 144 | 170 |
| 145 #endif // RootFrameViewport_h | 171 #endif // RootFrameViewport_h |
| OLD | NEW |