| OLD | NEW |
| 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/status_item_view.h" | 5 #import "ui/message_center/cocoa/status_item_view.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 } | 170 } |
| 171 | 171 |
| 172 - (NSAttributedString*)unreadCountString { | 172 - (NSAttributedString*)unreadCountString { |
| 173 if (unreadCount_ == 0) | 173 if (unreadCount_ == 0) |
| 174 return nil; | 174 return nil; |
| 175 | 175 |
| 176 NSString* count = nil; | 176 NSString* count = nil; |
| 177 if (unreadCount_ > 9) | 177 if (unreadCount_ > 9) |
| 178 count = @"9+"; | 178 count = @"9+"; |
| 179 else | 179 else |
| 180 count = [NSString stringWithFormat:@"%"PRIuS, unreadCount_]; | 180 count = [NSString stringWithFormat:@"%" PRIuS, unreadCount_]; |
| 181 | 181 |
| 182 NSColor* fontColor = [self shouldHighlight] ? [NSColor whiteColor] | 182 NSColor* fontColor = [self shouldHighlight] ? [NSColor whiteColor] |
| 183 : [NSColor blackColor]; | 183 : [NSColor blackColor]; |
| 184 NSDictionary* attributes = @{ | 184 NSDictionary* attributes = @{ |
| 185 NSFontAttributeName: [NSFont fontWithName:@"Helvetica-Bold" size:12], | 185 NSFontAttributeName: [NSFont fontWithName:@"Helvetica-Bold" size:12], |
| 186 NSForegroundColorAttributeName: fontColor, | 186 NSForegroundColorAttributeName: fontColor, |
| 187 }; | 187 }; |
| 188 return [[[NSAttributedString alloc] initWithString:count | 188 return [[[NSAttributedString alloc] initWithString:count |
| 189 attributes:attributes] autorelease]; | 189 attributes:attributes] autorelease]; |
| 190 } | 190 } |
| 191 | 191 |
| 192 @end | 192 @end |
| OLD | NEW |