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_NATIVE_SCROLL_BAR_H_ | 5 #ifndef UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_H_ |
6 #define UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_H_ | 6 #define UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_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 #include "ui/views/view.h" | 14 #include "ui/views/view.h" |
15 | 15 |
16 namespace ui { | 16 namespace ui { |
17 class NativeTheme; | 17 class NativeTheme; |
18 } | 18 } |
19 | 19 |
20 namespace views { | 20 namespace views { |
| 21 namespace test { |
| 22 class ScrollViewTestApi; |
| 23 } |
21 | 24 |
22 class NativeScrollBarWrapper; | 25 class NativeScrollBarWrapper; |
23 | 26 |
24 // The NativeScrollBar class is a scrollbar that uses platform's | 27 // The NativeScrollBar class is a scrollbar that uses platform's |
25 // native control. | 28 // native control. |
26 class VIEWS_EXPORT NativeScrollBar : public ScrollBar { | 29 class VIEWS_EXPORT NativeScrollBar : public ScrollBar { |
27 public: | 30 public: |
28 // The scroll-bar's class name. | 31 // The scroll-bar's class name. |
29 static const char kViewClassName[]; | 32 static const char kViewClassName[]; |
30 | 33 |
31 // Create new scrollbar, either horizontal or vertical. | 34 // Create new scrollbar, either horizontal or vertical. |
32 explicit NativeScrollBar(bool is_horiz); | 35 explicit NativeScrollBar(bool is_horiz); |
33 ~NativeScrollBar() override; | 36 ~NativeScrollBar() override; |
34 | 37 |
35 // Return the system sizes. | 38 // Return the system sizes. |
36 static int GetHorizontalScrollBarHeight(const ui::NativeTheme* theme); | 39 static int GetHorizontalScrollBarHeight(const ui::NativeTheme* theme); |
37 static int GetVerticalScrollBarWidth(const ui::NativeTheme* theme); | 40 static int GetVerticalScrollBarWidth(const ui::NativeTheme* theme); |
38 | 41 |
39 private: | 42 private: |
40 friend class NativeScrollBarTest; | 43 friend class NativeScrollBarTest; |
| 44 friend class test::ScrollViewTestApi; |
41 FRIEND_TEST_ALL_PREFIXES(NativeScrollBarTest, Scrolling); | 45 FRIEND_TEST_ALL_PREFIXES(NativeScrollBarTest, Scrolling); |
42 | 46 |
43 // Overridden from View. | 47 // Overridden from View. |
44 gfx::Size GetPreferredSize() const override; | 48 gfx::Size GetPreferredSize() const override; |
45 void Layout() override; | 49 void Layout() override; |
46 void ViewHierarchyChanged( | 50 void ViewHierarchyChanged( |
47 const ViewHierarchyChangedDetails& details) override; | 51 const ViewHierarchyChangedDetails& details) override; |
48 const char* GetClassName() const override; | 52 const char* GetClassName() const override; |
49 | 53 |
50 // Overrideen from View for keyboard UI purpose. | 54 // Overrideen from View for keyboard UI purpose. |
(...skipping 10 matching lines...) Expand all Loading... |
61 | 65 |
62 // init border | 66 // init border |
63 NativeScrollBarWrapper* native_wrapper_; | 67 NativeScrollBarWrapper* native_wrapper_; |
64 | 68 |
65 DISALLOW_COPY_AND_ASSIGN(NativeScrollBar); | 69 DISALLOW_COPY_AND_ASSIGN(NativeScrollBar); |
66 }; | 70 }; |
67 | 71 |
68 } // namespace views | 72 } // namespace views |
69 | 73 |
70 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_H_ | 74 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_H_ |
OLD | NEW |