Merge pull request #171 from miniak/notification_presenter_mac

Call [NSUserNotification setContentImage] conditionally using respondsToSelector
This commit is contained in:
Cheng Zhao 2015-11-12 00:09:51 +08:00
commit 5d03058e9e

View file

@ -48,7 +48,7 @@ void NotificationPresenterMac::ShowNotification(
notification.title = base::SysUTF16ToNSString(data.title);
notification.informativeText = base::SysUTF16ToNSString(data.body);
if (base::mac::IsOSYosemiteOrLater() && !icon.drawsNothing())
if ([notification respondsToSelector:@selector(setContentImage:)] && !icon.drawsNothing())
notification.contentImage = gfx::SkBitmapToNSImageWithColorSpace(icon, base::mac::GetGenericRGBColorSpace());
notifications_map_[delegate.get()].reset(notification);