Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: content/browser/accessibility/browser_accessibility.h

Issue 2981083002: Migrate BrowserAccessibility windows unique id handling to AXPlatformNodeWin. (Closed)
Patch Set: Use after free no more Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/accessibility/browser_accessibility.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // 68 //
69 //////////////////////////////////////////////////////////////////////////////// 69 ////////////////////////////////////////////////////////////////////////////////
70 class CONTENT_EXPORT BrowserAccessibility : public ui::AXPlatformNodeDelegate { 70 class CONTENT_EXPORT BrowserAccessibility : public ui::AXPlatformNodeDelegate {
71 public: 71 public:
72 // Creates a platform specific BrowserAccessibility. Ownership passes to the 72 // Creates a platform specific BrowserAccessibility. Ownership passes to the
73 // caller. 73 // caller.
74 static BrowserAccessibility* Create(); 74 static BrowserAccessibility* Create();
75 75
76 virtual ~BrowserAccessibility(); 76 virtual ~BrowserAccessibility();
77 77
78 static BrowserAccessibility* GetFromUniqueID(int32_t unique_id);
79
80 // Called only once, immediately after construction. The constructor doesn't 78 // Called only once, immediately after construction. The constructor doesn't
81 // take any arguments because in the Windows subclass we use a special 79 // take any arguments because in the Windows subclass we use a special
82 // function to construct a COM object. 80 // function to construct a COM object.
83 virtual void Init(BrowserAccessibilityManager* manager, ui::AXNode* node); 81 virtual void Init(BrowserAccessibilityManager* manager, ui::AXNode* node);
84 82
85 // Called after the object is first initialized and again every time 83 // Called after the object is first initialized and again every time
86 // its data changes. 84 // its data changes.
87 virtual void OnDataChanged() {} 85 virtual void OnDataChanged() {}
88 86
89 virtual void OnSubtreeWillBeDeleted() {} 87 virtual void OnSubtreeWillBeDeleted() {}
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // Subclasses should override this to support platform reference counting. 198 // Subclasses should override this to support platform reference counting.
201 virtual void NativeReleaseReference(); 199 virtual void NativeReleaseReference();
202 200
203 // 201 //
204 // Accessors 202 // Accessors
205 // 203 //
206 204
207 BrowserAccessibilityManager* manager() const { return manager_; } 205 BrowserAccessibilityManager* manager() const { return manager_; }
208 bool instance_active() const { return node_ && manager_; } 206 bool instance_active() const { return node_ && manager_; }
209 ui::AXNode* node() const { return node_; } 207 ui::AXNode* node() const { return node_; }
210 int32_t unique_id() const { return unique_id_; }
211 208
212 // These access the internal accessibility tree, which doesn't necessarily 209 // These access the internal accessibility tree, which doesn't necessarily
213 // reflect the accessibility tree that should be exposed on each platform. 210 // reflect the accessibility tree that should be exposed on each platform.
214 // Use PlatformChildCount and PlatformGetChild to implement platform 211 // Use PlatformChildCount and PlatformGetChild to implement platform
215 // accessibility APIs. 212 // accessibility APIs.
216 uint32_t InternalChildCount() const; 213 uint32_t InternalChildCount() const;
217 BrowserAccessibility* InternalGetChild(uint32_t child_index) const; 214 BrowserAccessibility* InternalGetChild(uint32_t child_index) const;
218 BrowserAccessibility* InternalGetParent() const; 215 BrowserAccessibility* InternalGetParent() const;
219 216
220 BrowserAccessibility* PlatformGetParent() const; 217 BrowserAccessibility* PlatformGetParent() const;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 // special character in the place of every embedded object instead of its 364 // special character in the place of every embedded object instead of its
368 // text, depending on the platform. 365 // text, depending on the platform.
369 base::string16 GetInnerText() const; 366 base::string16 GetInnerText() const;
370 367
371 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); 368 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility);
372 }; 369 };
373 370
374 } // namespace content 371 } // namespace content
375 372
376 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ 373 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/accessibility/browser_accessibility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698