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_SCROLL_VIEW_H_ | 5 #ifndef UI_VIEWS_CONTROLS_SCROLL_VIEW_H_ |
6 #define UI_VIEWS_CONTROLS_SCROLL_VIEW_H_ | 6 #define UI_VIEWS_CONTROLS_SCROLL_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "ui/views/controls/scrollbar/scroll_bar.h" | 13 #include "ui/views/controls/scrollbar/scroll_bar.h" |
14 | 14 |
15 namespace views { | 15 namespace views { |
| 16 namespace test { |
| 17 class ScrollViewTestApi; |
| 18 } |
16 | 19 |
17 ///////////////////////////////////////////////////////////////////////////// | 20 ///////////////////////////////////////////////////////////////////////////// |
18 // | 21 // |
19 // ScrollView class | 22 // ScrollView class |
20 // | 23 // |
21 // A ScrollView is used to make any View scrollable. The view is added to | 24 // A ScrollView is used to make any View scrollable. The view is added to |
22 // a viewport which takes care of clipping. | 25 // a viewport which takes care of clipping. |
23 // | 26 // |
24 // In this current implementation both horizontal and vertical scrollbars are | 27 // In this current implementation both horizontal and vertical scrollbars are |
25 // added as needed. | 28 // added as needed. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 void OnGestureEvent(ui::GestureEvent* event) override; | 90 void OnGestureEvent(ui::GestureEvent* event) override; |
88 const char* GetClassName() const override; | 91 const char* GetClassName() const override; |
89 | 92 |
90 // ScrollBarController overrides: | 93 // ScrollBarController overrides: |
91 void ScrollToPosition(ScrollBar* source, int position) override; | 94 void ScrollToPosition(ScrollBar* source, int position) override; |
92 int GetScrollIncrement(ScrollBar* source, | 95 int GetScrollIncrement(ScrollBar* source, |
93 bool is_page, | 96 bool is_page, |
94 bool is_positive) override; | 97 bool is_positive) override; |
95 | 98 |
96 private: | 99 private: |
97 FRIEND_TEST_ALL_PREFIXES(ScrollViewTest, CornerViewVisibility); | 100 friend class test::ScrollViewTestApi; |
| 101 |
98 class Viewport; | 102 class Viewport; |
99 | 103 |
100 // Used internally by SetHeader() and SetContents() to reset the view. Sets | 104 // Used internally by SetHeader() and SetContents() to reset the view. Sets |
101 // |member| to |new_view|. If |new_view| is non-null it is added to |parent|. | 105 // |member| to |new_view|. If |new_view| is non-null it is added to |parent|. |
102 void SetHeaderOrContents(View* parent, View* new_view, View** member); | 106 void SetHeaderOrContents(View* parent, View* new_view, View** member); |
103 | 107 |
104 // Scrolls the minimum amount necessary to make the specified rectangle | 108 // Scrolls the minimum amount necessary to make the specified rectangle |
105 // visible, in the coordinates of the contents view. The specified rectangle | 109 // visible, in the coordinates of the contents view. The specified rectangle |
106 // is constrained by the bounds of the contents view. This has no effect if | 110 // is constrained by the bounds of the contents view. This has no effect if |
107 // the contents have not been set. | 111 // the contents have not been set. |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 private: | 222 private: |
219 int top_margin_; | 223 int top_margin_; |
220 int row_height_; | 224 int row_height_; |
221 | 225 |
222 DISALLOW_COPY_AND_ASSIGN(FixedRowHeightScrollHelper); | 226 DISALLOW_COPY_AND_ASSIGN(FixedRowHeightScrollHelper); |
223 }; | 227 }; |
224 | 228 |
225 } // namespace views | 229 } // namespace views |
226 | 230 |
227 #endif // UI_VIEWS_CONTROLS_SCROLL_VIEW_H_ | 231 #endif // UI_VIEWS_CONTROLS_SCROLL_VIEW_H_ |
OLD | NEW |