Call [NSUserNotification setContentImage] conditionally using respondsToSelector instead of hardcoded OS X version check

This commit is contained in:
Milan Burda 2015-11-10 22:18:24 +01:00
parent da0197543a
commit 71d582bc68

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);