Add ICU message format support
[chromium-blink-merge.git] / ui / views / controls / scrollbar / native_scroll_bar.h
blob70b14c1e2b4ac3c3d22b12d02febe758b3a1a38e
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
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_H_
6 #define UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_H_
8 #include <string>
10 #include "base/compiler_specific.h"
11 #include "base/gtest_prod_util.h"
12 #include "ui/views/controls/scrollbar/scroll_bar.h"
13 #include "ui/views/view.h"
15 namespace ui {
16 class NativeTheme;
19 namespace views {
21 class NativeScrollBarWrapper;
23 // The NativeScrollBar class is a scrollbar that uses platform's
24 // native control.
25 class VIEWS_EXPORT NativeScrollBar : public ScrollBar {
26 public:
27 // The scroll-bar's class name.
28 static const char kViewClassName[];
30 // Create new scrollbar, either horizontal or vertical.
31 explicit NativeScrollBar(bool is_horiz);
32 ~NativeScrollBar() override;
34 // Return the system sizes.
35 static int GetHorizontalScrollBarHeight(const ui::NativeTheme* theme);
36 static int GetVerticalScrollBarWidth(const ui::NativeTheme* theme);
38 private:
39 friend class NativeScrollBarTest;
40 FRIEND_TEST_ALL_PREFIXES(NativeScrollBarTest, Scrolling);
42 // Overridden from View.
43 gfx::Size GetPreferredSize() const override;
44 void Layout() override;
45 void ViewHierarchyChanged(
46 const ViewHierarchyChangedDetails& details) override;
47 const char* GetClassName() const override;
49 // Overrideen from View for keyboard UI purpose.
50 bool OnKeyPressed(const ui::KeyEvent& event) override;
51 bool OnMouseWheel(const ui::MouseWheelEvent& e) override;
53 // Overridden from ui::EventHandler.
54 void OnGestureEvent(ui::GestureEvent* event) override;
56 // Overridden from ScrollBar.
57 void Update(int viewport_size, int content_size, int current_pos) override;
58 int GetPosition() const override;
59 int GetLayoutSize() const override;
61 // init border
62 NativeScrollBarWrapper* native_wrapper_;
64 DISALLOW_COPY_AND_ASSIGN(NativeScrollBar);
67 } // namespace views
69 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_NATIVE_SCROLL_BAR_H_