| 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/slider.h" | 5 #include "ui/views/controls/slider.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 orientation_(orientation), | 54 orientation_(orientation), |
| 55 value_(0.f), | 55 value_(0.f), |
| 56 keyboard_increment_(0.1f), | 56 keyboard_increment_(0.1f), |
| 57 animating_value_(0.f), | 57 animating_value_(0.f), |
| 58 value_is_valid_(false), | 58 value_is_valid_(false), |
| 59 accessibility_events_enabled_(true), | 59 accessibility_events_enabled_(true), |
| 60 focus_border_color_(0), | 60 focus_border_color_(0), |
| 61 bar_active_images_(kBarImagesActive), | 61 bar_active_images_(kBarImagesActive), |
| 62 bar_disabled_images_(kBarImagesDisabled) { | 62 bar_disabled_images_(kBarImagesDisabled) { |
| 63 EnableCanvasFlippingForRTLUI(true); | 63 EnableCanvasFlippingForRTLUI(true); |
| 64 set_focusable(true); | 64 SetFocusable(true); |
| 65 UpdateState(true); | 65 UpdateState(true); |
| 66 } | 66 } |
| 67 | 67 |
| 68 Slider::~Slider() { | 68 Slider::~Slider() { |
| 69 } | 69 } |
| 70 | 70 |
| 71 void Slider::SetValue(float value) { | 71 void Slider::SetValue(float value) { |
| 72 SetValueInternal(value, VALUE_CHANGED_BY_API); | 72 SetValueInternal(value, VALUE_CHANGED_BY_API); |
| 73 } | 73 } |
| 74 | 74 |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 } | 324 } |
| 325 | 325 |
| 326 void Slider::GetAccessibleState(ui::AccessibleViewState* state) { | 326 void Slider::GetAccessibleState(ui::AccessibleViewState* state) { |
| 327 state->role = ui::AccessibilityTypes::ROLE_SLIDER; | 327 state->role = ui::AccessibilityTypes::ROLE_SLIDER; |
| 328 state->name = accessible_name_; | 328 state->name = accessible_name_; |
| 329 state->value = UTF8ToUTF16( | 329 state->value = UTF8ToUTF16( |
| 330 base::StringPrintf("%d%%", (int)(value_ * 100 + 0.5))); | 330 base::StringPrintf("%d%%", (int)(value_ * 100 + 0.5))); |
| 331 } | 331 } |
| 332 | 332 |
| 333 } // namespace views | 333 } // namespace views |
| OLD | NEW |