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 26 matching lines...) Expand all Loading... |
37 * version of this file under the LGPL, indicate your decision by | 37 * version of this file under the LGPL, indicate your decision by |
38 * deletingthe provisions above and replace them with the notice and | 38 * deletingthe provisions above and replace them with the notice and |
39 * other provisions required by the MPL or the GPL, as the case may be. | 39 * other provisions required by the MPL or the GPL, as the case may be. |
40 * If you do not delete the provisions above, a recipient may use your | 40 * If you do not delete the provisions above, a recipient may use your |
41 * version of this file under any of the LGPL, the MPL or the GPL. | 41 * version of this file under any of the LGPL, the MPL or the GPL. |
42 */ | 42 */ |
43 | 43 |
44 #ifndef LayerScrollableArea_h | 44 #ifndef LayerScrollableArea_h |
45 #define LayerScrollableArea_h | 45 #define LayerScrollableArea_h |
46 | 46 |
47 | |
48 #include "core/layout/LayerFragment.h" | 47 #include "core/layout/LayerFragment.h" |
49 #include "core/rendering/RenderBox.h" | 48 #include "core/layout/LayoutBox.h" |
50 | |
51 #include "platform/scroll/ScrollableArea.h" | 49 #include "platform/scroll/ScrollableArea.h" |
52 | 50 |
53 namespace blink { | 51 namespace blink { |
54 | 52 |
55 enum ResizerHitTestType { | 53 enum ResizerHitTestType { |
56 ResizerForPointer, | 54 ResizerForPointer, |
57 ResizerForTouch | 55 ResizerForTouch |
58 }; | 56 }; |
59 | 57 |
60 class PlatformEvent; | 58 class PlatformEvent; |
61 class RenderBox; | 59 class LayoutBox; |
62 class Layer; | 60 class Layer; |
63 class LayoutScrollbarPart; | 61 class LayoutScrollbarPart; |
64 | 62 |
65 class LayerScrollableArea final : public ScrollableArea { | 63 class LayerScrollableArea final : public ScrollableArea { |
66 friend class Internals; | 64 friend class Internals; |
67 | 65 |
68 public: | 66 public: |
69 // FIXME: We should pass in the RenderBox but this opens a window | 67 // FIXME: We should pass in the LayoutBox but this opens a window |
70 // for crashers during Layer setup (see crbug.com/368062). | 68 // for crashers during Layer setup (see crbug.com/368062). |
71 LayerScrollableArea(Layer&); | 69 LayerScrollableArea(Layer&); |
72 virtual ~LayerScrollableArea(); | 70 virtual ~LayerScrollableArea(); |
73 | 71 |
74 bool hasHorizontalScrollbar() const { return horizontalScrollbar(); } | 72 bool hasHorizontalScrollbar() const { return horizontalScrollbar(); } |
75 bool hasVerticalScrollbar() const { return verticalScrollbar(); } | 73 bool hasVerticalScrollbar() const { return verticalScrollbar(); } |
76 | 74 |
77 virtual Scrollbar* horizontalScrollbar() const override { return m_hBar.get(
); } | 75 virtual Scrollbar* horizontalScrollbar() const override { return m_hBar.get(
); } |
78 virtual Scrollbar* verticalScrollbar() const override { return m_vBar.get();
} | 76 virtual Scrollbar* verticalScrollbar() const override { return m_vBar.get();
} |
79 | 77 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 void updateNeedsCompositedScrolling(LCDTextMode = ConsiderLCDText); | 198 void updateNeedsCompositedScrolling(LCDTextMode = ConsiderLCDText); |
201 bool needsCompositedScrolling() const { return m_needsCompositedScrolling; } | 199 bool needsCompositedScrolling() const { return m_needsCompositedScrolling; } |
202 | 200 |
203 // These are used during compositing updates to determine if the overflow | 201 // These are used during compositing updates to determine if the overflow |
204 // controls need to be repositioned in the GraphicsLayer tree. | 202 // controls need to be repositioned in the GraphicsLayer tree. |
205 void setTopmostScrollChild(Layer*); | 203 void setTopmostScrollChild(Layer*); |
206 Layer* topmostScrollChild() const { ASSERT(!m_nextTopmostScrollChild); retur
n m_topmostScrollChild; } | 204 Layer* topmostScrollChild() const { ASSERT(!m_nextTopmostScrollChild); retur
n m_topmostScrollChild; } |
207 | 205 |
208 IntRect resizerCornerRect(const IntRect&, ResizerHitTestType) const; | 206 IntRect resizerCornerRect(const IntRect&, ResizerHitTestType) const; |
209 | 207 |
210 RenderBox& box() const; | 208 LayoutBox& box() const; |
211 Layer* layer() const; | 209 Layer* layer() const; |
212 | 210 |
213 LayoutScrollbarPart* resizer() { return m_resizer; } | 211 LayoutScrollbarPart* resizer() { return m_resizer; } |
214 | 212 |
215 const IntPoint& cachedOverlayScrollbarOffset() { return m_cachedOverlayScrol
lbarOffset; } | 213 const IntPoint& cachedOverlayScrollbarOffset() { return m_cachedOverlayScrol
lbarOffset; } |
216 void setCachedOverlayScrollbarOffset(const IntPoint& offset) { m_cachedOverl
ayScrollbarOffset = offset; } | 214 void setCachedOverlayScrollbarOffset(const IntPoint& offset) { m_cachedOverl
ayScrollbarOffset = offset; } |
217 | 215 |
218 IntRect rectForHorizontalScrollbar(const IntRect& borderBoxRect) const; | 216 IntRect rectForHorizontalScrollbar(const IntRect& borderBoxRect) const; |
219 IntRect rectForVerticalScrollbar(const IntRect& borderBoxRect) const; | 217 IntRect rectForVerticalScrollbar(const IntRect& borderBoxRect) const; |
220 | 218 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 // Renderers to hold our custom scroll corner. | 279 // Renderers to hold our custom scroll corner. |
282 LayoutScrollbarPart* m_scrollCorner; | 280 LayoutScrollbarPart* m_scrollCorner; |
283 | 281 |
284 // Renderers to hold our custom resizer. | 282 // Renderers to hold our custom resizer. |
285 LayoutScrollbarPart* m_resizer; | 283 LayoutScrollbarPart* m_resizer; |
286 }; | 284 }; |
287 | 285 |
288 } // namespace blink | 286 } // namespace blink |
289 | 287 |
290 #endif // LayerScrollableArea_h | 288 #endif // LayerScrollableArea_h |
OLD | NEW |