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