OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/ui/cocoa/notifications/notification_builder_mac.h" | 5 #import "chrome/browser/ui/cocoa/notifications/notification_builder_mac.h" |
6 | 6 |
7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
8 | 8 |
9 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 116 |
117 - (void)setNotificationType:(NSNumber*)notificationType { | 117 - (void)setNotificationType:(NSNumber*)notificationType { |
118 [notificationData_ setObject:notificationType | 118 [notificationData_ setObject:notificationType |
119 forKey:notification_constants::kNotificationType]; | 119 forKey:notification_constants::kNotificationType]; |
120 } | 120 } |
121 | 121 |
122 - (NSUserNotification*)buildUserNotification { | 122 - (NSUserNotification*)buildUserNotification { |
123 base::scoped_nsobject<NSUserNotification> toast( | 123 base::scoped_nsobject<NSUserNotification> toast( |
124 [[NSUserNotification alloc] init]); | 124 [[NSUserNotification alloc] init]); |
125 [toast setTitle:[notificationData_ objectForKey:kNotificationTitle]]; | 125 [toast setTitle:[notificationData_ objectForKey:kNotificationTitle]]; |
126 [toast setSubtitle:[notificationData_ objectForKey:kNotificationSubTitle]]; | |
127 [toast setInformativeText:[notificationData_ | 126 [toast setInformativeText:[notificationData_ |
128 objectForKey:kNotificationInformativeText]]; | 127 objectForKey:kNotificationSubTitle]]; |
| 128 [toast setSubtitle:[notificationData_ |
| 129 objectForKey:kNotificationInformativeText]]; |
129 | 130 |
130 // Icon | 131 // Icon |
131 if ([notificationData_ objectForKey:kNotificationImage]) { | 132 if ([notificationData_ objectForKey:kNotificationImage]) { |
132 if ([toast respondsToSelector:@selector(_identityImage)]) { | 133 if ([toast respondsToSelector:@selector(_identityImage)]) { |
133 NSImage* image = [notificationData_ objectForKey:kNotificationImage]; | 134 NSImage* image = [notificationData_ objectForKey:kNotificationImage]; |
134 [toast setValue:image forKey:@"_identityImage"]; | 135 [toast setValue:image forKey:@"_identityImage"]; |
135 [toast setValue:@NO forKey:@"_identityImageHasBorder"]; | 136 [toast setValue:@NO forKey:@"_identityImageHasBorder"]; |
136 } | 137 } |
137 } | 138 } |
138 | 139 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 }; | 223 }; |
223 | 224 |
224 return toast.autorelease(); | 225 return toast.autorelease(); |
225 } | 226 } |
226 | 227 |
227 - (NSDictionary*)buildDictionary { | 228 - (NSDictionary*)buildDictionary { |
228 return [[notificationData_ copy] autorelease]; | 229 return [[notificationData_ copy] autorelease]; |
229 } | 230 } |
230 | 231 |
231 @end | 232 @end |
OLD | NEW |