Commit 14d5ea09 authored by dmazzoni@chromium.org's avatar dmazzoni@chromium.org

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
parent b3320bf3
...@@ -323,6 +323,8 @@ void NativeTextfieldViews::UpdateText() { ...@@ -323,6 +323,8 @@ void NativeTextfieldViews::UpdateText() {
model_->SetText(textfield_->text()); model_->SetText(textfield_->text());
OnCaretBoundsChanged(); OnCaretBoundsChanged();
SchedulePaint(); SchedulePaint();
textfield_->GetWidget()->NotifyAccessibilityEvent(
textfield_, ui::AccessibilityTypes::EVENT_TEXT_CHANGED, true);
} }
void NativeTextfieldViews::AppendText(const string16& text) { void NativeTextfieldViews::AppendText(const string16& text) {
...@@ -458,6 +460,8 @@ void NativeTextfieldViews::SelectRange(const ui::Range& range) { ...@@ -458,6 +460,8 @@ void NativeTextfieldViews::SelectRange(const ui::Range& range) {
model_->SelectRange(range); model_->SelectRange(range);
OnCaretBoundsChanged(); OnCaretBoundsChanged();
SchedulePaint(); SchedulePaint();
textfield_->GetWidget()->NotifyAccessibilityEvent(
textfield_, ui::AccessibilityTypes::EVENT_SELECTION_CHANGED, true);
} }
void NativeTextfieldViews::GetSelectionModel(gfx::SelectionModel* sel) const { void NativeTextfieldViews::GetSelectionModel(gfx::SelectionModel* sel) const {
...@@ -937,11 +941,20 @@ void NativeTextfieldViews::PropagateTextChange() { ...@@ -937,11 +941,20 @@ void NativeTextfieldViews::PropagateTextChange() {
void NativeTextfieldViews::UpdateAfterChange(bool text_changed, void NativeTextfieldViews::UpdateAfterChange(bool text_changed,
bool cursor_changed) { bool cursor_changed) {
if (text_changed) if (text_changed) {
PropagateTextChange(); PropagateTextChange();
textfield_->GetWidget()->NotifyAccessibilityEvent(
textfield_, ui::AccessibilityTypes::EVENT_TEXT_CHANGED, true);
}
if (cursor_changed) { if (cursor_changed) {
is_cursor_visible_ = true; is_cursor_visible_ = true;
RepaintCursor(); 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) { if (text_changed || cursor_changed) {
OnCaretBoundsChanged(); OnCaretBoundsChanged();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment