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/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" |
11 #include "base/strings/sys_string_conversions.h" | 11 #include "base/strings/sys_string_conversions.h" |
12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
13 #include "grit/ui_strings.h" | |
14 #include "skia/ext/skia_utils_mac.h" | 13 #include "skia/ext/skia_utils_mac.h" |
15 #import "ui/base/cocoa/hover_image_button.h" | 14 #import "ui/base/cocoa/hover_image_button.h" |
16 #include "ui/base/l10n/l10n_util_mac.h" | 15 #include "ui/base/l10n/l10n_util_mac.h" |
17 #include "ui/base/resource/resource_bundle.h" | 16 #include "ui/base/resource/resource_bundle.h" |
18 #include "ui/gfx/font_list.h" | 17 #include "ui/gfx/font_list.h" |
19 #include "ui/gfx/text_elider.h" | 18 #include "ui/gfx/text_elider.h" |
20 #include "ui/gfx/text_utils.h" | 19 #include "ui/gfx/text_utils.h" |
21 #include "ui/message_center/message_center.h" | 20 #include "ui/message_center/message_center.h" |
22 #include "ui/message_center/message_center_style.h" | 21 #include "ui/message_center/message_center_style.h" |
23 #include "ui/message_center/notification.h" | 22 #include "ui/message_center/notification.h" |
24 #include "ui/resources/grit/ui_resources.h" | 23 #include "ui/resources/grit/ui_resources.h" |
| 24 #include "ui/strings/grit/ui_strings.h" |
25 | 25 |
26 | 26 |
27 @interface MCNotificationProgressBar : NSProgressIndicator | 27 @interface MCNotificationProgressBar : NSProgressIndicator |
28 @end | 28 @end |
29 | 29 |
30 @implementation MCNotificationProgressBar | 30 @implementation MCNotificationProgressBar |
31 - (void)drawRect:(NSRect)dirtyRect { | 31 - (void)drawRect:(NSRect)dirtyRect { |
32 NSRect sliceRect, remainderRect; | 32 NSRect sliceRect, remainderRect; |
33 double progressFraction = ([self doubleValue] - [self minValue]) / | 33 double progressFraction = ([self doubleValue] - [self minValue]) / |
34 ([self maxValue] - [self minValue]); | 34 ([self maxValue] - [self minValue]); |
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 forFont:(NSFont*)nsfont | 890 forFont:(NSFont*)nsfont |
891 maxNumberOfLines:(size_t)lines { | 891 maxNumberOfLines:(size_t)lines { |
892 size_t unused; | 892 size_t unused; |
893 return [self wrapText:text | 893 return [self wrapText:text |
894 forFont:nsfont | 894 forFont:nsfont |
895 maxNumberOfLines:lines | 895 maxNumberOfLines:lines |
896 actualLines:&unused]; | 896 actualLines:&unused]; |
897 } | 897 } |
898 | 898 |
899 @end | 899 @end |
OLD | NEW |