Index: chrome/browser/notifications/notification_platform_bridge_mac.mm |
diff --git a/chrome/browser/notifications/notification_platform_bridge_mac.mm b/chrome/browser/notifications/notification_platform_bridge_mac.mm |
index 29277e13da0fd4a6712a8d6530ad8a0a15d2c625..249a9794ad29e0f125744cf425109cf57104e0aa 100644 |
--- a/chrome/browser/notifications/notification_platform_bridge_mac.mm |
+++ b/chrome/browser/notifications/notification_platform_bridge_mac.mm |
@@ -273,23 +273,25 @@ void NotificationPlatformBridgeMac::Close(const std::string& profile_id, |
#endif // ENABLE_XPC_NOTIFICATIONS |
} |
-bool NotificationPlatformBridgeMac::GetDisplayed( |
+void NotificationPlatformBridgeMac::GetDisplayed( |
const std::string& profile_id, |
bool incognito, |
- std::set<std::string>* notifications) const { |
- DCHECK(notifications); |
- |
+ const DisplayedNotificationsCallback& callback) const { |
+ auto displayed_notifications = base::MakeUnique<std::set<std::string>>(); |
NSString* current_profile_id = base::SysUTF8ToNSString(profile_id); |
for (NSUserNotification* toast in |
[notification_center_ deliveredNotifications]) { |
NSString* toast_profile_id = [toast.userInfo |
objectForKey:notification_constants::kNotificationProfileId]; |
if ([toast_profile_id isEqualToString:current_profile_id]) { |
- notifications->insert(base::SysNSStringToUTF8([toast.userInfo |
+ displayed_notifications->insert(base::SysNSStringToUTF8([toast.userInfo |
objectForKey:notification_constants::kNotificationId])); |
} |
} |
- return true; |
+ content::BrowserThread::PostTask( |
+ content::BrowserThread::UI, FROM_HERE, |
+ base::Bind(callback, base::Passed(&displayed_notifications), |
+ true /* supports sync */)); |
} |
// static |