| 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/scroll_bar_views.h" | 5 #include "ui/views/controls/scrollbar/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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 } | 195 } |
| 196 | 196 |
| 197 } // namespace | 197 } // namespace |
| 198 | 198 |
| 199 //////////////////////////////////////////////////////////////////////////////// | 199 //////////////////////////////////////////////////////////////////////////////// |
| 200 // ScrollBarViews, public: | 200 // ScrollBarViews, public: |
| 201 | 201 |
| 202 const char ScrollBarViews::kViewClassName[] = "ScrollBarViews"; | 202 const char ScrollBarViews::kViewClassName[] = "ScrollBarViews"; |
| 203 | 203 |
| 204 ScrollBarViews::ScrollBarViews(bool horizontal) | 204 ScrollBarViews::ScrollBarViews(bool horizontal) |
| 205 : BaseScrollBar(horizontal, new ScrollBarThumb(this)) { | 205 : BaseScrollBar(horizontal) { |
| 206 SetThumb(new ScrollBarThumb(this)); |
| 206 if (horizontal) { | 207 if (horizontal) { |
| 207 prev_button_ = new ScrollBarButton(this, ScrollBarButton::LEFT); | 208 prev_button_ = new ScrollBarButton(this, ScrollBarButton::LEFT); |
| 208 next_button_ = new ScrollBarButton(this, ScrollBarButton::RIGHT); | 209 next_button_ = new ScrollBarButton(this, ScrollBarButton::RIGHT); |
| 209 | 210 |
| 210 part_ = ui::NativeTheme::kScrollbarHorizontalTrack; | 211 part_ = ui::NativeTheme::kScrollbarHorizontalTrack; |
| 211 } else { | 212 } else { |
| 212 prev_button_ = new ScrollBarButton(this, ScrollBarButton::UP); | 213 prev_button_ = new ScrollBarButton(this, ScrollBarButton::UP); |
| 213 next_button_ = new ScrollBarButton(this, ScrollBarButton::DOWN); | 214 next_button_ = new ScrollBarButton(this, ScrollBarButton::DOWN); |
| 214 | 215 |
| 215 part_ = ui::NativeTheme::kScrollbarVerticalTrack; | 216 part_ = ui::NativeTheme::kScrollbarVerticalTrack; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 ui::NativeTheme::ExtraParams thumb_params; | 335 ui::NativeTheme::ExtraParams thumb_params; |
| 335 thumb_params.scrollbar_thumb.is_hovering = false; | 336 thumb_params.scrollbar_thumb.is_hovering = false; |
| 336 gfx::Size track_size = | 337 gfx::Size track_size = |
| 337 theme->GetPartSize(ui::NativeTheme::kScrollbarHorizontalThumb, | 338 theme->GetPartSize(ui::NativeTheme::kScrollbarHorizontalThumb, |
| 338 ui::NativeTheme::kNormal, thumb_params); | 339 ui::NativeTheme::kNormal, thumb_params); |
| 339 | 340 |
| 340 return std::max(track_size.height(), button_size.height()); | 341 return std::max(track_size.height(), button_size.height()); |
| 341 } | 342 } |
| 342 | 343 |
| 343 } // namespace views | 344 } // namespace views |
| OLD | NEW |