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

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

Issue 2679313003: Implemented IA2::setSelection and related methods on text fields in Views. (Closed)
Patch Set: Created 3 years, 10 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 217bb57a1247b35ab9fe89594162a04427f8c6ba..c6cdafc79b58c94dc1d0f151b4babf1d1bc95de0 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -897,6 +897,12 @@ void Textfield::GetAccessibleNodeData(ui::AXNodeData* node_data) {
}
bool Textfield::HandleAccessibleAction(const ui::AXActionData& action_data) {
+ if (action_data.action == ui::AX_ACTION_SET_SELECTION) {
+ const gfx::Range range(action_data.anchor_offset, action_data.focus_offset);
+ SetSelectionRange(range);
+ }
+
+ // Remaining actions cannot be performed on readonly fields.
if (read_only())
return View::HandleAccessibleAction(action_data);

Powered by Google App Engine
This is Rietveld 408576698