diff options
author | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-02 06:03:33 +0000 |
---|---|---|
committer | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-02 06:03:33 +0000 |
commit | 8ead6723fffaf86e99e978387c8a92c9d57299c6 (patch) | |
tree | e3eef63d581d75990aeaf2de6ae0a0a47a6a7d20 /ui/views/controls | |
parent | 50244da163a30e0cf9a075092fcaeb8dc3f85936 (diff) | |
download | chromium_src-8ead6723fffaf86e99e978387c8a92c9d57299c6.zip chromium_src-8ead6723fffaf86e99e978387c8a92c9d57299c6.tar.gz chromium_src-8ead6723fffaf86e99e978387c8a92c9d57299c6.tar.bz2 |
Prevent the volume slider from sending accessibility events when updated via a system event.
BUG=chromium-os:29012
TEST=Turn on accessibility. Change the volume via the keyboard, then change it again while the popup is visible. Ensure the only audible feedback is the system earcon.
Review URL: http://codereview.chromium.org/10262030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134869 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/controls')
-rw-r--r-- | ui/views/controls/slider.cc | 3 | ||||
-rw-r--r-- | ui/views/controls/slider.h | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/ui/views/controls/slider.cc b/ui/views/controls/slider.cc index c41fc22..9c445c3 100644 --- a/ui/views/controls/slider.cc +++ b/ui/views/controls/slider.cc @@ -31,6 +31,7 @@ Slider::Slider(SliderListener* listener, Orientation orientation) keyboard_increment_(0.1f), animating_value_(0.f), value_is_valid_(false), + accessibility_events_enabled_(true), focus_border_color_(0) { EnableCanvasFlippingForRTLUI(true); set_focusable(true); @@ -73,7 +74,7 @@ void Slider::SetValueInternal(float value, SliderChangeReason reason) { } else { SchedulePaint(); } - if (GetWidget()) { + if (accessibility_events_enabled_ && GetWidget()) { GetWidget()->NotifyAccessibilityEvent( this, ui::AccessibilityTypes::EVENT_VALUE_CHANGED, true); } diff --git a/ui/views/controls/slider.h b/ui/views/controls/slider.h index 7434c8f..b85a600 100644 --- a/ui/views/controls/slider.h +++ b/ui/views/controls/slider.h @@ -60,6 +60,10 @@ class VIEWS_EXPORT Slider : public View, void SetAccessibleName(const string16& name); + void set_enable_accessibility_events(bool enabled) { + accessibility_events_enabled_ = enabled; + } + void set_focus_border_color(SkColor color) { focus_border_color_ = color; } private: @@ -93,6 +97,7 @@ class VIEWS_EXPORT Slider : public View, float animating_value_; bool value_is_valid_; string16 accessible_name_; + bool accessibility_events_enabled_; SkColor focus_border_color_; DISALLOW_COPY_AND_ASSIGN(Slider); |