Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Unified Diff: content/browser/accessibility/browser_accessibility_cocoa.mm

Issue 1162263008: Exposes datetime attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: re-upload due to browser_accessibility_cocoa.mm Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/accessibility/browser_accessibility_cocoa.mm
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
index 6a9c041399e61d2a618312a4f416c1e09b5b011b..2b5903bded0e369df569cbaf0b0699d7258e3329 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -623,8 +623,11 @@ bool InitializeAccessibilityTreeSearch(
}
- (NSString*)dropeffect {
- return NSStringForStringAttribute(
- browserAccessibility_, ui::AX_ATTR_DROPEFFECT);
+ std::string dropEffect;
+ if (browserAccessibility_->GetHtmlAttribute("aria-dropeffect", &dropEffect))
+ return base::SysUTF8ToNSString(dropEffect);
+
+ return nil;
}
- (NSNumber*)enabled {
@@ -645,8 +648,12 @@ bool InitializeAccessibilityTreeSearch(
}
- (NSNumber*)grabbed {
- bool boolValue = browserAccessibility_->GetBoolAttribute(ui::AX_ATTR_GRABBED);
- return [NSNumber numberWithBool:boolValue];
+ std::string grabbed;
+ if (browserAccessibility_->GetHtmlAttribute("aria-grabbed", &grabbed) &&
+ grabbed == "true")
+ return [NSNumber numberWithBool:YES];
+
+ return [NSNumber numberWithBool:NO];
}
- (id)header {
@@ -1784,15 +1791,15 @@ bool InitializeAccessibilityTreeSearch(
nil]];
}
- if (browserAccessibility_->HasStringAttribute(
- ui::AX_ATTR_DROPEFFECT)) {
+ std::string dropEffect;
+ if (browserAccessibility_->GetHtmlAttribute("aria-dropeffect", &dropEffect)) {
[ret addObjectsFromArray:[NSArray arrayWithObjects:
@"AXDropEffects",
nil]];
}
- // Add aria-grabbed attribute only if it has true.
- if (browserAccessibility_->HasBoolAttribute(ui::AX_ATTR_GRABBED)) {
+ std::string grabbed;
+ if (browserAccessibility_->GetHtmlAttribute("aria-grabbed", &grabbed)) {
[ret addObjectsFromArray:[NSArray arrayWithObjects:
@"AXGrabbed",
nil]];

Powered by Google App Engine
This is Rietveld 408576698