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 #include "ui/views/controls/scrollbar/native_scroll_bar_views.h" | 5 #include "ui/views/controls/scrollbar/native_scroll_bar_views.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/events/keycodes/keyboard_codes.h" | 8 #include "ui/events/keycodes/keyboard_codes.h" |
9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
10 #include "ui/gfx/path.h" | 10 #include "ui/gfx/path.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 enum Type { | 25 enum Type { |
26 UP, | 26 UP, |
27 DOWN, | 27 DOWN, |
28 LEFT, | 28 LEFT, |
29 RIGHT, | 29 RIGHT, |
30 }; | 30 }; |
31 | 31 |
32 ScrollBarButton(ButtonListener* listener, Type type); | 32 ScrollBarButton(ButtonListener* listener, Type type); |
33 virtual ~ScrollBarButton(); | 33 virtual ~ScrollBarButton(); |
34 | 34 |
35 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 35 virtual gfx::Size GetPreferredSize() const override; |
36 virtual const char* GetClassName() const OVERRIDE { | 36 virtual const char* GetClassName() const override { |
37 return "ScrollBarButton"; | 37 return "ScrollBarButton"; |
38 } | 38 } |
39 | 39 |
40 protected: | 40 protected: |
41 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 41 virtual void OnPaint(gfx::Canvas* canvas) override; |
42 | 42 |
43 private: | 43 private: |
44 ui::NativeTheme::ExtraParams GetNativeThemeParams() const; | 44 ui::NativeTheme::ExtraParams GetNativeThemeParams() const; |
45 ui::NativeTheme::Part GetNativeThemePart() const; | 45 ui::NativeTheme::Part GetNativeThemePart() const; |
46 ui::NativeTheme::State GetNativeThemeState() const; | 46 ui::NativeTheme::State GetNativeThemeState() const; |
47 | 47 |
48 Type type_; | 48 Type type_; |
49 }; | 49 }; |
50 | 50 |
51 // Wrapper for the scroll thumb | 51 // Wrapper for the scroll thumb |
52 class ScrollBarThumb : public BaseScrollBarThumb { | 52 class ScrollBarThumb : public BaseScrollBarThumb { |
53 public: | 53 public: |
54 explicit ScrollBarThumb(BaseScrollBar* scroll_bar); | 54 explicit ScrollBarThumb(BaseScrollBar* scroll_bar); |
55 virtual ~ScrollBarThumb(); | 55 virtual ~ScrollBarThumb(); |
56 | 56 |
57 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 57 virtual gfx::Size GetPreferredSize() const override; |
58 virtual const char* GetClassName() const OVERRIDE { | 58 virtual const char* GetClassName() const override { |
59 return "ScrollBarThumb"; | 59 return "ScrollBarThumb"; |
60 } | 60 } |
61 | 61 |
62 protected: | 62 protected: |
63 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 63 virtual void OnPaint(gfx::Canvas* canvas) override; |
64 | 64 |
65 private: | 65 private: |
66 ui::NativeTheme::ExtraParams GetNativeThemeParams() const; | 66 ui::NativeTheme::ExtraParams GetNativeThemeParams() const; |
67 ui::NativeTheme::Part GetNativeThemePart() const; | 67 ui::NativeTheme::Part GetNativeThemePart() const; |
68 ui::NativeTheme::State GetNativeThemeState() const; | 68 ui::NativeTheme::State GetNativeThemeState() const; |
69 | 69 |
70 ScrollBar* scroll_bar_; | 70 ScrollBar* scroll_bar_; |
71 }; | 71 }; |
72 | 72 |
73 ///////////////////////////////////////////////////////////////////////////// | 73 ///////////////////////////////////////////////////////////////////////////// |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 thumb_params.scrollbar_thumb.is_hovering = false; | 415 thumb_params.scrollbar_thumb.is_hovering = false; |
416 gfx::Size track_size = theme->GetPartSize( | 416 gfx::Size track_size = theme->GetPartSize( |
417 ui::NativeTheme::kScrollbarVerticalThumb, | 417 ui::NativeTheme::kScrollbarVerticalThumb, |
418 ui::NativeTheme::kNormal, | 418 ui::NativeTheme::kNormal, |
419 thumb_params); | 419 thumb_params); |
420 | 420 |
421 return std::max(track_size.width(), button_size.width()); | 421 return std::max(track_size.width(), button_size.width()); |
422 } | 422 } |
423 | 423 |
424 } // namespace views | 424 } // namespace views |
OLD | NEW |