OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 | 82 |
83 // Return true if this object is equal to or a descendant of |ancestor|. | 83 // Return true if this object is equal to or a descendant of |ancestor|. |
84 bool IsDescendantOf(BrowserAccessibility* ancestor); | 84 bool IsDescendantOf(BrowserAccessibility* ancestor); |
85 | 85 |
86 // Returns the parent of this object, or NULL if it's the root. | 86 // Returns the parent of this object, or NULL if it's the root. |
87 BrowserAccessibility* parent() const { return parent_; } | 87 BrowserAccessibility* parent() const { return parent_; } |
88 | 88 |
89 // Returns the number of children of this object. | 89 // Returns the number of children of this object. |
90 uint32 child_count() const { return children_.size(); } | 90 uint32 child_count() const { return children_.size(); } |
91 | 91 |
92 // Return a pointer to the child with the given index. | 92 // Returns true if this is a leaf node on this platform, meaning any |
93 BrowserAccessibility* GetChild(uint32 child_index) const; | 93 // children should not be exposed to this platform's native accessibility |
94 // layer. Each platform subclass should implement this itself. | |
95 // The definition of a leaf may vary depending on the platform, | |
96 // but a leaf node should never have children that are focusable or | |
97 // that might send notifications. | |
98 virtual bool PlatformIsLeaf() const; | |
99 | |
100 // Returns the number of children of this object, or 0 if PlatformIsLeaf() | |
101 // returns true. | |
102 uint32 PlatformChildCount() const; | |
103 | |
104 // Return a pointer to the child at the given index, or NULL for an | |
105 // invalid index. Returns NULL is PlatformIsLeaf() returns true. | |
David Tseng
2013/10/31 19:44:48
s/is/if
| |
106 BrowserAccessibility* PlatformGetChild(uint32 child_index) const; | |
94 | 107 |
95 // Return the previous sibling of this object, or NULL if it's the first | 108 // Return the previous sibling of this object, or NULL if it's the first |
96 // child of its parent. | 109 // child of its parent. |
97 BrowserAccessibility* GetPreviousSibling(); | 110 BrowserAccessibility* GetPreviousSibling(); |
98 | 111 |
99 // Return the next sibling of this object, or NULL if it's the last child | 112 // Return the next sibling of this object, or NULL if it's the last child |
100 // of its parent. | 113 // of its parent. |
101 BrowserAccessibility* GetNextSibling(); | 114 BrowserAccessibility* GetNextSibling(); |
102 | 115 |
103 // Returns the bounds of this object in coordinates relative to the | 116 // Returns the bounds of this object in coordinates relative to the |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
291 // immediately return failure. | 304 // immediately return failure. |
292 bool instance_active_; | 305 bool instance_active_; |
293 | 306 |
294 private: | 307 private: |
295 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); | 308 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
296 }; | 309 }; |
297 | 310 |
298 } // namespace content | 311 } // namespace content |
299 | 312 |
300 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 313 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
OLD | NEW |