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

Unified Diff: ui/views/accessibility/ax_view_obj_wrapper.cc

Issue 667713006: Implement automatic load of composed/embedded automation trees (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 6 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/accessibility/ax_view_obj_wrapper.cc
diff --git a/ui/views/accessibility/ax_view_obj_wrapper.cc b/ui/views/accessibility/ax_view_obj_wrapper.cc
index b5c60775c752d93656689fd9b61cea7324d85723..9079e8c7762d11d55b96848fbd4fb091ca2c96c2 100644
--- a/ui/views/accessibility/ax_view_obj_wrapper.cc
+++ b/ui/views/accessibility/ax_view_obj_wrapper.cc
@@ -42,6 +42,7 @@ void AXViewObjWrapper::GetChildren(
void AXViewObjWrapper::Serialize(ui::AXNodeData* out_node_data) {
ui::AXViewState view_data;
view_->GetAccessibleState(&view_data);
+
out_node_data->id = GetID();
out_node_data->role = view_data.role;
@@ -58,10 +59,13 @@ void AXViewObjWrapper::Serialize(ui::AXNodeData* out_node_data) {
out_node_data->AddStringAttribute(
ui::AX_ATTR_VALUE, base::UTF16ToUTF8(view_data.value));
- out_node_data->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_START,
- view_data.selection_start);
- out_node_data->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_END,
- view_data.selection_end);
+ if (view_data.selection_start > -1 && view_data.selection_end > -1) {
+ out_node_data->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_START,
+ view_data.selection_start);
+
+ out_node_data->AddIntAttribute(ui::AX_ATTR_TEXT_SEL_END,
+ view_data.selection_end);
+ }
}
int32 AXViewObjWrapper::GetID() {

Powered by Google App Engine
This is Rietveld 408576698