| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // layer. Each platform subclass should implement this itself. | 77 // layer. Each platform subclass should implement this itself. |
| 78 // The definition of a leaf may vary depending on the platform, | 78 // The definition of a leaf may vary depending on the platform, |
| 79 // but a leaf node should never have children that are focusable or | 79 // but a leaf node should never have children that are focusable or |
| 80 // that might send notifications. | 80 // that might send notifications. |
| 81 virtual bool PlatformIsLeaf() const; | 81 virtual bool PlatformIsLeaf() const; |
| 82 | 82 |
| 83 // Returns the number of children of this object, or 0 if PlatformIsLeaf() | 83 // Returns the number of children of this object, or 0 if PlatformIsLeaf() |
| 84 // returns true. | 84 // returns true. |
| 85 uint32 PlatformChildCount() const; | 85 uint32 PlatformChildCount() const; |
| 86 | 86 |
| 87 // Return a pointer to the child at the given index, or NULL for an | 87 // Return a pointer to the child at the given index, or nullptr for an |
| 88 // invalid index. Returns NULL if PlatformIsLeaf() returns true. | 88 // invalid index. Returns nullptr if PlatformIsLeaf() returns true. |
| 89 BrowserAccessibility* PlatformGetChild(uint32 child_index) const; | 89 BrowserAccessibility* PlatformGetChild(uint32 child_index) const; |
| 90 | 90 |
| 91 // Return the previous sibling of this object, or NULL if it's the first | 91 // Return the previous sibling of this object, or nullptr if it's the first |
| 92 // child of its parent. | 92 // child of its parent. |
| 93 BrowserAccessibility* GetPreviousSibling(); | 93 BrowserAccessibility* GetPreviousSibling(); |
| 94 | 94 |
| 95 // Return the next sibling of this object, or NULL if it's the last child | 95 // Return the next sibling of this object, or nullptr if it's the last child |
| 96 // of its parent. | 96 // of its parent. |
| 97 BrowserAccessibility* GetNextSibling(); | 97 BrowserAccessibility* GetNextSibling(); |
| 98 | 98 |
| 99 // Returns the bounds of this object in coordinates relative to the | 99 // Returns the bounds of this object in coordinates relative to the |
| 100 // top-left corner of the overall web area. | 100 // top-left corner of the overall web area. |
| 101 gfx::Rect GetLocalBoundsRect() const; | 101 gfx::Rect GetLocalBoundsRect() const; |
| 102 | 102 |
| 103 // Returns the bounds of this object in screen coordinates. | 103 // Returns the bounds of this object in screen coordinates. |
| 104 gfx::Rect GetGlobalBoundsRect() const; | 104 gfx::Rect GetGlobalBoundsRect() const; |
| 105 | 105 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 131 virtual void NativeAddReference() { } | 131 virtual void NativeAddReference() { } |
| 132 | 132 |
| 133 // Subclasses should override this to support platform reference counting. | 133 // Subclasses should override this to support platform reference counting. |
| 134 virtual void NativeReleaseReference(); | 134 virtual void NativeReleaseReference(); |
| 135 | 135 |
| 136 // | 136 // |
| 137 // Accessors | 137 // Accessors |
| 138 // | 138 // |
| 139 | 139 |
| 140 BrowserAccessibilityManager* manager() const { return manager_; } | 140 BrowserAccessibilityManager* manager() const { return manager_; } |
| 141 bool instance_active() const { return node_ != NULL; } | 141 bool instance_active() const { return node_ != nullptr; } |
| 142 ui::AXNode* node() const { return node_; } | 142 ui::AXNode* node() const { return node_; } |
| 143 const std::string& name() const { return name_; } | 143 const std::string& name() const { return name_; } |
| 144 const std::string& value() const { return value_; } | 144 const std::string& value() const { return value_; } |
| 145 void set_name(const std::string& name) { name_ = name; } | 145 void set_name(const std::string& name) { name_ = name; } |
| 146 void set_value(const std::string& value) { value_ = value; } | 146 void set_value(const std::string& value) { value_ = value; } |
| 147 | 147 |
| 148 // These access the internal accessibility tree, which doesn't necessarily | 148 // These access the internal accessibility tree, which doesn't necessarily |
| 149 // reflect the accessibility tree that should be exposed on each platform. | 149 // reflect the accessibility tree that should be exposed on each platform. |
| 150 // Use PlatformChildCount and PlatformGetChild to implement platform | 150 // Use PlatformChildCount and PlatformGetChild to implement platform |
| 151 // accessibility APIs. | 151 // accessibility APIs. |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 263 |
| 264 std::string name_; | 264 std::string name_; |
| 265 std::string value_; | 265 std::string value_; |
| 266 | 266 |
| 267 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); | 267 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
| 268 }; | 268 }; |
| 269 | 269 |
| 270 } // namespace content | 270 } // namespace content |
| 271 | 271 |
| 272 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 272 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
| OLD | NEW |