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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 ScrollBar* scroll_bar_; | 70 ScrollBar* scroll_bar_; |
71 }; | 71 }; |
72 | 72 |
73 ///////////////////////////////////////////////////////////////////////////// | 73 ///////////////////////////////////////////////////////////////////////////// |
74 // ScrollBarButton | 74 // ScrollBarButton |
75 | 75 |
76 ScrollBarButton::ScrollBarButton(ButtonListener* listener, Type type) | 76 ScrollBarButton::ScrollBarButton(ButtonListener* listener, Type type) |
77 : BaseScrollBarButton(listener), | 77 : BaseScrollBarButton(listener), |
78 type_(type) { | 78 type_(type) { |
79 set_focusable(false); | 79 SetFocusable(false); |
80 set_accessibility_focusable(false); | 80 SetAccessibilityFocusable(false); |
81 } | 81 } |
82 | 82 |
83 ScrollBarButton::~ScrollBarButton() { | 83 ScrollBarButton::~ScrollBarButton() { |
84 } | 84 } |
85 | 85 |
86 gfx::Size ScrollBarButton::GetPreferredSize() { | 86 gfx::Size ScrollBarButton::GetPreferredSize() { |
87 return GetNativeTheme()->GetPartSize(GetNativeThemePart(), | 87 return GetNativeTheme()->GetPartSize(GetNativeThemePart(), |
88 GetNativeThemeState(), | 88 GetNativeThemeState(), |
89 GetNativeThemeParams()); | 89 GetNativeThemeParams()); |
90 } | 90 } |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 return state; | 151 return state; |
152 } | 152 } |
153 | 153 |
154 ///////////////////////////////////////////////////////////////////////////// | 154 ///////////////////////////////////////////////////////////////////////////// |
155 // ScrollBarThumb | 155 // ScrollBarThumb |
156 | 156 |
157 ScrollBarThumb::ScrollBarThumb(BaseScrollBar* scroll_bar) | 157 ScrollBarThumb::ScrollBarThumb(BaseScrollBar* scroll_bar) |
158 : BaseScrollBarThumb(scroll_bar), | 158 : BaseScrollBarThumb(scroll_bar), |
159 scroll_bar_(scroll_bar) { | 159 scroll_bar_(scroll_bar) { |
160 set_focusable(false); | 160 SetFocusable(false); |
161 set_accessibility_focusable(false); | 161 SetAccessibilityFocusable(false); |
162 } | 162 } |
163 | 163 |
164 ScrollBarThumb::~ScrollBarThumb() { | 164 ScrollBarThumb::~ScrollBarThumb() { |
165 } | 165 } |
166 | 166 |
167 gfx::Size ScrollBarThumb::GetPreferredSize() { | 167 gfx::Size ScrollBarThumb::GetPreferredSize() { |
168 return GetNativeTheme()->GetPartSize(GetNativeThemePart(), | 168 return GetNativeTheme()->GetPartSize(GetNativeThemePart(), |
169 GetNativeThemeState(), | 169 GetNativeThemeState(), |
170 GetNativeThemeParams()); | 170 GetNativeThemeParams()); |
171 } | 171 } |
(...skipping 243 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 |