| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_COCOA_BROWSER_ACCESSIBILITY_H | 5 #ifndef CHROME_BROWSER_COCOA_BROWSER_ACCESSIBILITY_H |
| 6 #define CHROME_BROWSER_COCOA_BROWSER_ACCESSIBILITY_H | 6 #define CHROME_BROWSER_COCOA_BROWSER_ACCESSIBILITY_H |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #import "base/scoped_nsobject.h" | 10 #import "base/scoped_nsobject.h" |
| 11 #include "chrome/browser/cocoa/browser_accessibility_delegate.h" | 11 #import "chrome/browser/cocoa/browser_accessibility_delegate.h" |
| 12 #include "webkit/glue/webaccessibility.h" | 12 #include "webkit/glue/webaccessibility.h" |
| 13 | 13 |
| 14 using webkit_glue::WebAccessibility; | 14 using webkit_glue::WebAccessibility; |
| 15 | 15 |
| 16 // BrowserAccessibility is a cocoa wrapper around the WebAccessibility | 16 // BrowserAccessibility is a cocoa wrapper around the WebAccessibility |
| 17 // object. The renderer converts webkit's accessibility tree into a | 17 // object. The renderer converts webkit's accessibility tree into a |
| 18 // WebAccessibility tree and passes it to us over IPC. This class | 18 // WebAccessibility tree and passes it to the browser process over IPC. |
| 19 // converts it into a format Cocoa can query. | 19 // This class converts it into a format Cocoa can query. |
| 20 @interface BrowserAccessibility : NSObject { | 20 @interface BrowserAccessibility : NSObject { |
| 21 @private | 21 @private |
| 22 WebAccessibility webAccessibility_; | 22 WebAccessibility webAccessibility_; |
| 23 id<BrowserAccessibilityDelegate> delegate_; | 23 id<BrowserAccessibilityDelegate> delegate_; |
| 24 scoped_nsobject<NSMutableArray> children_; | 24 scoped_nsobject<NSMutableArray> children_; |
| 25 // The parent of the accessibility object. This can be another | 25 // The parent of the accessibility object. This can be another |
| 26 // BrowserAccessibility or a RenderWidgetHostViewCocoa. | 26 // BrowserAccessibility or a RenderWidgetHostViewCocoa. |
| 27 id parent_; | 27 id parent_; // weak |
| 28 } | 28 } |
| 29 | 29 |
| 30 - (id)initWithObject:(const WebAccessibility)accessibility | 30 // This creates a cocoa browser accessibility object around |
| 31 // the webkit glue WebAccessibility object. The delegate is |
| 32 // used to communicate with the host renderer. None of these |
| 33 // parameters can be null. |
| 34 - (id)initWithObject:(const WebAccessibility&)accessibility |
| 31 delegate:(id<BrowserAccessibilityDelegate>)delegate | 35 delegate:(id<BrowserAccessibilityDelegate>)delegate |
| 32 parent:(id)parent; | 36 parent:(id)parent; |
| 33 | 37 |
| 38 // Children is an array of BrowserAccessibility objects, representing |
| 39 // the accessibility children of this object. |
| 34 @property(nonatomic, readonly) NSArray* children; | 40 @property(nonatomic, readonly) NSArray* children; |
| 41 // isIgnored returns whether or not the accessibility object |
| 42 // should be ignored by the accessibility hierarchy. |
| 35 @property(nonatomic, readonly, getter=isIgnored) BOOL ignored; | 43 @property(nonatomic, readonly, getter=isIgnored) BOOL ignored; |
| 44 // The origin of this object in the page's document. |
| 45 // This is relative to webkit's top-left origin, not Cocoa's |
| 46 // bottom-left origin. |
| 36 @property(nonatomic, readonly) NSPoint origin; | 47 @property(nonatomic, readonly) NSPoint origin; |
| 48 // A string indicating the role of this object as far as accessibility |
| 49 // is concerned. |
| 37 @property(nonatomic, readonly) NSString* role; | 50 @property(nonatomic, readonly) NSString* role; |
| 51 // The size of this object. |
| 38 @property(nonatomic, readonly) NSSize size; | 52 @property(nonatomic, readonly) NSSize size; |
| 39 | 53 |
| 40 @end | 54 @end |
| 41 | 55 |
| 42 #endif // CHROME_BROWSER_COCOA_BROWSER_ACCESSIBILITY_H | 56 #endif // CHROME_BROWSER_COCOA_BROWSER_ACCESSIBILITY_H |
| OLD | NEW |