| 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 <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 Loading... |
| 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 |
| 78 // Called only once, immediately after construction. The constructor doesn't | 80 // Called only once, immediately after construction. The constructor doesn't |
| 79 // take any arguments because in the Windows subclass we use a special | 81 // take any arguments because in the Windows subclass we use a special |
| 80 // function to construct a COM object. | 82 // function to construct a COM object. |
| 81 virtual void Init(BrowserAccessibilityManager* manager, ui::AXNode* node); | 83 virtual void Init(BrowserAccessibilityManager* manager, ui::AXNode* node); |
| 82 | 84 |
| 83 // Called after the object is first initialized and again every time | 85 // Called after the object is first initialized and again every time |
| 84 // its data changes. | 86 // its data changes. |
| 85 virtual void OnDataChanged() {} | 87 virtual void OnDataChanged() {} |
| 86 | 88 |
| 87 virtual void OnSubtreeWillBeDeleted() {} | 89 virtual void OnSubtreeWillBeDeleted() {} |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // Subclasses should override this to support platform reference counting. | 200 // Subclasses should override this to support platform reference counting. |
| 199 virtual void NativeReleaseReference(); | 201 virtual void NativeReleaseReference(); |
| 200 | 202 |
| 201 // | 203 // |
| 202 // Accessors | 204 // Accessors |
| 203 // | 205 // |
| 204 | 206 |
| 205 BrowserAccessibilityManager* manager() const { return manager_; } | 207 BrowserAccessibilityManager* manager() const { return manager_; } |
| 206 bool instance_active() const { return node_ && manager_; } | 208 bool instance_active() const { return node_ && manager_; } |
| 207 ui::AXNode* node() const { return node_; } | 209 ui::AXNode* node() const { return node_; } |
| 210 int32_t unique_id() const { return unique_id_; } |
| 208 | 211 |
| 209 // These access the internal accessibility tree, which doesn't necessarily | 212 // These access the internal accessibility tree, which doesn't necessarily |
| 210 // reflect the accessibility tree that should be exposed on each platform. | 213 // reflect the accessibility tree that should be exposed on each platform. |
| 211 // Use PlatformChildCount and PlatformGetChild to implement platform | 214 // Use PlatformChildCount and PlatformGetChild to implement platform |
| 212 // accessibility APIs. | 215 // accessibility APIs. |
| 213 uint32_t InternalChildCount() const; | 216 uint32_t InternalChildCount() const; |
| 214 BrowserAccessibility* InternalGetChild(uint32_t child_index) const; | 217 BrowserAccessibility* InternalGetChild(uint32_t child_index) const; |
| 215 BrowserAccessibility* InternalGetParent() const; | 218 BrowserAccessibility* InternalGetParent() const; |
| 216 | 219 |
| 217 BrowserAccessibility* PlatformGetParent() const; | 220 BrowserAccessibility* PlatformGetParent() const; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 // special character in the place of every embedded object instead of its | 367 // special character in the place of every embedded object instead of its |
| 365 // text, depending on the platform. | 368 // text, depending on the platform. |
| 366 base::string16 GetInnerText() const; | 369 base::string16 GetInnerText() const; |
| 367 | 370 |
| 368 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); | 371 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibility); |
| 369 }; | 372 }; |
| 370 | 373 |
| 371 } // namespace content | 374 } // namespace content |
| 372 | 375 |
| 373 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ | 376 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_H_ |
| OLD | NEW |