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

Unified Diff: chrome/browser/ui/cocoa/notifications/notification_builder_mac.mm

Issue 2764113004: [Mac] Revert to using the public API to display notification icons (Closed)
Patch Set: review Created 3 years, 9 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: chrome/browser/ui/cocoa/notifications/notification_builder_mac.mm
diff --git a/chrome/browser/ui/cocoa/notifications/notification_builder_mac.mm b/chrome/browser/ui/cocoa/notifications/notification_builder_mac.mm
index 5b3307afd4116ccc5bf41c381c312c5dc34551c2..e1c8a25813189eae6bc54a6fdd7f4aa34b0e3569 100644
--- a/chrome/browser/ui/cocoa/notifications/notification_builder_mac.mm
+++ b/chrome/browser/ui/cocoa/notifications/notification_builder_mac.mm
@@ -132,16 +132,13 @@ NSString* const kNotificationSettingsButtonTag = @"settingsButton";
// Icon
if ([notificationData_ objectForKey:kNotificationImage]) {
- if ([toast respondsToSelector:@selector(_identityImage)]) {
- if ([[NSImage class] conformsToProtocol:@protocol(NSSecureCoding)]) {
- NSImage* image = [notificationData_ objectForKey:kNotificationImage];
- [toast setValue:image forKey:@"_identityImage"];
- } else { // NSImage only conforms to NSSecureCoding from 10.10 onwards.
- base::scoped_nsobject<NSImage> image([[NSImage alloc]
- initWithData:[notificationData_ objectForKey:kNotificationImage]]);
- [toast setValue:image forKey:@"_identityImage"];
- }
- [toast setValue:@NO forKey:@"_identityImageHasBorder"];
+ if ([[NSImage class] conformsToProtocol:@protocol(NSSecureCoding)]) {
+ NSImage* image = [notificationData_ objectForKey:kNotificationImage];
+ [toast setContentImage:image];
+ } else { // NSImage only conforms to NSSecureCoding from 10.10 onwards.
+ base::scoped_nsobject<NSImage> image([[NSImage alloc]
+ initWithData:[notificationData_ objectForKey:kNotificationImage]]);
+ [toast setContentImage:image];
}
}
« 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