| 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 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 } | 27 } |
| 28 bool HasHorizontalScrollbar() const { return HorizontalScrollbar(); } | 28 bool HasHorizontalScrollbar() const { return HorizontalScrollbar(); } |
| 29 bool HasVerticalScrollbar() const { return VerticalScrollbar(); } | 29 bool HasVerticalScrollbar() const { return VerticalScrollbar(); } |
| 30 | 30 |
| 31 // These functions are used to create/destroy scrollbars. | 31 // These functions are used to create/destroy scrollbars. |
| 32 virtual void SetHasHorizontalScrollbar(bool has_scrollbar) = 0; | 32 virtual void SetHasHorizontalScrollbar(bool has_scrollbar) = 0; |
| 33 virtual void SetHasVerticalScrollbar(bool has_scrollbar) = 0; | 33 virtual void SetHasVerticalScrollbar(bool has_scrollbar) = 0; |
| 34 | 34 |
| 35 DECLARE_VIRTUAL_TRACE(); | 35 DECLARE_VIRTUAL_TRACE(); |
| 36 | 36 |
| 37 protected: | 37 Scrollbar* CreateScrollbar(ScrollbarOrientation); |
| 38 // TODO(ymalik): This can be made non-virtual since there's a lot of | 38 |
| 39 // common code in subclasses. | 39 void DestroyScrollbar(ScrollbarOrientation); |
| 40 virtual Scrollbar* CreateScrollbar(ScrollbarOrientation) = 0; | |
| 41 virtual void DestroyScrollbar(ScrollbarOrientation) = 0; | |
| 42 | 40 |
| 43 protected: | 41 protected: |
| 44 Member<ScrollableArea> scrollable_area_; | 42 Member<ScrollableArea> scrollable_area_; |
| 45 | 43 |
| 46 // The scrollbars associated with m_scrollableArea. Both can nullptr. | 44 // The scrollbars associated with m_scrollableArea. Both can nullptr. |
| 47 Member<Scrollbar> h_bar_; | 45 Member<Scrollbar> h_bar_; |
| 48 Member<Scrollbar> v_bar_; | 46 Member<Scrollbar> v_bar_; |
| 49 | 47 |
| 50 unsigned h_bar_is_attached_ : 1; | 48 unsigned h_bar_is_attached_ : 1; |
| 51 unsigned v_bar_is_attached_ : 1; | 49 unsigned v_bar_is_attached_ : 1; |
| 52 }; | 50 }; |
| 53 | 51 |
| 54 } // namespace blink | 52 } // namespace blink |
| 55 | 53 |
| 56 #endif // ScrollbarManager_h | 54 #endif // ScrollbarManager_h |
| OLD | NEW |