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

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

Issue 23441024: Implement put_accvalue for textfields and location bar. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 4 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 4787e4e4af6281a38cf26fa9327643a4eb52d391..d01a0f25a37e4039d4bde060dfc309bee5802f31 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -506,6 +506,9 @@ void Textfield::GetAccessibleState(ui::AccessibleViewState* state) {
const ui::Range range = native_wrapper_->GetSelectedRange();
state->selection_start = range.start();
state->selection_end = range.end();
+
+ state->set_value_callback = base::Bind(
msw 2013/08/31 20:22:36 nit: wrap the line after '='.
dmazzoni 2013/09/03 20:20:11 Done.
+ &Textfield::AccessibilitySetValue, base::Unretained(this));
msw 2013/08/31 20:22:36 Ditto; avoid base::Unretained with a new Textfield
}
ui::TextInputClient* Textfield::GetTextInputClient() {
@@ -554,6 +557,11 @@ gfx::Insets Textfield::GetTextInsets() const {
return insets;
}
+void Textfield::AccessibilitySetValue(const string16& new_value) {
+ SetText(new_value);
+ ClearSelection();
+}
+
////////////////////////////////////////////////////////////////////////////////
// NativeTextfieldWrapper, public:

Powered by Google App Engine
This is Rietveld 408576698