| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 virtual void PostInitialize() {} | 63 virtual void PostInitialize() {} |
| 64 | 64 |
| 65 // Returns true if this is a native platform-specific object, vs a | 65 // Returns true if this is a native platform-specific object, vs a |
| 66 // cross-platform generic object. | 66 // cross-platform generic object. |
| 67 virtual bool IsNative() const; | 67 virtual bool IsNative() const; |
| 68 | 68 |
| 69 // Initialize the tree structure of this object. | 69 // Initialize the tree structure of this object. |
| 70 void InitializeTreeStructure( | 70 void InitializeTreeStructure( |
| 71 BrowserAccessibilityManager* manager, | 71 BrowserAccessibilityManager* manager, |
| 72 BrowserAccessibility* parent, | 72 BrowserAccessibility* parent, |
| 73 int32 child_id, | |
| 74 int32 renderer_id, | 73 int32 renderer_id, |
| 75 int32 index_in_parent); | 74 int32 index_in_parent); |
| 76 | 75 |
| 77 // Initialize this object's data. | 76 // Initialize this object's data. |
| 78 void InitializeData(const AccessibilityNodeData& src); | 77 void InitializeData(const AccessibilityNodeData& src); |
| 79 | 78 |
| 80 virtual void SwapChildren(std::vector<BrowserAccessibility*>& children); | 79 virtual void SwapChildren(std::vector<BrowserAccessibility*>& children); |
| 81 | 80 |
| 82 // Update the parent and index in parent if this node has been moved. | 81 // Update the parent and index in parent if this node has been moved. |
| 83 void UpdateParent(BrowserAccessibility* parent, int index_in_parent); | 82 void UpdateParent(BrowserAccessibility* parent, int index_in_parent); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } | 142 } |
| 144 | 143 |
| 145 const IntAttrMap& int_attributes() const { | 144 const IntAttrMap& int_attributes() const { |
| 146 return int_attributes_; | 145 return int_attributes_; |
| 147 } | 146 } |
| 148 | 147 |
| 149 const StringAttrMap& string_attributes() const { | 148 const StringAttrMap& string_attributes() const { |
| 150 return string_attributes_; | 149 return string_attributes_; |
| 151 } | 150 } |
| 152 | 151 |
| 153 int32 child_id() const { return child_id_; } | |
| 154 const std::vector<BrowserAccessibility*>& children() const { | 152 const std::vector<BrowserAccessibility*>& children() const { |
| 155 return children_; | 153 return children_; |
| 156 } | 154 } |
| 157 const std::vector<std::pair<string16, string16> >& html_attributes() const { | 155 const std::vector<std::pair<string16, string16> >& html_attributes() const { |
| 158 return html_attributes_; | 156 return html_attributes_; |
| 159 } | 157 } |
| 160 int32 index_in_parent() const { return index_in_parent_; } | 158 int32 index_in_parent() const { return index_in_parent_; } |
| 161 const std::vector<int32>& indirect_child_ids() const { | 159 const std::vector<int32>& indirect_child_ids() const { |
| 162 return indirect_child_ids_; | 160 return indirect_child_ids_; |
| 163 } | 161 } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 244 |
| 247 BrowserAccessibility(); | 245 BrowserAccessibility(); |
| 248 | 246 |
| 249 // The manager of this tree of accessibility objects; needed for | 247 // The manager of this tree of accessibility objects; needed for |
| 250 // global operations like focus tracking. | 248 // global operations like focus tracking. |
| 251 BrowserAccessibilityManager* manager_; | 249 BrowserAccessibilityManager* manager_; |
| 252 | 250 |
| 253 // The parent of this object, may be NULL if we're the root object. | 251 // The parent of this object, may be NULL if we're the root object. |
| 254 BrowserAccessibility* parent_; | 252 BrowserAccessibility* parent_; |
| 255 | 253 |
| 256 // The ID of this object; globally unique within the browser process. | |
| 257 int32 child_id_; | |
| 258 | |
| 259 // The index of this within its parent object. | 254 // The index of this within its parent object. |
| 260 int32 index_in_parent_; | 255 int32 index_in_parent_; |
| 261 | 256 |
| 262 // The ID of this object in the renderer process. | 257 // The ID of this object in the renderer process. |
| 263 int32 renderer_id_; | 258 int32 renderer_id_; |
| 264 | 259 |
| 265 // The children of this object. | 260 // The children of this object. |
| 266 std::vector<BrowserAccessibility*> children_; | 261 std::vector<BrowserAccessibility*> children_; |
| 267 | 262 |
| 268 // Accessibility metadata from the renderer | 263 // Accessibility metadata from the renderer |
| (...skipping 20 matching lines...) Expand all Loading... |
| 289 // immediately return failure. | 284 // immediately return failure. |
| 290 bool instance_active_; | 285 bool instance_active_; |
| 291 | 286 |
| 292 private: | 287 private: |
| 293 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); | 288 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
| 294 }; | 289 }; |
| 295 | 290 |
| 296 } // namespace content | 291 } // namespace content |
| 297 | 292 |
| 298 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 293 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
| OLD | NEW |