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

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

Issue 2341633006: MacViews/a11y: Allow accessibility clients to update the selected text. (Closed)
Patch Set: Review comments. Created 4 years, 2 months 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
Index: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index 835b10509babbaf1fe5147d13903fde02867f278..2ab27564ee4b4354f377bcfe825d7b0d4949d4b7 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -1824,11 +1824,15 @@ void Textfield::UpdateSelectionClipboard() {
#endif
}
-void Textfield::AccessibilitySetValue(const base::string16& new_value) {
- if (!read_only()) {
+void Textfield::AccessibilitySetValue(const base::string16& new_value,
+ bool clear_first) {
+ if (read_only())
+ return;
+ if (!clear_first)
+ InsertOrReplaceText(new_value);
+ else
SetText(new_value);
- ClearSelection();
- }
+ ClearSelection();
}
void Textfield::UpdateBackgroundColor() {
« no previous file with comments | « ui/views/controls/textfield/textfield.h ('k') | ui/views/widget/native_widget_mac_accessibility_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698