Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: ui/views/controls/textfield/native_textfield_views.cc

Issue 8850001: Send a11y events from NativeTextfieldViews when the state changes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/native_textfield_views.cc
===================================================================
--- ui/views/controls/textfield/native_textfield_views.cc (revision 112880)
+++ ui/views/controls/textfield/native_textfield_views.cc (working copy)
@@ -323,6 +323,8 @@
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 @@
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::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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698