| 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 #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 Loading... |
| 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_ |
| OLD | NEW |