Ensure we don't try to set contentImage on 10.7/10.8. That would be rude!
This commit is contained in:
parent
0e6e4b6c5e
commit
c3de789fd7
1 changed files with 4 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
#include "base/stl_util.h"
|
#include "base/stl_util.h"
|
||||||
#include "base/mac/mac_util.h"
|
#include "base/mac/mac_util.h"
|
||||||
|
#include "base/mac/sdk_forward_declarations.h"
|
||||||
#include "base/strings/sys_string_conversions.h"
|
#include "base/strings/sys_string_conversions.h"
|
||||||
#include "content/public/common/platform_notification_data.h"
|
#include "content/public/common/platform_notification_data.h"
|
||||||
#include "content/public/browser/desktop_notification_delegate.h"
|
#include "content/public/browser/desktop_notification_delegate.h"
|
||||||
|
@ -49,6 +50,8 @@ void NotificationPresenterMac::ShowNotification(
|
||||||
auto notification = [[NSUserNotification alloc] init];
|
auto notification = [[NSUserNotification alloc] init];
|
||||||
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 (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_9)
|
||||||
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