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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "ui/views/controls/textfield/native_textfield_views.h" 5 #include "ui/views/controls/textfield/native_textfield_views.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 } 451 }
452 452
453 void NativeTextfieldViews::GetSelectedRange(ui::Range* range) const { 453 void NativeTextfieldViews::GetSelectedRange(ui::Range* range) const {
454 model_->GetSelectedRange(range); 454 model_->GetSelectedRange(range);
455 } 455 }
456 456
457 void NativeTextfieldViews::SelectRange(const ui::Range& range) { 457 void NativeTextfieldViews::SelectRange(const ui::Range& range) {
458 model_->SelectRange(range); 458 model_->SelectRange(range);
459 OnCaretBoundsChanged(); 459 OnCaretBoundsChanged();
460 SchedulePaint(); 460 SchedulePaint();
461 textfield_->GetWidget()->NotifyAccessibilityEvent(
sky 2011/12/07 17:10:01 I'm not familiar with EVENT_TEXT_CHANGED. Should i
dmazzoni 2011/12/07 17:25:35 TEXT_CHANGED implies SELECTION_CHANGED, but you're
462 textfield_, ui::AccessibilityTypes::EVENT_TEXT_CHANGED, true);
461 } 463 }
462 464
463 void NativeTextfieldViews::GetSelectionModel(gfx::SelectionModel* sel) const { 465 void NativeTextfieldViews::GetSelectionModel(gfx::SelectionModel* sel) const {
464 model_->GetSelectionModel(sel); 466 model_->GetSelectionModel(sel);
465 } 467 }
466 468
467 void NativeTextfieldViews::SelectSelectionModel( 469 void NativeTextfieldViews::SelectSelectionModel(
468 const gfx::SelectionModel& sel) { 470 const gfx::SelectionModel& sel) {
469 model_->SelectSelectionModel(sel); 471 model_->SelectSelectionModel(sel);
470 OnCaretBoundsChanged(); 472 OnCaretBoundsChanged();
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 bool cursor_changed) { 941 bool cursor_changed) {
940 if (text_changed) 942 if (text_changed)
941 PropagateTextChange(); 943 PropagateTextChange();
942 if (cursor_changed) { 944 if (cursor_changed) {
943 is_cursor_visible_ = true; 945 is_cursor_visible_ = true;
944 RepaintCursor(); 946 RepaintCursor();
945 } 947 }
946 if (text_changed || cursor_changed) { 948 if (text_changed || cursor_changed) {
947 OnCaretBoundsChanged(); 949 OnCaretBoundsChanged();
948 SchedulePaint(); 950 SchedulePaint();
951 textfield_->GetWidget()->NotifyAccessibilityEvent(
952 textfield_, ui::AccessibilityTypes::EVENT_TEXT_CHANGED, true);
949 } 953 }
950 } 954 }
951 955
952 void NativeTextfieldViews::UpdateContextMenu() { 956 void NativeTextfieldViews::UpdateContextMenu() {
953 if (!context_menu_contents_.get()) { 957 if (!context_menu_contents_.get()) {
954 context_menu_contents_.reset(new ui::SimpleMenuModel(this)); 958 context_menu_contents_.reset(new ui::SimpleMenuModel(this));
955 context_menu_contents_->AddItemWithStringId(IDS_APP_CUT, IDS_APP_CUT); 959 context_menu_contents_->AddItemWithStringId(IDS_APP_CUT, IDS_APP_CUT);
956 context_menu_contents_->AddItemWithStringId(IDS_APP_COPY, IDS_APP_COPY); 960 context_menu_contents_->AddItemWithStringId(IDS_APP_COPY, IDS_APP_COPY);
957 context_menu_contents_->AddItemWithStringId(IDS_APP_PASTE, IDS_APP_PASTE); 961 context_menu_contents_->AddItemWithStringId(IDS_APP_PASTE, IDS_APP_PASTE);
958 context_menu_contents_->AddItemWithStringId(IDS_APP_DELETE, IDS_APP_DELETE); 962 context_menu_contents_->AddItemWithStringId(IDS_APP_DELETE, IDS_APP_DELETE);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 1080
1077 #if defined(USE_AURA) 1081 #if defined(USE_AURA)
1078 // static 1082 // static
1079 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( 1083 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper(
1080 Textfield* field) { 1084 Textfield* field) {
1081 return new NativeTextfieldViews(field); 1085 return new NativeTextfieldViews(field);
1082 } 1086 }
1083 #endif 1087 #endif
1084 1088
1085 } // namespace views 1089 } // namespace views
OLDNEW
« 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