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

Side by Side Diff: ui/accessibility/ax_node.h

Issue 2217363002: Use relative bounding boxes throughout Chrome accessibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback from aboxhall Created 4 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 unified diff | Download patch
« no previous file with comments | « ui/accessibility/accessibility.gyp ('k') | ui/accessibility/ax_node.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef UI_ACCESSIBILITY_AX_NODE_H_ 5 #ifndef UI_ACCESSIBILITY_AX_NODE_H_
6 #define UI_ACCESSIBILITY_AX_NODE_H_ 6 #define UI_ACCESSIBILITY_AX_NODE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 26 matching lines...) Expand all
37 // Get the child at the given index. 37 // Get the child at the given index.
38 AXNode* ChildAtIndex(int index) const { return children_[index]; } 38 AXNode* ChildAtIndex(int index) const { return children_[index]; }
39 39
40 // Set the node's accessibility data. This may be done during initial 40 // Set the node's accessibility data. This may be done during initial
41 // initialization or later when the node data changes. 41 // initialization or later when the node data changes.
42 void SetData(const AXNodeData& src); 42 void SetData(const AXNodeData& src);
43 43
44 // Update this node's location. This is separate from SetData just because 44 // Update this node's location. This is separate from SetData just because
45 // changing only the location is common and should be more efficient than 45 // changing only the location is common and should be more efficient than
46 // re-copying all of the data. 46 // re-copying all of the data.
47 void SetLocation(const gfx::RectF& new_location); 47 //
48 // The node's location is stored as a relative bounding box, the ID of
49 // the element it's relative to, and an optional transformation matrix.
50 // See ax_node_data.h for details.
51 void SetLocation(int offset_container_id,
52 const gfx::RectF& location,
53 gfx::Transform* transform);
48 54
49 // Set the index in parent, for example if siblings were inserted or deleted. 55 // Set the index in parent, for example if siblings were inserted or deleted.
50 void SetIndexInParent(int index_in_parent); 56 void SetIndexInParent(int index_in_parent);
51 57
52 // Swap the internal children vector with |children|. This instance 58 // Swap the internal children vector with |children|. This instance
53 // now owns all of the passed children. 59 // now owns all of the passed children.
54 void SwapChildren(std::vector<AXNode*>& children); 60 void SwapChildren(std::vector<AXNode*>& children);
55 61
56 // This is called when the AXTree no longer includes this node in the 62 // This is called when the AXTree no longer includes this node in the
57 // tree. Reference counting is used on some platforms because the 63 // tree. Reference counting is used on some platforms because the
58 // operating system may hold onto a reference to an AXNode 64 // operating system may hold onto a reference to an AXNode
59 // object even after we're through with it, so this may decrement the 65 // object even after we're through with it, so this may decrement the
60 // reference count and clear out the object's data. 66 // reference count and clear out the object's data.
61 void Destroy(); 67 void Destroy();
62 68
63 // Return true if this object is equal to or a descendant of |ancestor|. 69 // Return true if this object is equal to or a descendant of |ancestor|.
64 bool IsDescendantOf(AXNode* ancestor); 70 bool IsDescendantOf(AXNode* ancestor);
65 71
66 private: 72 private:
67 int index_in_parent_; 73 int index_in_parent_;
68 AXNode* parent_; 74 AXNode* parent_;
69 std::vector<AXNode*> children_; 75 std::vector<AXNode*> children_;
70 AXNodeData data_; 76 AXNodeData data_;
71 }; 77 };
72 78
73 } // namespace ui 79 } // namespace ui
74 80
75 #endif // UI_ACCESSIBILITY_AX_NODE_H_ 81 #endif // UI_ACCESSIBILITY_AX_NODE_H_
OLDNEW
« no previous file with comments | « ui/accessibility/accessibility.gyp ('k') | ui/accessibility/ax_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698