| 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 #include <execinfo.h> | 5 #include <execinfo.h> |
| 6 #include <stddef.h> | 6 #include <stddef.h> |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #import "content/browser/accessibility/browser_accessibility_cocoa.h" | 9 #import "content/browser/accessibility/browser_accessibility_cocoa.h" |
| 10 | 10 |
| (...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 - (id)parent { | 1149 - (id)parent { |
| 1150 if (![self instanceActive]) | 1150 if (![self instanceActive]) |
| 1151 return nil; | 1151 return nil; |
| 1152 // A nil parent means we're the root. | 1152 // A nil parent means we're the root. |
| 1153 if (browserAccessibility_->GetParent()) { | 1153 if (browserAccessibility_->GetParent()) { |
| 1154 return NSAccessibilityUnignoredAncestor( | 1154 return NSAccessibilityUnignoredAncestor( |
| 1155 ToBrowserAccessibilityCocoa(browserAccessibility_->GetParent())); | 1155 ToBrowserAccessibilityCocoa(browserAccessibility_->GetParent())); |
| 1156 } else { | 1156 } else { |
| 1157 // Hook back up to RenderWidgetHostViewCocoa. | 1157 // Hook back up to RenderWidgetHostViewCocoa. |
| 1158 BrowserAccessibilityManagerMac* manager = | 1158 BrowserAccessibilityManagerMac* manager = |
| 1159 static_cast<BrowserAccessibilityManagerMac*>( | 1159 browserAccessibility_->manager()->GetRootManager() |
| 1160 browserAccessibility_->manager()); | 1160 ->ToBrowserAccessibilityManagerMac(); |
| 1161 return manager->parent_view(); | 1161 if (manager) |
| 1162 return manager->parent_view(); |
| 1163 return nil; |
| 1162 } | 1164 } |
| 1163 } | 1165 } |
| 1164 | 1166 |
| 1165 - (NSValue*)position { | 1167 - (NSValue*)position { |
| 1166 if (![self instanceActive]) | 1168 if (![self instanceActive]) |
| 1167 return nil; | 1169 return nil; |
| 1168 NSPoint origin = [self origin]; | 1170 NSPoint origin = [self origin]; |
| 1169 NSSize size = [[self size] sizeValue]; | 1171 NSSize size = [[self size] sizeValue]; |
| 1170 NSPoint pointInScreen = [self pointInScreen:origin size:size]; | 1172 NSPoint pointInScreen = [self pointInScreen:origin size:size]; |
| 1171 return [NSValue valueWithPoint:pointInScreen]; | 1173 return [NSValue valueWithPoint:pointInScreen]; |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1857 return nil; | 1859 return nil; |
| 1858 return [NSNumber numberWithBool: | 1860 return [NSNumber numberWithBool: |
| 1859 GetState(browserAccessibility_, ui::AX_STATE_VISITED)]; | 1861 GetState(browserAccessibility_, ui::AX_STATE_VISITED)]; |
| 1860 } | 1862 } |
| 1861 | 1863 |
| 1862 - (id)window { | 1864 - (id)window { |
| 1863 if (![self instanceActive]) | 1865 if (![self instanceActive]) |
| 1864 return nil; | 1866 return nil; |
| 1865 | 1867 |
| 1866 BrowserAccessibilityManagerMac* manager = | 1868 BrowserAccessibilityManagerMac* manager = |
| 1867 static_cast<BrowserAccessibilityManagerMac*>( | 1869 browserAccessibility_->manager()->GetRootManager() |
| 1868 browserAccessibility_->manager()); | 1870 ->ToBrowserAccessibilityManagerMac(); |
| 1869 if (!manager || !manager->parent_view()) | 1871 if (!manager || !manager->parent_view()) |
| 1870 return nil; | 1872 return nil; |
| 1871 | 1873 |
| 1872 return [manager->parent_view() window]; | 1874 return [manager->parent_view() window]; |
| 1873 } | 1875 } |
| 1874 | 1876 |
| 1875 - (NSString*)methodNameForAttribute:(NSString*)attribute { | 1877 - (NSString*)methodNameForAttribute:(NSString*)attribute { |
| 1876 return [attributeToMethodNameMap objectForKey:attribute]; | 1878 return [attributeToMethodNameMap objectForKey:attribute]; |
| 1877 } | 1879 } |
| 1878 | 1880 |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2613 if (![self instanceActive]) | 2615 if (![self instanceActive]) |
| 2614 return [super hash]; | 2616 return [super hash]; |
| 2615 return browserAccessibility_->GetId(); | 2617 return browserAccessibility_->GetId(); |
| 2616 } | 2618 } |
| 2617 | 2619 |
| 2618 - (BOOL)accessibilityShouldUseUniqueId { | 2620 - (BOOL)accessibilityShouldUseUniqueId { |
| 2619 return YES; | 2621 return YES; |
| 2620 } | 2622 } |
| 2621 | 2623 |
| 2622 @end | 2624 @end |
| OLD | NEW |