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

Side by Side Diff: ui/accessibility/ax_tree_combiner.cc

Issue 2054393002: Implemented IAccessible2 reverse relations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_tree.h" 5 #include "ui/accessibility/ax_tree.h"
6 #include "ui/accessibility/ax_tree_combiner.h" 6 #include "ui/accessibility/ax_tree_combiner.h"
7 #include "ui/gfx/geometry/rect_f.h" 7 #include "ui/gfx/geometry/rect_f.h"
8 8
9 namespace ui { 9 namespace ui {
10 namespace { 10 namespace {
11 11
12 // Return true if |attr| is a node ID that would need to be mapped when 12 // Return true if |attr| is a node ID that would need to be mapped when
13 // renumbering the ids in a combined tree. 13 // renumbering the ids in a combined tree.
14 bool IsNodeIdIntAttribute(AXIntAttribute attr) { 14 bool IsNodeIdIntAttribute(AXIntAttribute attr) {
15 switch (attr) { 15 switch (attr) {
16 case AX_ATTR_ACTIVEDESCENDANT_ID: 16 case AX_ATTR_ACTIVEDESCENDANT_ID:
17 case AX_ATTR_MEMBER_OF_ID:
17 case AX_ATTR_NEXT_ON_LINE_ID: 18 case AX_ATTR_NEXT_ON_LINE_ID:
18 case AX_ATTR_PREVIOUS_ON_LINE_ID: 19 case AX_ATTR_PREVIOUS_ON_LINE_ID:
19 case AX_ATTR_TABLE_HEADER_ID: 20 case AX_ATTR_TABLE_HEADER_ID:
20 case AX_ATTR_TABLE_COLUMN_HEADER_ID: 21 case AX_ATTR_TABLE_COLUMN_HEADER_ID:
21 case AX_ATTR_TABLE_ROW_HEADER_ID: 22 case AX_ATTR_TABLE_ROW_HEADER_ID:
22 return true; 23 return true;
23 24
24 // Note: all of the attributes are included here explicitly, 25 // Note: all of the attributes are included here explicitly,
25 // rather than using "default:", so that it's a compiler error to 26 // rather than using "default:", so that it's a compiler error to
26 // add a new attribute without explicitly considering whether it's 27 // add a new attribute without explicitly considering whether it's
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 65 }
65 66
66 // Return true if |attr| contains a vector of node ids that would need 67 // Return true if |attr| contains a vector of node ids that would need
67 // to be mapped when renumbering the ids in a combined tree. 68 // to be mapped when renumbering the ids in a combined tree.
68 bool IsNodeIdIntListAttribute(AXIntListAttribute attr) { 69 bool IsNodeIdIntListAttribute(AXIntListAttribute attr) {
69 switch (attr) { 70 switch (attr) {
70 case AX_ATTR_CELL_IDS: 71 case AX_ATTR_CELL_IDS:
71 case AX_ATTR_CONTROLS_IDS: 72 case AX_ATTR_CONTROLS_IDS:
72 case AX_ATTR_DESCRIBEDBY_IDS: 73 case AX_ATTR_DESCRIBEDBY_IDS:
73 case AX_ATTR_FLOWTO_IDS: 74 case AX_ATTR_FLOWTO_IDS:
75 case AX_ATTR_LABELLEDBY_IDS:
dmazzoni 2016/06/13 05:41:18 This was sorted correctly before
74 case AX_ATTR_INDIRECT_CHILD_IDS: 76 case AX_ATTR_INDIRECT_CHILD_IDS:
75 case AX_ATTR_LABELLEDBY_IDS:
76 case AX_ATTR_UNIQUE_CELL_IDS: 77 case AX_ATTR_UNIQUE_CELL_IDS:
77 return true; 78 return true;
78 79
79 // Note: all of the attributes are included here explicitly, 80 // Note: all of the attributes are included here explicitly,
80 // rather than using "default:", so that it's a compiler error to 81 // rather than using "default:", so that it's a compiler error to
81 // add a new attribute without explicitly considering whether it's 82 // add a new attribute without explicitly considering whether it's
82 // a node id attribute or not. 83 // a node id attribute or not.
83 case AX_INT_LIST_ATTRIBUTE_NONE: 84 case AX_INT_LIST_ATTRIBUTE_NONE:
84 case AX_ATTR_LINE_BREAKS: 85 case AX_ATTR_LINE_BREAKS:
85 case AX_ATTR_MARKER_TYPES: 86 case AX_ATTR_MARKER_TYPES:
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // Recurse into the child tree now, if any. 234 // Recurse into the child tree now, if any.
234 if (child_tree) 235 if (child_tree)
235 ProcessTree(child_tree); 236 ProcessTree(child_tree);
236 } 237 }
237 238
238 // Reset the transform. 239 // Reset the transform.
239 transform_ = old_transform; 240 transform_ = old_transform;
240 } 241 }
241 242
242 } // namespace ui 243 } // namespace ui
OLDNEW
« content/browser/accessibility/browser_accessibility_win.cc ('K') | « ui/accessibility/ax_enums.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698