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: Make set value callbacks not have a const bool |replace| arg. 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..76be4f3fa74e29e38cd0495b844159c8f9f7f337 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 replace) {
+ if (read_only())
+ return;
+ if (replace)
+ InsertOrReplaceText(new_value);
+ else
SetText(new_value);
- ClearSelection();
- }
+ ClearSelection();
}
void Textfield::UpdateBackgroundColor() {

Powered by Google App Engine
This is Rietveld 408576698