summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 21:40:49 +0000
committerdtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 21:40:49 +0000
commita6f790f1e21381a6e383082a193ee6c8ca919888 (patch)
treeb4260cf2af1acbcf322c849e81791e8f28322d0b
parent5472489991a1b85cc75ec0f8d95ed35b1213cf48 (diff)
downloadchromium_src-a6f790f1e21381a6e383082a193ee6c8ca919888.zip
chromium_src-a6f790f1e21381a6e383082a193ee6c8ca919888.tar.gz
chromium_src-a6f790f1e21381a6e383082a193ee6c8ca919888.tar.bz2
Add additional attributes to BrowserAccessibilityCocoa.
BUG=58804 TEST=Accessibility Inspector. Review URL: http://codereview.chromium.org/5183006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66823 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/accessibility/browser_accessibility_cocoa.mm27
1 files changed, 23 insertions, 4 deletions
diff --git a/chrome/browser/accessibility/browser_accessibility_cocoa.mm b/chrome/browser/accessibility/browser_accessibility_cocoa.mm
index 0a202ce..e03d1ed 100644
--- a/chrome/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/chrome/browser/accessibility/browser_accessibility_cocoa.mm
@@ -234,13 +234,24 @@ bool GetState(BrowserAccessibility* accessibility, int state) {
GetState(browserAccessibility_, WebAccessibility::STATE_FOCUSED)];
return ret;
}
- // TODO(dtseng): provide complete implementations for the following.
- if ([attribute isEqualToString:NSAccessibilityEnabledAttribute] ||
- [attribute isEqualToString:@"AXVisited"] ||
- [attribute isEqualToString:@"AXLoaded"]) {
+ if ([attribute isEqualToString:NSAccessibilityEnabledAttribute]) {
+ return [NSNumber numberWithBool:
+ !GetState(browserAccessibility_, WebAccessibility::STATE_UNAVAILABLE)];
+ }
+
+ // AXWebArea attributes.
+ if ([attribute isEqualToString:@"AXLoaded"])
return [NSNumber numberWithBool:YES];
+ if ([attribute isEqualToString:@"AXURL"]) {
+ return NSStringForWebAccessibilityAttribute(
+ browserAccessibility_->attributes(),
+ WebAccessibility::ATTR_DOC_URL);
}
+ // TODO(dtseng): provide complete implementations for the following.
+ if ([attribute isEqualToString:@"AXVisited"])
+ return [NSNumber numberWithBool:NO];
+
// Text related attributes.
if ([attribute isEqualToString:
NSAccessibilityNumberOfCharactersAttribute]) {
@@ -342,6 +353,14 @@ bool GetState(BrowserAccessibility* accessibility, int state) {
nil]];
// Specific role attributes.
+ if ([self role] == @"AXWebArea") {
+ [ret addObjectsFromArray:[NSArray arrayWithObjects:
+ @"AXLoaded",
+ @"AXURL",
+ @"AXVisited",
+ nil]];
+ }
+
if ([self role] == NSAccessibilityTextFieldRole) {
[ret addObjectsFromArray:[NSArray arrayWithObjects:
NSAccessibilityInsertionPointLineNumberAttribute,