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

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

Issue 2301833005: Get rid of AX_LINE_BREAKS attribute to improve performance. (Closed)
Patch Set: Re-worded comment. Created 4 years, 3 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 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // 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
63 // tree. Reference counting is used on some platforms because the 63 // tree. Reference counting is used on some platforms because the
64 // operating system may hold onto a reference to an AXNode 64 // operating system may hold onto a reference to an AXNode
65 // 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
66 // reference count and clear out the object's data. 66 // reference count and clear out the object's data.
67 void Destroy(); 67 void Destroy();
68 68
69 // 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|.
70 bool IsDescendantOf(AXNode* ancestor); 70 bool IsDescendantOf(AXNode* ancestor);
71 71
72 // Gets the text offsets where new lines start either from the node's data or
73 // by computing them and caching the result.
74 std::vector<int> GetOrComputeLineStartOffsets();
75
72 private: 76 private:
77 // Computes the text offset where each line starts by traversing all child
78 // leaf nodes.
79 void ComputeLineStartOffsets(std::vector<int>* line_offsets,
80 int* end_offset) const;
81
73 int index_in_parent_; 82 int index_in_parent_;
74 AXNode* parent_; 83 AXNode* parent_;
75 std::vector<AXNode*> children_; 84 std::vector<AXNode*> children_;
76 AXNodeData data_; 85 AXNodeData data_;
77 }; 86 };
78 87
79 } // namespace ui 88 } // namespace ui
80 89
81 #endif // UI_ACCESSIBILITY_AX_NODE_H_ 90 #endif // UI_ACCESSIBILITY_AX_NODE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698