From 0e98519d3b4a313160ee990ad5a2fcd074e6456e Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Tue, 16 Jun 2015 17:59:58 -0700 Subject: [PATCH] Set contentImage based on the passed-in image --- brightray/browser/notification_presenter_mac.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/brightray/browser/notification_presenter_mac.mm b/brightray/browser/notification_presenter_mac.mm index 3b0c736daa3c..198c83508747 100644 --- a/brightray/browser/notification_presenter_mac.mm +++ b/brightray/browser/notification_presenter_mac.mm @@ -7,9 +7,11 @@ #include "base/bind.h" #include "base/stl_util.h" +#include "base/mac/mac_util.h" #include "base/strings/sys_string_conversions.h" #include "content/public/common/platform_notification_data.h" #include "content/public/browser/desktop_notification_delegate.h" +#include "skia/ext/skia_utils_mac.h" #import @@ -47,6 +49,7 @@ void NotificationPresenterMac::ShowNotification( auto notification = [[NSUserNotification alloc] init]; notification.title = base::SysUTF16ToNSString(data.title); notification.informativeText = base::SysUTF16ToNSString(data.body); + notification.contentImage = gfx::SkBitmapToNSImageWithColorSpace(icon, base::mac::GetGenericRGBColorSpace()); notifications_map_[delegate.get()].reset(notification); [NSUserNotificationCenter.defaultUserNotificationCenter deliverNotification:notification];