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 | 6 |
7 #import "content/browser/accessibility/browser_accessibility_cocoa.h" | 7 #import "content/browser/accessibility/browser_accessibility_cocoa.h" |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 { NSAccessibilityColumnsAttribute, @"columns" }, | 62 { NSAccessibilityColumnsAttribute, @"columns" }, |
63 { NSAccessibilityColumnHeaderUIElementsAttribute, @"columnHeaders" }, | 63 { NSAccessibilityColumnHeaderUIElementsAttribute, @"columnHeaders" }, |
64 { NSAccessibilityColumnIndexRangeAttribute, @"columnIndexRange" }, | 64 { NSAccessibilityColumnIndexRangeAttribute, @"columnIndexRange" }, |
65 { NSAccessibilityContentsAttribute, @"contents" }, | 65 { NSAccessibilityContentsAttribute, @"contents" }, |
66 { NSAccessibilityDescriptionAttribute, @"description" }, | 66 { NSAccessibilityDescriptionAttribute, @"description" }, |
67 { NSAccessibilityDisclosingAttribute, @"disclosing" }, | 67 { NSAccessibilityDisclosingAttribute, @"disclosing" }, |
68 { NSAccessibilityDisclosedByRowAttribute, @"disclosedByRow" }, | 68 { NSAccessibilityDisclosedByRowAttribute, @"disclosedByRow" }, |
69 { NSAccessibilityDisclosureLevelAttribute, @"disclosureLevel" }, | 69 { NSAccessibilityDisclosureLevelAttribute, @"disclosureLevel" }, |
70 { NSAccessibilityDisclosedRowsAttribute, @"disclosedRows" }, | 70 { NSAccessibilityDisclosedRowsAttribute, @"disclosedRows" }, |
71 { NSAccessibilityEnabledAttribute, @"enabled" }, | 71 { NSAccessibilityEnabledAttribute, @"enabled" }, |
| 72 { NSAccessibilityExpandedAttribute, @"expanded" }, |
72 { NSAccessibilityFocusedAttribute, @"focused" }, | 73 { NSAccessibilityFocusedAttribute, @"focused" }, |
73 { NSAccessibilityHeaderAttribute, @"header" }, | 74 { NSAccessibilityHeaderAttribute, @"header" }, |
74 { NSAccessibilityHelpAttribute, @"help" }, | 75 { NSAccessibilityHelpAttribute, @"help" }, |
75 { NSAccessibilityIndexAttribute, @"index" }, | 76 { NSAccessibilityIndexAttribute, @"index" }, |
76 { NSAccessibilityLinkedUIElementsAttribute, @"linkedUIElements" }, | 77 { NSAccessibilityLinkedUIElementsAttribute, @"linkedUIElements" }, |
77 { NSAccessibilityMaxValueAttribute, @"maxValue" }, | 78 { NSAccessibilityMaxValueAttribute, @"maxValue" }, |
78 { NSAccessibilityMinValueAttribute, @"minValue" }, | 79 { NSAccessibilityMinValueAttribute, @"minValue" }, |
79 { NSAccessibilityNumberOfCharactersAttribute, @"numberOfCharacters" }, | 80 { NSAccessibilityNumberOfCharactersAttribute, @"numberOfCharacters" }, |
80 { NSAccessibilityOrientationAttribute, @"orientation" }, | 81 { NSAccessibilityOrientationAttribute, @"orientation" }, |
81 { NSAccessibilityParentAttribute, @"parent" }, | 82 { NSAccessibilityParentAttribute, @"parent" }, |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 - (id)disclosedRows { | 323 - (id)disclosedRows { |
323 // The rows that are considered inside this row. | 324 // The rows that are considered inside this row. |
324 return nil; | 325 return nil; |
325 } | 326 } |
326 | 327 |
327 - (NSNumber*)enabled { | 328 - (NSNumber*)enabled { |
328 return [NSNumber numberWithBool: | 329 return [NSNumber numberWithBool: |
329 GetState(browserAccessibility_, ui::AX_STATE_ENABLED)]; | 330 GetState(browserAccessibility_, ui::AX_STATE_ENABLED)]; |
330 } | 331 } |
331 | 332 |
| 333 - (NSNumber*)expanded { |
| 334 return [NSNumber numberWithBool: |
| 335 GetState(browserAccessibility_, ui::AX_STATE_EXPANDED)]; |
| 336 } |
| 337 |
332 - (NSNumber*)focused { | 338 - (NSNumber*)focused { |
333 BrowserAccessibilityManager* manager = browserAccessibility_->manager(); | 339 BrowserAccessibilityManager* manager = browserAccessibility_->manager(); |
334 NSNumber* ret = [NSNumber numberWithBool: | 340 NSNumber* ret = [NSNumber numberWithBool: |
335 manager->GetFocus(NULL) == browserAccessibility_]; | 341 manager->GetFocus(NULL) == browserAccessibility_]; |
336 return ret; | 342 return ret; |
337 } | 343 } |
338 | 344 |
339 - (id)header { | 345 - (id)header { |
340 int headerElementId = -1; | 346 int headerElementId = -1; |
341 if ([self internalRole] == ui::AX_ROLE_TABLE || | 347 if ([self internalRole] == ui::AX_ROLE_TABLE || |
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1169 // Returns the list of accessibility attributes that this object supports. | 1175 // Returns the list of accessibility attributes that this object supports. |
1170 - (NSArray*)accessibilityAttributeNames { | 1176 - (NSArray*)accessibilityAttributeNames { |
1171 if (!browserAccessibility_) | 1177 if (!browserAccessibility_) |
1172 return nil; | 1178 return nil; |
1173 | 1179 |
1174 // General attributes. | 1180 // General attributes. |
1175 NSMutableArray* ret = [NSMutableArray arrayWithObjects: | 1181 NSMutableArray* ret = [NSMutableArray arrayWithObjects: |
1176 NSAccessibilityChildrenAttribute, | 1182 NSAccessibilityChildrenAttribute, |
1177 NSAccessibilityDescriptionAttribute, | 1183 NSAccessibilityDescriptionAttribute, |
1178 NSAccessibilityEnabledAttribute, | 1184 NSAccessibilityEnabledAttribute, |
| 1185 NSAccessibilityExpandedAttribute, |
1179 NSAccessibilityFocusedAttribute, | 1186 NSAccessibilityFocusedAttribute, |
1180 NSAccessibilityHelpAttribute, | 1187 NSAccessibilityHelpAttribute, |
1181 NSAccessibilityLinkedUIElementsAttribute, | 1188 NSAccessibilityLinkedUIElementsAttribute, |
1182 NSAccessibilityParentAttribute, | 1189 NSAccessibilityParentAttribute, |
1183 NSAccessibilityPositionAttribute, | 1190 NSAccessibilityPositionAttribute, |
1184 NSAccessibilityRoleAttribute, | 1191 NSAccessibilityRoleAttribute, |
1185 NSAccessibilityRoleDescriptionAttribute, | 1192 NSAccessibilityRoleDescriptionAttribute, |
1186 NSAccessibilitySizeAttribute, | 1193 NSAccessibilitySizeAttribute, |
1187 NSAccessibilitySubroleAttribute, | 1194 NSAccessibilitySubroleAttribute, |
1188 NSAccessibilityTitleAttribute, | 1195 NSAccessibilityTitleAttribute, |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 return [super hash]; | 1466 return [super hash]; |
1460 return browserAccessibility_->GetId(); | 1467 return browserAccessibility_->GetId(); |
1461 } | 1468 } |
1462 | 1469 |
1463 - (BOOL)accessibilityShouldUseUniqueId { | 1470 - (BOOL)accessibilityShouldUseUniqueId { |
1464 return YES; | 1471 return YES; |
1465 } | 1472 } |
1466 | 1473 |
1467 @end | 1474 @end |
1468 | 1475 |
OLD | NEW |