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 #ifndef UI_VIEWS_CONTROLS_SLIDER_H_ | 5 #ifndef UI_VIEWS_CONTROLS_SLIDER_H_ |
6 #define UI_VIEWS_CONTROLS_SLIDER_H_ | 6 #define UI_VIEWS_CONTROLS_SLIDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/base/animation/animation_delegate.h" | 9 #include "ui/base/animation/animation_delegate.h" |
10 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 HORIZONTAL, | 41 HORIZONTAL, |
42 VERTICAL | 42 VERTICAL |
43 }; | 43 }; |
44 | 44 |
45 Slider(SliderListener* listener, Orientation orientation); | 45 Slider(SliderListener* listener, Orientation orientation); |
46 virtual ~Slider(); | 46 virtual ~Slider(); |
47 | 47 |
48 float value() const { return value_; } | 48 float value() const { return value_; } |
49 void SetValue(float value); | 49 void SetValue(float value); |
50 | 50 |
| 51 void SetAccessibleName(const string16& name); |
| 52 |
51 private: | 53 private: |
52 void SetValueInternal(float value, SliderChangeReason reason); | 54 void SetValueInternal(float value, SliderChangeReason reason); |
53 | 55 |
54 // views::View overrides: | 56 // views::View overrides: |
55 virtual gfx::Size GetPreferredSize() OVERRIDE; | 57 virtual gfx::Size GetPreferredSize() OVERRIDE; |
56 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 58 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
57 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; | 59 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; |
58 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE; | 60 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE; |
| 61 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
59 | 62 |
60 // ui::AnimationDelegate overrides: | 63 // ui::AnimationDelegate overrides: |
61 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 64 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
62 | 65 |
63 SliderListener* listener_; | 66 SliderListener* listener_; |
64 Orientation orientation_; | 67 Orientation orientation_; |
65 | 68 |
66 scoped_ptr<ui::SlideAnimation> move_animation_; | 69 scoped_ptr<ui::SlideAnimation> move_animation_; |
67 | 70 |
68 float value_; | 71 float value_; |
69 float animating_value_; | 72 float animating_value_; |
70 bool value_is_valid_; | 73 bool value_is_valid_; |
| 74 string16 accessible_name_; |
71 | 75 |
72 DISALLOW_COPY_AND_ASSIGN(Slider); | 76 DISALLOW_COPY_AND_ASSIGN(Slider); |
73 }; | 77 }; |
74 | 78 |
75 } // namespace views | 79 } // namespace views |
76 | 80 |
77 #endif // UI_VIEWS_CONTROLS_SLIDER_H_ | 81 #endif // UI_VIEWS_CONTROLS_SLIDER_H_ |
OLD | NEW |