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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #import "ui/message_center/cocoa/notification_controller.h" 5 #import "ui/message_center/cocoa/notification_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/mac/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 if (progressFraction == 0.0) 45 if (progressFraction == 0.0)
46 return; 46 return;
47 47
48 path = [NSBezierPath bezierPathWithRoundedRect:sliceRect 48 path = [NSBezierPath bezierPathWithRoundedRect:sliceRect
49 xRadius:message_center::kProgressBarCornerRadius 49 xRadius:message_center::kProgressBarCornerRadius
50 yRadius:message_center::kProgressBarCornerRadius]; 50 yRadius:message_center::kProgressBarCornerRadius];
51 [gfx::SkColorToCalibratedNSColor(message_center::kProgressBarSliceColor) set]; 51 [gfx::SkColorToCalibratedNSColor(message_center::kProgressBarSliceColor) set];
52 [path fill]; 52 [path fill];
53 } 53 }
54
55 -(id)accessibilityAttributeValue:(NSString*)attribute {
dewittj 2014/06/12 21:04:19 Depending on how it looked, this may be more reada
Robert Sesek 2014/06/12 21:23:23 +1
Robert Sesek 2014/06/12 21:23:23 nit: space before ( after the -
Pete Williamson 2014/06/17 18:21:36 Both Done.
56 if ([attribute isEqualToString:NSAccessibilityDescriptionAttribute]) {
57 return [NSString stringWithFormat:@"%lf", [self doubleValue]];
58 } else if ([attribute isEqualToString:NSAccessibilityMinValueAttribute]) {
59 return [NSString stringWithFormat:@"%lf", [self minValue]];
60 } else if ([attribute isEqualToString:NSAccessibilityMaxValueAttribute]) {
61 return [NSString stringWithFormat:@"%lf", [self maxValue]];
62 }
63 return [super accessibilityAttributeValue:attribute];
64 }
54 @end 65 @end
55 66
56 //////////////////////////////////////////////////////////////////////////////// 67 ////////////////////////////////////////////////////////////////////////////////
57 @interface MCNotificationButton : NSButton 68 @interface MCNotificationButton : NSButton
58 @end 69 @end
59 70
60 @implementation MCNotificationButton 71 @implementation MCNotificationButton
61 // drawRect: needs to fill the button with a background, otherwise we don't get 72 // drawRect: needs to fill the button with a background, otherwise we don't get
62 // subpixel antialiasing. 73 // subpixel antialiasing.
63 - (void)drawRect:(NSRect)dirtyRect { 74 - (void)drawRect:(NSRect)dirtyRect {
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 forFont:(NSFont*)nsfont 857 forFont:(NSFont*)nsfont
847 maxNumberOfLines:(size_t)lines { 858 maxNumberOfLines:(size_t)lines {
848 size_t unused; 859 size_t unused;
849 return [self wrapText:text 860 return [self wrapText:text
850 forFont:nsfont 861 forFont:nsfont
851 maxNumberOfLines:lines 862 maxNumberOfLines:lines
852 actualLines:&unused]; 863 actualLines:&unused];
853 } 864 }
854 865
855 @end 866 @end
OLDNEW
« 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