| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 ScrollbarManager_h | 5 #ifndef ScrollbarManager_h |
| 6 #define ScrollbarManager_h | 6 #define ScrollbarManager_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 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class CORE_EXPORT ScrollbarManager { | 13 class CORE_EXPORT ScrollbarManager { |
| 14 DISALLOW_NEW(); | 14 DISALLOW_NEW(); |
| 15 | 15 |
| 16 // Helper class to manage the life cycle of Scrollbar objects. | 16 // Helper class to manage the life cycle of Scrollbar objects. |
| 17 public: | 17 public: |
| 18 ScrollbarManager(ScrollableArea&); | 18 ScrollbarManager(ScrollableArea&); |
| 19 | 19 |
| 20 // TODO(crbug.com/661236): The scroller should be the one that owns this | |
| 21 // ScrollbarManager and this setter should be removed. | |
| 22 // The scroller that this scrollbar it attached to. | |
| 23 void setScroller(ScrollableArea*); | |
| 24 | |
| 25 void dispose(); | 20 void dispose(); |
| 26 | 21 |
| 27 Scrollbar* horizontalScrollbar() const { | 22 Scrollbar* horizontalScrollbar() const { |
| 28 return m_hBarIsAttached ? m_hBar.get() : nullptr; | 23 return m_hBarIsAttached ? m_hBar.get() : nullptr; |
| 29 } | 24 } |
| 30 Scrollbar* verticalScrollbar() const { | 25 Scrollbar* verticalScrollbar() const { |
| 31 return m_vBarIsAttached ? m_vBar.get() : nullptr; | 26 return m_vBarIsAttached ? m_vBar.get() : nullptr; |
| 32 } | 27 } |
| 33 bool hasHorizontalScrollbar() const { return horizontalScrollbar(); } | 28 bool hasHorizontalScrollbar() const { return horizontalScrollbar(); } |
| 34 bool hasVerticalScrollbar() const { return verticalScrollbar(); } | 29 bool hasVerticalScrollbar() const { return verticalScrollbar(); } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 52 Member<Scrollbar> m_hBar; | 47 Member<Scrollbar> m_hBar; |
| 53 Member<Scrollbar> m_vBar; | 48 Member<Scrollbar> m_vBar; |
| 54 | 49 |
| 55 unsigned m_hBarIsAttached : 1; | 50 unsigned m_hBarIsAttached : 1; |
| 56 unsigned m_vBarIsAttached : 1; | 51 unsigned m_vBarIsAttached : 1; |
| 57 }; | 52 }; |
| 58 | 53 |
| 59 } // namespace blink | 54 } // namespace blink |
| 60 | 55 |
| 61 #endif // ScrollbarManager_h | 56 #endif // ScrollbarManager_h |
| OLD | NEW |