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

Unified Diff: ui/message_center/cocoa/notification_controller.mm

Issue 333643007: Fix progress bar indicator for accessibility. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: progress accessibility: CR comments per rsesek and dewittj Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/cocoa/notification_controller.mm
diff --git a/ui/message_center/cocoa/notification_controller.mm b/ui/message_center/cocoa/notification_controller.mm
index d2c8bf387c78655c690a77bcf9826822d38d9dc8..204f052835fabf261aba13bdbccc216b60049d5c 100644
--- a/ui/message_center/cocoa/notification_controller.mm
+++ b/ui/message_center/cocoa/notification_controller.mm
@@ -51,6 +51,21 @@
[gfx::SkColorToCalibratedNSColor(message_center::kProgressBarSliceColor) set];
[path fill];
}
+
+- (id)accessibilityAttributeValue:(NSString*)attribute {
+ double progressValue = 0.0;
+ if ([attribute isEqualToString:NSAccessibilityDescriptionAttribute]) {
+ progressValue = [self doubleValue];
+ } else if ([attribute isEqualToString:NSAccessibilityMinValueAttribute]) {
+ progressValue = [self minValue];
+ } else if ([attribute isEqualToString:NSAccessibilityMaxValueAttribute]) {
+ progressValue = [self maxValue];
+ } else {
+ return [super accessibilityAttributeValue:attribute];
+ }
+
+ return [NSString stringWithFormat:@"%lf", progressValue];
+}
@end
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698