Merge pull request #171 from miniak/notification_presenter_mac
Call [NSUserNotification setContentImage] conditionally using respondsToSelector
This commit is contained in:
commit
5d03058e9e
1 changed files with 1 additions and 1 deletions
|
@ -48,7 +48,7 @@ void NotificationPresenterMac::ShowNotification(
|
||||||
notification.title = base::SysUTF16ToNSString(data.title);
|
notification.title = base::SysUTF16ToNSString(data.title);
|
||||||
notification.informativeText = base::SysUTF16ToNSString(data.body);
|
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());
|
notification.contentImage = gfx::SkBitmapToNSImageWithColorSpace(icon, base::mac::GetGenericRGBColorSpace());
|
||||||
|
|
||||||
notifications_map_[delegate.get()].reset(notification);
|
notifications_map_[delegate.get()].reset(notification);
|
||||||
|
|
Loading…
Reference in a new issue