From c3de789fd78a751bbcdd4e76d4d947c6033db7ce Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Wed, 17 Jun 2015 13:01:48 -0700 Subject: [PATCH] Ensure we don't try to set contentImage on 10.7/10.8. That would be rude! --- brightray/browser/notification_presenter_mac.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/brightray/browser/notification_presenter_mac.mm b/brightray/browser/notification_presenter_mac.mm index 198c83508747..02e2cb4f916f 100644 --- a/brightray/browser/notification_presenter_mac.mm +++ b/brightray/browser/notification_presenter_mac.mm @@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/stl_util.h" #include "base/mac/mac_util.h" +#include "base/mac/sdk_forward_declarations.h" #include "base/strings/sys_string_conversions.h" #include "content/public/common/platform_notification_data.h" #include "content/public/browser/desktop_notification_delegate.h" @@ -49,7 +50,9 @@ 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()); + + if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_9) + notification.contentImage = gfx::SkBitmapToNSImageWithColorSpace(icon, base::mac::GetGenericRGBColorSpace()); notifications_map_[delegate.get()].reset(notification); [NSUserNotificationCenter.defaultUserNotificationCenter deliverNotification:notification];