OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 enum ResizerHitTestType { | 51 enum ResizerHitTestType { |
52 ResizerForPointer, | 52 ResizerForPointer, |
53 ResizerForTouch | 53 ResizerForTouch |
54 }; | 54 }; |
55 | 55 |
56 class PlatformEvent; | 56 class PlatformEvent; |
57 class RenderBox; | 57 class RenderBox; |
58 class RenderLayer; | 58 class RenderLayer; |
59 class RenderScrollbarPart; | 59 class RenderScrollbarPart; |
60 | 60 |
61 class RenderLayerScrollableArea FINAL : public ScrollableArea { | 61 class RenderLayerScrollableArea final : public ScrollableArea { |
62 friend class Internals; | 62 friend class Internals; |
63 | 63 |
64 public: | 64 public: |
65 // FIXME: We should pass in the RenderBox but this opens a window | 65 // FIXME: We should pass in the RenderBox but this opens a window |
66 // for crashers during RenderLayer setup (see crbug.com/368062). | 66 // for crashers during RenderLayer setup (see crbug.com/368062). |
67 RenderLayerScrollableArea(RenderLayer&); | 67 RenderLayerScrollableArea(RenderLayer&); |
68 virtual ~RenderLayerScrollableArea(); | 68 virtual ~RenderLayerScrollableArea(); |
69 | 69 |
70 bool hasHorizontalScrollbar() const { return horizontalScrollbar(); } | 70 bool hasHorizontalScrollbar() const { return horizontalScrollbar(); } |
71 bool hasVerticalScrollbar() const { return verticalScrollbar(); } | 71 bool hasVerticalScrollbar() const { return verticalScrollbar(); } |
72 | 72 |
73 virtual Scrollbar* horizontalScrollbar() const OVERRIDE { return m_hBar.get(
); } | 73 virtual Scrollbar* horizontalScrollbar() const override { return m_hBar.get(
); } |
74 virtual Scrollbar* verticalScrollbar() const OVERRIDE { return m_vBar.get();
} | 74 virtual Scrollbar* verticalScrollbar() const override { return m_vBar.get();
} |
75 | 75 |
76 virtual HostWindow* hostWindow() const OVERRIDE; | 76 virtual HostWindow* hostWindow() const override; |
77 | 77 |
78 virtual GraphicsLayer* layerForScrolling() const OVERRIDE; | 78 virtual GraphicsLayer* layerForScrolling() const override; |
79 virtual GraphicsLayer* layerForHorizontalScrollbar() const OVERRIDE; | 79 virtual GraphicsLayer* layerForHorizontalScrollbar() const override; |
80 virtual GraphicsLayer* layerForVerticalScrollbar() const OVERRIDE; | 80 virtual GraphicsLayer* layerForVerticalScrollbar() const override; |
81 virtual GraphicsLayer* layerForScrollCorner() const OVERRIDE; | 81 virtual GraphicsLayer* layerForScrollCorner() const override; |
82 virtual bool usesCompositedScrolling() const OVERRIDE; | 82 virtual bool usesCompositedScrolling() const override; |
83 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) OVERRIDE; | 83 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) override; |
84 virtual void invalidateScrollCornerRect(const IntRect&) OVERRIDE; | 84 virtual void invalidateScrollCornerRect(const IntRect&) override; |
85 virtual bool isActive() const OVERRIDE; | 85 virtual bool isActive() const override; |
86 virtual bool isScrollCornerVisible() const OVERRIDE; | 86 virtual bool isScrollCornerVisible() const override; |
87 virtual IntRect scrollCornerRect() const OVERRIDE; | 87 virtual IntRect scrollCornerRect() const override; |
88 virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const
IntRect&) const OVERRIDE; | 88 virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const
IntRect&) const override; |
89 virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const
IntRect&) const OVERRIDE; | 89 virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const
IntRect&) const override; |
90 virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, cons
t IntPoint&) const OVERRIDE; | 90 virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, cons
t IntPoint&) const override; |
91 virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, cons
t IntPoint&) const OVERRIDE; | 91 virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, cons
t IntPoint&) const override; |
92 virtual int scrollSize(ScrollbarOrientation) const OVERRIDE; | 92 virtual int scrollSize(ScrollbarOrientation) const override; |
93 virtual void setScrollOffset(const IntPoint&) OVERRIDE; | 93 virtual void setScrollOffset(const IntPoint&) override; |
94 virtual IntPoint scrollPosition() const OVERRIDE; | 94 virtual IntPoint scrollPosition() const override; |
95 virtual IntPoint minimumScrollPosition() const OVERRIDE; | 95 virtual IntPoint minimumScrollPosition() const override; |
96 virtual IntPoint maximumScrollPosition() const OVERRIDE; | 96 virtual IntPoint maximumScrollPosition() const override; |
97 virtual IntRect visibleContentRect(IncludeScrollbarsInRect) const OVERRIDE; | 97 virtual IntRect visibleContentRect(IncludeScrollbarsInRect) const override; |
98 virtual int visibleHeight() const OVERRIDE; | 98 virtual int visibleHeight() const override; |
99 virtual int visibleWidth() const OVERRIDE; | 99 virtual int visibleWidth() const override; |
100 virtual IntSize contentsSize() const OVERRIDE; | 100 virtual IntSize contentsSize() const override; |
101 virtual IntSize overhangAmount() const OVERRIDE; | 101 virtual IntSize overhangAmount() const override; |
102 virtual IntPoint lastKnownMousePosition() const OVERRIDE; | 102 virtual IntPoint lastKnownMousePosition() const override; |
103 virtual bool shouldSuspendScrollAnimations() const OVERRIDE; | 103 virtual bool shouldSuspendScrollAnimations() const override; |
104 virtual bool scrollbarsCanBeActive() const OVERRIDE; | 104 virtual bool scrollbarsCanBeActive() const override; |
105 virtual IntRect scrollableAreaBoundingBox() const OVERRIDE; | 105 virtual IntRect scrollableAreaBoundingBox() const override; |
106 virtual bool userInputScrollable(ScrollbarOrientation) const OVERRIDE; | 106 virtual bool userInputScrollable(ScrollbarOrientation) const override; |
107 virtual bool shouldPlaceVerticalScrollbarOnLeft() const OVERRIDE; | 107 virtual bool shouldPlaceVerticalScrollbarOnLeft() const override; |
108 virtual int pageStep(ScrollbarOrientation) const OVERRIDE; | 108 virtual int pageStep(ScrollbarOrientation) const override; |
109 | 109 |
110 int scrollXOffset() const { return m_scrollOffset.width() + scrollOrigin().x
(); } | 110 int scrollXOffset() const { return m_scrollOffset.width() + scrollOrigin().x
(); } |
111 int scrollYOffset() const { return m_scrollOffset.height() + scrollOrigin().
y(); } | 111 int scrollYOffset() const { return m_scrollOffset.height() + scrollOrigin().
y(); } |
112 | 112 |
113 IntSize scrollOffset() const { return m_scrollOffset; } | 113 IntSize scrollOffset() const { return m_scrollOffset; } |
114 | 114 |
115 // FIXME: We shouldn't allow access to m_overflowRect outside this class. | 115 // FIXME: We shouldn't allow access to m_overflowRect outside this class. |
116 LayoutRect overflowRect() const { return m_overflowRect; } | 116 LayoutRect overflowRect() const { return m_overflowRect; } |
117 | 117 |
118 void scrollToOffset(const IntSize& scrollOffset, ScrollOffsetClamping = Scro
llOffsetUnclamped); | 118 void scrollToOffset(const IntSize& scrollOffset, ScrollOffsetClamping = Scro
llOffsetUnclamped); |
119 void scrollToXOffset(int x, ScrollOffsetClamping clamp = ScrollOffsetUnclamp
ed) { scrollToOffset(IntSize(x, scrollYOffset()), clamp); } | 119 void scrollToXOffset(int x, ScrollOffsetClamping clamp = ScrollOffsetUnclamp
ed) { scrollToOffset(IntSize(x, scrollYOffset()), clamp); } |
120 void scrollToYOffset(int y, ScrollOffsetClamping clamp = ScrollOffsetUnclamp
ed) { scrollToOffset(IntSize(scrollXOffset(), y), clamp); } | 120 void scrollToYOffset(int y, ScrollOffsetClamping clamp = ScrollOffsetUnclamp
ed) { scrollToOffset(IntSize(scrollXOffset(), y), clamp); } |
121 | 121 |
122 void updateAfterLayout(); | 122 void updateAfterLayout(); |
123 void updateAfterStyleChange(const RenderStyle*); | 123 void updateAfterStyleChange(const RenderStyle*); |
124 void updateAfterOverflowRecalc(); | 124 void updateAfterOverflowRecalc(); |
125 | 125 |
126 virtual bool updateAfterCompositingChange() OVERRIDE; | 126 virtual bool updateAfterCompositingChange() override; |
127 | 127 |
128 bool hasScrollbar() const { return m_hBar || m_vBar; } | 128 bool hasScrollbar() const { return m_hBar || m_vBar; } |
129 | 129 |
130 // FIXME: This should be removed. | 130 // FIXME: This should be removed. |
131 bool hasScrollCorner() const { return m_scrollCorner; } | 131 bool hasScrollCorner() const { return m_scrollCorner; } |
132 | 132 |
133 void resize(const PlatformEvent&, const LayoutSize&); | 133 void resize(const PlatformEvent&, const LayoutSize&); |
134 IntSize offsetFromResizeCorner(const IntPoint& absolutePoint) const; | 134 IntSize offsetFromResizeCorner(const IntPoint& absolutePoint) const; |
135 | 135 |
136 bool inResizeMode() const { return m_inResizeMode; } | 136 bool inResizeMode() const { return m_inResizeMode; } |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 // Renderers to hold our custom scroll corner. | 251 // Renderers to hold our custom scroll corner. |
252 RawPtrWillBePersistent<RenderScrollbarPart> m_scrollCorner; | 252 RawPtrWillBePersistent<RenderScrollbarPart> m_scrollCorner; |
253 | 253 |
254 // Renderers to hold our custom resizer. | 254 // Renderers to hold our custom resizer. |
255 RawPtrWillBePersistent<RenderScrollbarPart> m_resizer; | 255 RawPtrWillBePersistent<RenderScrollbarPart> m_resizer; |
256 }; | 256 }; |
257 | 257 |
258 } // namespace blink | 258 } // namespace blink |
259 | 259 |
260 #endif // RenderLayerScrollableArea_h | 260 #endif // RenderLayerScrollableArea_h |
OLD | NEW |