OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 VIEWS_CONTROLS_NATIVE_SCROLL_BAR_WRAPPER_H_ | 5 #ifndef VIEWS_CONTROLS_NATIVE_SCROLL_BAR_WRAPPER_H_ |
6 #define VIEWS_CONTROLS_NATIVE_SCROLL_BAR_WRAPPER_H_ | 6 #define VIEWS_CONTROLS_NATIVE_SCROLL_BAR_WRAPPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 namespace views { | 9 namespace views { |
10 | 10 |
11 class NativeScrollBar; | 11 class NativeScrollBar; |
12 class View; | 12 class View; |
13 | 13 |
14 // A specialization of NativeControlWrapper that hosts a platform-native | 14 // A specialization of NativeControlWrapper that hosts a platform-native |
15 // scroll bar. | 15 // scroll bar. |
16 class VIEWS_EXPORT NativeScrollBarWrapper { | 16 class NativeScrollBarWrapper { |
17 public: | 17 public: |
18 virtual ~NativeScrollBarWrapper() {} | 18 virtual ~NativeScrollBarWrapper() {} |
19 | 19 |
20 // Updates the scroll bar appearance given a viewport size, content size and | 20 // Updates the scroll bar appearance given a viewport size, content size and |
21 // current position. | 21 // current position. |
22 virtual void Update(int viewport_size, int content_size, int current_pos) = 0; | 22 virtual void Update(int viewport_size, int content_size, int current_pos) = 0; |
23 | 23 |
24 // Retrieves the views::View that hosts the native control. | 24 // Retrieves the views::View that hosts the native control. |
25 virtual View* GetView() = 0; | 25 virtual View* GetView() = 0; |
26 | 26 |
27 // Returns the position of the scrollbar. | 27 // Returns the position of the scrollbar. |
28 virtual int GetPosition() const = 0; | 28 virtual int GetPosition() const = 0; |
29 | 29 |
30 // Creates an appropriate NativeScrollBarWrapper for the platform. | 30 // Creates an appropriate NativeScrollBarWrapper for the platform. |
31 static NativeScrollBarWrapper* CreateWrapper(NativeScrollBar* button); | 31 static NativeScrollBarWrapper* CreateWrapper(NativeScrollBar* button); |
32 | 32 |
33 // Returns the system sizes of vertical/horizontal scroll bars. | 33 // Returns the system sizes of vertical/horizontal scroll bars. |
34 static int GetVerticalScrollBarWidth(); | 34 static int GetVerticalScrollBarWidth(); |
35 static int GetHorizontalScrollBarHeight(); | 35 static int GetHorizontalScrollBarHeight(); |
36 }; | 36 }; |
37 | 37 |
38 } // namespace views | 38 } // namespace views |
39 | 39 |
40 #endif // VIEWS_CONTROLS_NATIVE_SCROLL_BAR_WRAPPER_H_ | 40 #endif // VIEWS_CONTROLS_NATIVE_SCROLL_BAR_WRAPPER_H_ |
OLD | NEW |