diff options
author | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-07 18:56:51 +0000 |
---|---|---|
committer | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-07 18:56:51 +0000 |
commit | 14d5ea0999bc034e0e847170b0a1edfe444d24eb (patch) | |
tree | a3f8f76de70f8b3c01063749e9fb5463c69a91fe /ui | |
parent | b3320bf39351d7840457b9f25461e9e0174c2551 (diff) | |
download | chromium_src-14d5ea0999bc034e0e847170b0a1edfe444d24eb.zip chromium_src-14d5ea0999bc034e0e847170b0a1edfe444d24eb.tar.gz chromium_src-14d5ea0999bc034e0e847170b0a1edfe444d24eb.tar.bz2 |
Send a11y events from NativeTextfieldViews when the state changes.
BUG=106716
TEST=On Chrome OS, manually test typing and autocompleting in the omnibox with accessibility turned on.
Review URL: http://codereview.chromium.org/8850001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113427 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/views/controls/textfield/native_textfield_views.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ui/views/controls/textfield/native_textfield_views.cc b/ui/views/controls/textfield/native_textfield_views.cc index 2163dbd..f3189ec 100644 --- a/ui/views/controls/textfield/native_textfield_views.cc +++ b/ui/views/controls/textfield/native_textfield_views.cc @@ -323,6 +323,8 @@ void NativeTextfieldViews::UpdateText() { model_->SetText(textfield_->text()); OnCaretBoundsChanged(); SchedulePaint(); + textfield_->GetWidget()->NotifyAccessibilityEvent( + textfield_, ui::AccessibilityTypes::EVENT_TEXT_CHANGED, true); } void NativeTextfieldViews::AppendText(const string16& text) { @@ -458,6 +460,8 @@ void NativeTextfieldViews::SelectRange(const ui::Range& range) { model_->SelectRange(range); OnCaretBoundsChanged(); SchedulePaint(); + textfield_->GetWidget()->NotifyAccessibilityEvent( + textfield_, ui::AccessibilityTypes::EVENT_SELECTION_CHANGED, true); } void NativeTextfieldViews::GetSelectionModel(gfx::SelectionModel* sel) const { @@ -937,11 +941,20 @@ void NativeTextfieldViews::PropagateTextChange() { void NativeTextfieldViews::UpdateAfterChange(bool text_changed, bool cursor_changed) { - if (text_changed) + if (text_changed) { PropagateTextChange(); + textfield_->GetWidget()->NotifyAccessibilityEvent( + textfield_, ui::AccessibilityTypes::EVENT_TEXT_CHANGED, true); + } if (cursor_changed) { is_cursor_visible_ = true; RepaintCursor(); + if (!text_changed) { + // TEXT_CHANGED implies SELECTION_CHANGED, so we only need to fire + // this if only the selection changed. + textfield_->GetWidget()->NotifyAccessibilityEvent( + textfield_, ui::AccessibilityTypes::EVENT_SELECTION_CHANGED, true); + } } if (text_changed || cursor_changed) { OnCaretBoundsChanged(); |