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

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

Issue 1768753003: Implemented the reporting of text style and language information on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated to using HashTable from base and GetInheritedStringAttribute instead of specialized methods… Created 4 years, 9 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 947575e6f7cd3bbb3c4b7745c01dcda39a98edad..5e14446f204088ecec21093d685d8ee3009ee938 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -1506,11 +1506,10 @@ bool InitializeAccessibilityTreeSearch(
return [NSNumber numberWithFloat:floatValue];
}
} else if ([role isEqualToString:NSAccessibilityColorWellRole]) {
- int color = browserAccessibility_->GetIntAttribute(
- ui::AX_ATTR_COLOR_VALUE);
- int red = (color >> 16) & 0xFF;
- int green = (color >> 8) & 0xFF;
- int blue = color & 0xFF;
+ unsigned int color = static_cast<unsigned int>(
+ browserAccessibility_->GetIntAttribute(ui::AX_ATTR_COLOR_VALUE));
+ unsigned int red, green, blue, alpha;
+ BrowserAccessibility::RGBAToColorValues(color, &red, &green, &blue, &alpha);
// This string matches the one returned by a native Mac color well.
return [NSString stringWithFormat:@"rgb %7.5f %7.5f %7.5f 1",
red / 255., green / 255., blue / 255.];

Powered by Google App Engine
This is Rietveld 408576698