Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: third_party/WebKit/Source/core/paint/ScrollbarManager.h

Issue 2942163002: [Refactor] Moved scrollbar creation and deletion to ScrollbarManager (Closed)
Patch Set: bokan and skobes comments addressed Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698