| Index: chrome/browser/ui/cocoa/notifications/alert_notification_service.mm
|
| diff --git a/chrome/browser/ui/cocoa/notifications/alert_notification_service.mm b/chrome/browser/ui/cocoa/notifications/alert_notification_service.mm
|
| index 522d42a935ba63e658ac3f69f2299258903fec4f..45e22f821884676fd880212af456a8a4ca7d3427 100644
|
| --- a/chrome/browser/ui/cocoa/notifications/alert_notification_service.mm
|
| +++ b/chrome/browser/ui/cocoa/notifications/alert_notification_service.mm
|
| @@ -6,6 +6,7 @@
|
|
|
| #import "base/mac/scoped_nsobject.h"
|
| #import "chrome/browser/ui/cocoa/notifications/notification_builder_mac.h"
|
| +#include "chrome/browser/ui/cocoa/notifications/notification_constants_mac.h"
|
|
|
| @class NSUserNotificationCenter;
|
|
|
| @@ -21,4 +22,29 @@
|
| deliverNotification:toast];
|
| }
|
|
|
| +- (void)closeNotificationWithId:(NSString*)notificationId
|
| + withProfileId:(NSString*)profileId {
|
| + NSUserNotificationCenter* notificationCenter =
|
| + [NSUserNotificationCenter defaultUserNotificationCenter];
|
| + for (NSUserNotification* candidate in
|
| + [notificationCenter deliveredNotifications]) {
|
| + NSString* candidateId = [candidate.userInfo
|
| + objectForKey:notification_constants::kNotificationId];
|
| +
|
| + NSString* candidateProfileId = [candidate.userInfo
|
| + objectForKey:notification_constants::kNotificationProfileId];
|
| +
|
| + if ([candidateId isEqualToString:notificationId] &&
|
| + [profileId isEqualToString:candidateProfileId]) {
|
| + [notificationCenter removeDeliveredNotification:candidate];
|
| + break;
|
| + }
|
| + }
|
| +}
|
| +
|
| +- (void)closeAllNotifications {
|
| + [[NSUserNotificationCenter defaultUserNotificationCenter]
|
| + removeAllDeliveredNotifications];
|
| +}
|
| +
|
| @end
|
|
|