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_COCOA_H_ | 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COCOA_H_ |
6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COCOA_H_ | 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COCOA_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
11 #include "content/browser/accessibility/browser_accessibility.h" | 11 #include "content/browser/accessibility/browser_accessibility.h" |
12 #import "content/browser/accessibility/browser_accessibility_delegate_mac.h" | 12 #import "content/browser/accessibility/browser_accessibility_delegate_mac.h" |
13 #include "third_party/WebKit/public/web/WebAXEnums.h" | |
14 | 13 |
15 // BrowserAccessibilityCocoa is a cocoa wrapper around the BrowserAccessibility | 14 // BrowserAccessibilityCocoa is a cocoa wrapper around the BrowserAccessibility |
16 // object. The renderer converts webkit's accessibility tree into a | 15 // object. The renderer converts webkit's accessibility tree into a |
17 // WebAccessibility tree and passes it to the browser process over IPC. | 16 // WebAccessibility tree and passes it to the browser process over IPC. |
18 // This class converts it into a format Cocoa can query. | 17 // This class converts it into a format Cocoa can query. |
19 @interface BrowserAccessibilityCocoa : NSObject { | 18 @interface BrowserAccessibilityCocoa : NSObject { |
20 @private | 19 @private |
21 content::BrowserAccessibility* browserAccessibility_; | 20 content::BrowserAccessibility* browserAccessibility_; |
22 base::scoped_nsobject<NSMutableArray> children_; | 21 base::scoped_nsobject<NSMutableArray> children_; |
23 id<BrowserAccessibilityDelegateCocoa> delegate_; | 22 id<BrowserAccessibilityDelegateCocoa> delegate_; |
24 } | 23 } |
25 | 24 |
26 // This creates a cocoa browser accessibility object around | 25 // This creates a cocoa browser accessibility object around |
27 // the cross platform BrowserAccessibility object. The delegate is | 26 // the cross platform BrowserAccessibility object. The delegate is |
28 // used to communicate with the host renderer. None of these | 27 // used to communicate with the host renderer. None of these |
29 // parameters can be null. | 28 // parameters can be null. |
30 - (id)initWithObject:(content::BrowserAccessibility*)accessibility | 29 - (id)initWithObject:(content::BrowserAccessibility*)accessibility |
31 delegate:(id<BrowserAccessibilityDelegateCocoa>)delegate; | 30 delegate:(id<BrowserAccessibilityDelegateCocoa>)delegate; |
32 | 31 |
33 // Clear this object's pointer to the wrapped BrowserAccessibility object | 32 // Clear this object's pointer to the wrapped BrowserAccessibility object |
34 // because the wrapped object has been deleted, but this object may | 33 // because the wrapped object has been deleted, but this object may |
35 // persist if the system still has references to it. | 34 // persist if the system still has references to it. |
36 - (void)detach; | 35 - (void)detach; |
37 | 36 |
38 // Invalidate children for a non-ignored ancestor (including self). | 37 // Invalidate children for a non-ignored ancestor (including self). |
39 - (void)childrenChanged; | 38 - (void)childrenChanged; |
40 | 39 |
41 // Convenience method to get the internal, cross-platform role | 40 // Convenience method to get the internal, cross-platform role |
42 // from browserAccessibility_. | 41 // from browserAccessibility_. |
43 - (blink::WebAXRole)internalRole; | 42 - (ui::AXRole)internalRole; |
44 | 43 |
45 // Return the method name for the given attribute. For testing only. | 44 // Return the method name for the given attribute. For testing only. |
46 - (NSString*)methodNameForAttribute:(NSString*)attribute; | 45 - (NSString*)methodNameForAttribute:(NSString*)attribute; |
47 | 46 |
48 // Internally-used method. | 47 // Internally-used method. |
49 @property(nonatomic, readonly) NSPoint origin; | 48 @property(nonatomic, readonly) NSPoint origin; |
50 | 49 |
51 // Children is an array of BrowserAccessibility objects, representing | 50 // Children is an array of BrowserAccessibility objects, representing |
52 // the accessibility children of this object. | 51 // the accessibility children of this object. |
53 @property(nonatomic, readonly) NSString* accessKey; | 52 @property(nonatomic, readonly) NSString* accessKey; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 @property(nonatomic, readonly) NSString* valueDescription; | 102 @property(nonatomic, readonly) NSString* valueDescription; |
104 @property(nonatomic, readonly) NSValue* visibleCharacterRange; | 103 @property(nonatomic, readonly) NSValue* visibleCharacterRange; |
105 @property(nonatomic, readonly) NSArray* visibleCells; | 104 @property(nonatomic, readonly) NSArray* visibleCells; |
106 @property(nonatomic, readonly) NSArray* visibleColumns; | 105 @property(nonatomic, readonly) NSArray* visibleColumns; |
107 @property(nonatomic, readonly) NSArray* visibleRows; | 106 @property(nonatomic, readonly) NSArray* visibleRows; |
108 @property(nonatomic, readonly) NSNumber* visited; | 107 @property(nonatomic, readonly) NSNumber* visited; |
109 @property(nonatomic, readonly) id window; | 108 @property(nonatomic, readonly) id window; |
110 @end | 109 @end |
111 | 110 |
112 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COCOA_H_ | 111 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COCOA_H_ |
OLD | NEW |