Check if image is empty.

This commit is contained in:
Cheng Zhao 2015-06-18 12:41:36 +08:00
parent a24d4cd0d9
commit 9fb30b702a

View file

@ -8,7 +8,6 @@
#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"
@ -51,7 +50,7 @@ void NotificationPresenterMac::ShowNotification(
notification.title = base::SysUTF16ToNSString(data.title);
notification.informativeText = base::SysUTF16ToNSString(data.body);
if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_9)
if (base::mac::IsOSYosemiteOrLater() && !icon.drawsNothing())
notification.contentImage = gfx::SkBitmapToNSImageWithColorSpace(icon, base::mac::GetGenericRGBColorSpace());
notifications_map_[delegate.get()].reset(notification);