OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_VIEWS_CONTROLS_SCROLLBAR_SCROLL_BAR_H_ | 5 #ifndef UI_VIEWS_CONTROLS_SCROLLBAR_SCROLL_BAR_H_ |
6 #define UI_VIEWS_CONTROLS_SCROLLBAR_SCROLL_BAR_H_ | 6 #define UI_VIEWS_CONTROLS_SCROLLBAR_SCROLL_BAR_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 int GetMinPosition() const; | 79 int GetMinPosition() const; |
80 | 80 |
81 // Returns the position of the scrollbar. | 81 // Returns the position of the scrollbar. |
82 virtual int GetPosition() const = 0; | 82 virtual int GetPosition() const = 0; |
83 | 83 |
84 // Get the width or height of this scrollbar, for use in layout calculations. | 84 // Get the width or height of this scrollbar, for use in layout calculations. |
85 // For a vertical scrollbar, this is the width of the scrollbar, likewise it | 85 // For a vertical scrollbar, this is the width of the scrollbar, likewise it |
86 // is the height for a horizontal scrollbar. | 86 // is the height for a horizontal scrollbar. |
87 virtual int GetLayoutSize() const = 0; | 87 virtual int GetLayoutSize() const = 0; |
88 | 88 |
89 // Get the actually visible width or height for this scrollbar. Default is | |
90 // same as GetLayoutSize(). This value can be different from GetLayoutSize() | |
91 // if the scrollbar overlaps its contents. | |
92 virtual int GetVisibleSize() const; | |
sadrul
2013/06/04 19:03:24
Call this GetContentOverlapSize() instead. That wo
Jun Mukai
2013/06/04 20:52:38
Done.
| |
93 | |
94 virtual void OnMouseEnteredScrollView(const ui::MouseEvent& event); | |
95 virtual void OnMouseExitedScrollView(const ui::MouseEvent& event); | |
96 | |
89 protected: | 97 protected: |
90 // Create new scrollbar, either horizontal or vertical. These are protected | 98 // Create new scrollbar, either horizontal or vertical. These are protected |
91 // since you need to be creating either a NativeScrollBar or a | 99 // since you need to be creating either a NativeScrollBar or a |
92 // ImageScrollBar. | 100 // ImageScrollBar. |
93 explicit ScrollBar(bool is_horiz); | 101 explicit ScrollBar(bool is_horiz); |
94 | 102 |
95 private: | 103 private: |
96 const bool is_horiz_; | 104 const bool is_horiz_; |
97 | 105 |
98 ScrollBarController* controller_; | 106 ScrollBarController* controller_; |
99 | 107 |
100 int max_pos_; | 108 int max_pos_; |
101 | 109 |
102 DISALLOW_COPY_AND_ASSIGN(ScrollBar); | 110 DISALLOW_COPY_AND_ASSIGN(ScrollBar); |
103 }; | 111 }; |
104 | 112 |
105 } // namespace views | 113 } // namespace views |
106 | 114 |
107 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_SCROLL_BAR_H_ | 115 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_SCROLL_BAR_H_ |
OLD | NEW |