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

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 4163c40a3742095f01fec3da7cf14d44db94aae4..0b9b5b7efff15baccac6d05d8472f60bf9c979b2 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -1808,11 +1808,15 @@ void Textfield::ExecuteTextEditCommand(ui::TextEditCommand command) {
////////////////////////////////////////////////////////////////////////////////
// Textfield, private:
-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() {

Powered by Google App Engine
This is Rietveld 408576698