| 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/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 width or height for this scrollbar which overlaps with the content. | 89 // Get the width or height for this scrollbar which overlaps with the content. |
| 90 // Default is 0. | 90 // Default is 0. |
| 91 virtual int GetContentOverlapSize() const; | 91 virtual int GetContentOverlapSize() const; |
| 92 | 92 |
| 93 // Called when a ScrollEvent (in any, or no, direction) is seen by the parent |
| 94 // ScrollView. E.g., this may reveal an overlay scrollbar to indicate |
| 95 // possible scrolling directions to the user. |
| 96 virtual void ObserveScrollEvent(const ui::ScrollEvent& event); |
| 97 |
| 93 protected: | 98 protected: |
| 94 // Create new scrollbar, either horizontal or vertical. These are protected | 99 // Create new scrollbar, either horizontal or vertical. These are protected |
| 95 // since you need to be creating either a NativeScrollBar or a | 100 // since you need to be creating either a NativeScrollBar or a |
| 96 // ImageScrollBar. | 101 // ImageScrollBar. |
| 97 explicit ScrollBar(bool is_horiz); | 102 explicit ScrollBar(bool is_horiz); |
| 98 | 103 |
| 99 private: | 104 private: |
| 100 const bool is_horiz_; | 105 const bool is_horiz_; |
| 101 | 106 |
| 102 ScrollBarController* controller_; | 107 ScrollBarController* controller_; |
| 103 | 108 |
| 104 int max_pos_; | 109 int max_pos_; |
| 105 | 110 |
| 106 DISALLOW_COPY_AND_ASSIGN(ScrollBar); | 111 DISALLOW_COPY_AND_ASSIGN(ScrollBar); |
| 107 }; | 112 }; |
| 108 | 113 |
| 109 } // namespace views | 114 } // namespace views |
| 110 | 115 |
| 111 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_SCROLL_BAR_H_ | 116 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_SCROLL_BAR_H_ |
| OLD | NEW |