OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/accessibility/ax_node_data.h" | 5 #include "ui/accessibility/ax_node_data.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <set> | 10 #include <set> |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 FirstIs<FirstType, SecondType>(first)); | 85 FirstIs<FirstType, SecondType>(first)); |
86 } | 86 } |
87 | 87 |
88 } // namespace | 88 } // namespace |
89 | 89 |
90 // Return true if |attr| is a node ID that would need to be mapped when | 90 // Return true if |attr| is a node ID that would need to be mapped when |
91 // renumbering the ids in a combined tree. | 91 // renumbering the ids in a combined tree. |
92 bool IsNodeIdIntAttribute(AXIntAttribute attr) { | 92 bool IsNodeIdIntAttribute(AXIntAttribute attr) { |
93 switch (attr) { | 93 switch (attr) { |
94 case AX_ATTR_ACTIVEDESCENDANT_ID: | 94 case AX_ATTR_ACTIVEDESCENDANT_ID: |
| 95 case AX_ATTR_DETAILS_ID: |
95 case AX_ATTR_ERRORMESSAGE_ID: | 96 case AX_ATTR_ERRORMESSAGE_ID: |
96 case AX_ATTR_IN_PAGE_LINK_TARGET_ID: | 97 case AX_ATTR_IN_PAGE_LINK_TARGET_ID: |
97 case AX_ATTR_MEMBER_OF_ID: | 98 case AX_ATTR_MEMBER_OF_ID: |
98 case AX_ATTR_NEXT_ON_LINE_ID: | 99 case AX_ATTR_NEXT_ON_LINE_ID: |
99 case AX_ATTR_PREVIOUS_ON_LINE_ID: | 100 case AX_ATTR_PREVIOUS_ON_LINE_ID: |
100 case AX_ATTR_TABLE_HEADER_ID: | 101 case AX_ATTR_TABLE_HEADER_ID: |
101 case AX_ATTR_TABLE_COLUMN_HEADER_ID: | 102 case AX_ATTR_TABLE_COLUMN_HEADER_ID: |
102 case AX_ATTR_TABLE_ROW_HEADER_ID: | 103 case AX_ATTR_TABLE_ROW_HEADER_ID: |
103 return true; | 104 return true; |
104 | 105 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 return false; | 151 return false; |
151 } | 152 } |
152 | 153 |
153 // Return true if |attr| contains a vector of node ids that would need | 154 // Return true if |attr| contains a vector of node ids that would need |
154 // to be mapped when renumbering the ids in a combined tree. | 155 // to be mapped when renumbering the ids in a combined tree. |
155 bool IsNodeIdIntListAttribute(AXIntListAttribute attr) { | 156 bool IsNodeIdIntListAttribute(AXIntListAttribute attr) { |
156 switch (attr) { | 157 switch (attr) { |
157 case AX_ATTR_CELL_IDS: | 158 case AX_ATTR_CELL_IDS: |
158 case AX_ATTR_CONTROLS_IDS: | 159 case AX_ATTR_CONTROLS_IDS: |
159 case AX_ATTR_DESCRIBEDBY_IDS: | 160 case AX_ATTR_DESCRIBEDBY_IDS: |
160 case AX_ATTR_DETAILS_IDS: | |
161 case AX_ATTR_FLOWTO_IDS: | 161 case AX_ATTR_FLOWTO_IDS: |
162 case AX_ATTR_INDIRECT_CHILD_IDS: | 162 case AX_ATTR_INDIRECT_CHILD_IDS: |
163 case AX_ATTR_LABELLEDBY_IDS: | 163 case AX_ATTR_LABELLEDBY_IDS: |
164 case AX_ATTR_RADIO_GROUP_IDS: | 164 case AX_ATTR_RADIO_GROUP_IDS: |
165 case AX_ATTR_UNIQUE_CELL_IDS: | 165 case AX_ATTR_UNIQUE_CELL_IDS: |
166 return true; | 166 return true; |
167 | 167 |
168 // Note: all of the attributes are included here explicitly, | 168 // Note: all of the attributes are included here explicitly, |
169 // rather than using "default:", so that it's a compiler error to | 169 // rather than using "default:", so that it's a compiler error to |
170 // add a new attribute without explicitly considering whether it's | 170 // add a new attribute without explicitly considering whether it's |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 ui::ToString(static_cast<AXNameFrom>(int_attributes[i].second)); | 617 ui::ToString(static_cast<AXNameFrom>(int_attributes[i].second)); |
618 break; | 618 break; |
619 case AX_ATTR_DESCRIPTION_FROM: | 619 case AX_ATTR_DESCRIPTION_FROM: |
620 result += " description_from=" + | 620 result += " description_from=" + |
621 ui::ToString( | 621 ui::ToString( |
622 static_cast<AXDescriptionFrom>(int_attributes[i].second)); | 622 static_cast<AXDescriptionFrom>(int_attributes[i].second)); |
623 break; | 623 break; |
624 case AX_ATTR_ACTIVEDESCENDANT_ID: | 624 case AX_ATTR_ACTIVEDESCENDANT_ID: |
625 result += " activedescendant=" + value; | 625 result += " activedescendant=" + value; |
626 break; | 626 break; |
| 627 case AX_ATTR_DETAILS_ID: |
| 628 result += " details=" + value; |
| 629 break; |
627 case AX_ATTR_ERRORMESSAGE_ID: | 630 case AX_ATTR_ERRORMESSAGE_ID: |
628 result += " errormessage=" + value; | 631 result += " errormessage=" + value; |
629 break; | 632 break; |
630 case AX_ATTR_IN_PAGE_LINK_TARGET_ID: | 633 case AX_ATTR_IN_PAGE_LINK_TARGET_ID: |
631 result += " in_page_link_target_id=" + value; | 634 result += " in_page_link_target_id=" + value; |
632 break; | 635 break; |
633 case AX_ATTR_MEMBER_OF_ID: | 636 case AX_ATTR_MEMBER_OF_ID: |
634 result += " member_of_id=" + value; | 637 result += " member_of_id=" + value; |
635 break; | 638 break; |
636 case AX_ATTR_NEXT_ON_LINE_ID: | 639 case AX_ATTR_NEXT_ON_LINE_ID: |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 switch (intlist_attributes[i].first) { | 888 switch (intlist_attributes[i].first) { |
886 case AX_ATTR_INDIRECT_CHILD_IDS: | 889 case AX_ATTR_INDIRECT_CHILD_IDS: |
887 result += " indirect_child_ids=" + IntVectorToString(values); | 890 result += " indirect_child_ids=" + IntVectorToString(values); |
888 break; | 891 break; |
889 case AX_ATTR_CONTROLS_IDS: | 892 case AX_ATTR_CONTROLS_IDS: |
890 result += " controls_ids=" + IntVectorToString(values); | 893 result += " controls_ids=" + IntVectorToString(values); |
891 break; | 894 break; |
892 case AX_ATTR_DESCRIBEDBY_IDS: | 895 case AX_ATTR_DESCRIBEDBY_IDS: |
893 result += " describedby_ids=" + IntVectorToString(values); | 896 result += " describedby_ids=" + IntVectorToString(values); |
894 break; | 897 break; |
895 case AX_ATTR_DETAILS_IDS: | |
896 result += " details_ids=" + IntVectorToString(values); | |
897 break; | |
898 case AX_ATTR_FLOWTO_IDS: | 898 case AX_ATTR_FLOWTO_IDS: |
899 result += " flowto_ids=" + IntVectorToString(values); | 899 result += " flowto_ids=" + IntVectorToString(values); |
900 break; | 900 break; |
901 case AX_ATTR_LABELLEDBY_IDS: | 901 case AX_ATTR_LABELLEDBY_IDS: |
902 result += " labelledby_ids=" + IntVectorToString(values); | 902 result += " labelledby_ids=" + IntVectorToString(values); |
903 break; | 903 break; |
904 case AX_ATTR_RADIO_GROUP_IDS: | 904 case AX_ATTR_RADIO_GROUP_IDS: |
905 result += " radio_group_ids=" + IntVectorToString(values); | 905 result += " radio_group_ids=" + IntVectorToString(values); |
906 break; | 906 break; |
907 case AX_ATTR_LINE_BREAKS: | 907 case AX_ATTR_LINE_BREAKS: |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 | 965 |
966 result += " actions=" + ActionsBitfieldToString(actions); | 966 result += " actions=" + ActionsBitfieldToString(actions); |
967 | 967 |
968 if (!child_ids.empty()) | 968 if (!child_ids.empty()) |
969 result += " child_ids=" + IntVectorToString(child_ids); | 969 result += " child_ids=" + IntVectorToString(child_ids); |
970 | 970 |
971 return result; | 971 return result; |
972 } | 972 } |
973 | 973 |
974 } // namespace ui | 974 } // namespace ui |
OLD | NEW |