| 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 d81f2b6ef1ad8514bcabd04e5fd7dbc3d27a5e66..fa2a9c4c0a369cf8bd48c27fc5cfcc39e88021f6 100644
|
| --- a/chrome/browser/ui/cocoa/notifications/alert_notification_service.mm
|
| +++ b/chrome/browser/ui/cocoa/notifications/alert_notification_service.mm
|
| @@ -59,4 +59,23 @@
|
| [transactionHandler_ closeTransactionIfNeeded];
|
| }
|
|
|
| +- (void)getDisplayedAlertIds:(NSString*)profileId
|
| + withReply:(void (^)(NSArray*))reply {
|
| + NSUserNotificationCenter* notificationCenter =
|
| + [NSUserNotificationCenter defaultUserNotificationCenter];
|
| + NSMutableArray* notificationIds = [NSMutableArray
|
| + arrayWithCapacity:[[notificationCenter deliveredNotifications] count]];
|
| + for (NSUserNotification* toast in
|
| + [notificationCenter deliveredNotifications]) {
|
| + NSString* candidateProfileId = [toast.userInfo
|
| + objectForKey:notification_constants::kNotificationProfileId];
|
| + if ([candidateProfileId isEqualToString:profileId]) {
|
| + [notificationIds
|
| + addObject:[toast.userInfo
|
| + objectForKey:notification_constants::kNotificationId]];
|
| + }
|
| + }
|
| + reply(notificationIds);
|
| +}
|
| +
|
| @end
|
|
|