From c81bacc840a70009f50c2bf57d35b7e8b461bd1d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 25 Dec 2015 11:12:25 +0800 Subject: [PATCH] mac: Emit closed when notification is dismissed --- brightray/browser/mac/cocoa_notification.mm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/brightray/browser/mac/cocoa_notification.mm b/brightray/browser/mac/cocoa_notification.mm index 4b24e10f52b..24174e226a9 100644 --- a/brightray/browser/mac/cocoa_notification.mm +++ b/brightray/browser/mac/cocoa_notification.mm @@ -24,10 +24,8 @@ CocoaNotification::CocoaNotification(NotificationDelegate* delegate, } CocoaNotification::~CocoaNotification() { - if (notification_) { - [NSUserNotificationCenter.defaultUserNotificationCenter - removeDeliveredNotification:notification_]; - } + [NSUserNotificationCenter.defaultUserNotificationCenter + removeDeliveredNotification:notification_]; } void CocoaNotification::Show(const base::string16& title, @@ -50,6 +48,9 @@ void CocoaNotification::Show(const base::string16& title, } void CocoaNotification::Dismiss() { + [NSUserNotificationCenter.defaultUserNotificationCenter + removeDeliveredNotification:notification_]; + delegate()->NotificationClosed(); Destroy(); }