| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 { NSAccessibilityVisibleCellsAttribute, @"visibleCells" }, | 102 { NSAccessibilityVisibleCellsAttribute, @"visibleCells" }, |
| 103 { NSAccessibilityVisibleChildrenAttribute, @"visibleChildren" }, | 103 { NSAccessibilityVisibleChildrenAttribute, @"visibleChildren" }, |
| 104 { NSAccessibilityVisibleColumnsAttribute, @"visibleColumns" }, | 104 { NSAccessibilityVisibleColumnsAttribute, @"visibleColumns" }, |
| 105 { NSAccessibilityVisibleRowsAttribute, @"visibleRows" }, | 105 { NSAccessibilityVisibleRowsAttribute, @"visibleRows" }, |
| 106 { NSAccessibilityWindowAttribute, @"window" }, | 106 { NSAccessibilityWindowAttribute, @"window" }, |
| 107 { @"AXAccessKey", @"accessKey" }, | 107 { @"AXAccessKey", @"accessKey" }, |
| 108 { @"AXARIAAtomic", @"ariaAtomic" }, | 108 { @"AXARIAAtomic", @"ariaAtomic" }, |
| 109 { @"AXARIABusy", @"ariaBusy" }, | 109 { @"AXARIABusy", @"ariaBusy" }, |
| 110 { @"AXARIALive", @"ariaLive" }, | 110 { @"AXARIALive", @"ariaLive" }, |
| 111 { @"AXARIARelevant", @"ariaRelevant" }, | 111 { @"AXARIARelevant", @"ariaRelevant" }, |
| 112 { @"AXDropEffects", @"dropeffect" }, |
| 112 { @"AXGrabbed", @"grabbed" }, | 113 { @"AXGrabbed", @"grabbed" }, |
| 113 { @"AXInvalid", @"invalid" }, | 114 { @"AXInvalid", @"invalid" }, |
| 114 { @"AXLoaded", @"loaded" }, | 115 { @"AXLoaded", @"loaded" }, |
| 115 { @"AXLoadingProgress", @"loadingProgress" }, | 116 { @"AXLoadingProgress", @"loadingProgress" }, |
| 116 { @"AXPlaceholder", @"placeholder" }, | 117 { @"AXPlaceholder", @"placeholder" }, |
| 117 { @"AXRequired", @"required" }, | 118 { @"AXRequired", @"required" }, |
| 118 { @"AXVisited", @"visited" }, | 119 { @"AXVisited", @"visited" }, |
| 119 }; | 120 }; |
| 120 | 121 |
| 121 NSMutableDictionary* dict = [[NSMutableDictionary alloc] init]; | 122 NSMutableDictionary* dict = [[NSMutableDictionary alloc] init]; |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 } else { | 321 } else { |
| 321 return nil; | 322 return nil; |
| 322 } | 323 } |
| 323 } | 324 } |
| 324 | 325 |
| 325 - (id)disclosedRows { | 326 - (id)disclosedRows { |
| 326 // The rows that are considered inside this row. | 327 // The rows that are considered inside this row. |
| 327 return nil; | 328 return nil; |
| 328 } | 329 } |
| 329 | 330 |
| 331 - (NSString*)dropeffect { |
| 332 return NSStringForStringAttribute( |
| 333 browserAccessibility_, ui::AX_ATTR_DROPEFFECT); |
| 334 } |
| 335 |
| 330 - (NSNumber*)enabled { | 336 - (NSNumber*)enabled { |
| 331 return [NSNumber numberWithBool: | 337 return [NSNumber numberWithBool: |
| 332 GetState(browserAccessibility_, ui::AX_STATE_ENABLED)]; | 338 GetState(browserAccessibility_, ui::AX_STATE_ENABLED)]; |
| 333 } | 339 } |
| 334 | 340 |
| 335 - (NSNumber*)expanded { | 341 - (NSNumber*)expanded { |
| 336 return [NSNumber numberWithBool: | 342 return [NSNumber numberWithBool: |
| 337 GetState(browserAccessibility_, ui::AX_STATE_EXPANDED)]; | 343 GetState(browserAccessibility_, ui::AX_STATE_EXPANDED)]; |
| 338 } | 344 } |
| 339 | 345 |
| (...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1385 [ret addObjectsFromArray:[NSArray arrayWithObjects: | 1391 [ret addObjectsFromArray:[NSArray arrayWithObjects: |
| 1386 @"AXARIAAtomic", | 1392 @"AXARIAAtomic", |
| 1387 nil]]; | 1393 nil]]; |
| 1388 } | 1394 } |
| 1389 if (browserAccessibility_->HasBoolAttribute( | 1395 if (browserAccessibility_->HasBoolAttribute( |
| 1390 ui::AX_ATTR_LIVE_BUSY)) { | 1396 ui::AX_ATTR_LIVE_BUSY)) { |
| 1391 [ret addObjectsFromArray:[NSArray arrayWithObjects: | 1397 [ret addObjectsFromArray:[NSArray arrayWithObjects: |
| 1392 @"AXARIABusy", | 1398 @"AXARIABusy", |
| 1393 nil]]; | 1399 nil]]; |
| 1394 } | 1400 } |
| 1401 |
| 1402 if (browserAccessibility_->HasStringAttribute( |
| 1403 ui::AX_ATTR_DROPEFFECT)) { |
| 1404 [ret addObjectsFromArray:[NSArray arrayWithObjects: |
| 1405 @"AXDropEffects", |
| 1406 nil]]; |
| 1407 } |
| 1408 |
| 1395 // Add aria-grabbed attribute only if it has true. | 1409 // Add aria-grabbed attribute only if it has true. |
| 1396 if (browserAccessibility_->HasBoolAttribute(ui::AX_ATTR_GRABBED)) { | 1410 if (browserAccessibility_->HasBoolAttribute(ui::AX_ATTR_GRABBED)) { |
| 1397 [ret addObjectsFromArray:[NSArray arrayWithObjects: | 1411 [ret addObjectsFromArray:[NSArray arrayWithObjects: |
| 1398 @"AXGrabbed", | 1412 @"AXGrabbed", |
| 1399 nil]]; | 1413 nil]]; |
| 1400 } | 1414 } |
| 1401 | 1415 |
| 1402 // Add expanded attribute only if it has expanded or collapsed state. | 1416 // Add expanded attribute only if it has expanded or collapsed state. |
| 1403 if (GetState(browserAccessibility_, ui::AX_STATE_EXPANDED) || | 1417 if (GetState(browserAccessibility_, ui::AX_STATE_EXPANDED) || |
| 1404 GetState(browserAccessibility_, ui::AX_STATE_COLLAPSED)) { | 1418 GetState(browserAccessibility_, ui::AX_STATE_COLLAPSED)) { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1577 if (!browserAccessibility_) | 1591 if (!browserAccessibility_) |
| 1578 return [super hash]; | 1592 return [super hash]; |
| 1579 return browserAccessibility_->GetId(); | 1593 return browserAccessibility_->GetId(); |
| 1580 } | 1594 } |
| 1581 | 1595 |
| 1582 - (BOOL)accessibilityShouldUseUniqueId { | 1596 - (BOOL)accessibilityShouldUseUniqueId { |
| 1583 return YES; | 1597 return YES; |
| 1584 } | 1598 } |
| 1585 | 1599 |
| 1586 @end | 1600 @end |
| OLD | NEW |