Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 | 48 |
| 49 virtual ~BrowserAccessibility(); | 49 virtual ~BrowserAccessibility(); |
| 50 | 50 |
| 51 // Detach all descendants of this subtree and push all of the node pointers, | 51 // Detach all descendants of this subtree and push all of the node pointers, |
| 52 // including this node, onto the end of |nodes|. | 52 // including this node, onto the end of |nodes|. |
| 53 virtual void DetachTree(std::vector<BrowserAccessibility*>* nodes); | 53 virtual void DetachTree(std::vector<BrowserAccessibility*>* nodes); |
| 54 | 54 |
| 55 // Perform platform specific initialization. This can be called multiple times | 55 // Perform platform specific initialization. This can be called multiple times |
| 56 // during the lifetime of this instance after the members of this base object | 56 // during the lifetime of this instance after the members of this base object |
| 57 // have been reset with new values from the renderer process. | 57 // have been reset with new values from the renderer process. |
| 58 virtual void Initialize(); | 58 // Perform child independent initialization in this method. |
| 59 virtual void PreInitialize(); | |
|
dmazzoni
2011/12/02 23:33:42
I think you can make this one protected now, right
David Tseng
2011/12/03 00:17:13
Done.
On 2011/12/02 23:33:42, Dominic Mazzoni wrot
| |
| 60 | |
| 61 // Perform platform specific initialization. This can be called multiple times | |
| 62 // during the lifetime of this instance after the members of this base object | |
| 63 // have been reset with new values from the renderer process. | |
| 64 // Child dependent initialization can be done here. | |
| 65 virtual void PostInitialize(); | |
|
dmazzoni
2011/12/02 23:33:42
You don't need a non-argument version and a versio
David Tseng
2011/12/03 00:17:13
First went for the symetry with PreInitialize. Kep
| |
| 59 | 66 |
| 60 // Optionally send events triggered simply by the fact that this node | 67 // Optionally send events triggered simply by the fact that this node |
| 61 // has been created or modified (and has been attached to the tree). | 68 // has been created or modified (and has been attached to the tree). |
| 62 // This can include "show" events, "text changed" events in live regions, | 69 // This can include "show" events, "text changed" events in live regions, |
| 63 // or "alert" events. | 70 // or "alert" events. |
| 64 virtual void SendNodeUpdateEvents() {} | 71 virtual void SendNodeUpdateEvents() {} |
| 65 | 72 |
| 66 // Initialize this object, reading attributes from |src|. Does not | 73 // Initialize this object, reading attributes from |src|. Does not |
| 67 // recurse into children of |src| and build the whole subtree. | 74 // recurse into children of |src| and build the whole subtree. |
| 68 void Initialize(BrowserAccessibilityManager* manager, | 75 void PreInitialize(BrowserAccessibilityManager* manager, |
| 69 BrowserAccessibility* parent, | 76 BrowserAccessibility* parent, |
| 70 int32 child_id, | 77 int32 child_id, |
| 71 int32 index_in_parent, | 78 int32 index_in_parent, |
| 72 const WebAccessibility& src); | 79 const WebAccessibility& src); |
| 80 | |
| 81 // Initialize this object, reading attributes from |src|. Assumes that | |
| 82 // children of |this| have been populated. | |
| 83 void PostInitialize(BrowserAccessibilityManager* manager, | |
|
dmazzoni
2011/12/02 23:33:42
This shouldn't take any arguments.
David Tseng
2011/12/03 00:17:13
Done; (still needs to be virtual though) so keepin
| |
| 84 BrowserAccessibility* parent, | |
| 85 int32 child_id, | |
| 86 int32 index_in_parent, | |
| 87 const WebAccessibility& src); | |
| 73 | 88 |
| 74 // Add a child of this object. | 89 // Add a child of this object. |
| 75 void AddChild(BrowserAccessibility* child); | 90 void AddChild(BrowserAccessibility* child); |
| 76 | 91 |
| 77 // Update the parent and index in parent if this node has been moved. | 92 // Update the parent and index in parent if this node has been moved. |
| 78 void UpdateParent(BrowserAccessibility* parent, int index_in_parent); | 93 void UpdateParent(BrowserAccessibility* parent, int index_in_parent); |
| 79 | 94 |
| 80 // Return true if this object is equal to or a descendant of |ancestor|. | 95 // Return true if this object is equal to or a descendant of |ancestor|. |
| 81 bool IsDescendantOf(BrowserAccessibility* ancestor); | 96 bool IsDescendantOf(BrowserAccessibility* ancestor); |
| 82 | 97 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 270 // tree, a client may still be holding onto a pointer to this object, so | 285 // tree, a client may still be holding onto a pointer to this object, so |
| 271 // we mark it as inactive so that calls to any of this object's methods | 286 // we mark it as inactive so that calls to any of this object's methods |
| 272 // immediately return failure. | 287 // immediately return failure. |
| 273 bool instance_active_; | 288 bool instance_active_; |
| 274 | 289 |
| 275 private: | 290 private: |
| 276 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); | 291 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
| 277 }; | 292 }; |
| 278 | 293 |
| 279 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 294 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
| OLD | NEW |