Chromium Code Reviews| Index: chrome/browser/notifications/message_center_display_service.cc |
| diff --git a/chrome/browser/notifications/message_center_display_service.cc b/chrome/browser/notifications/message_center_display_service.cc |
| index 4ff6195539679db6630ccdf322ab00255048b322..4e7dfd9e9ce147e59cf9b49ab48a2a7b3096a097 100644 |
| --- a/chrome/browser/notifications/message_center_display_service.cc |
| +++ b/chrome/browser/notifications/message_center_display_service.cc |
| @@ -7,6 +7,7 @@ |
| #include "chrome/browser/notifications/notification.h" |
| #include "chrome/browser/notifications/notification_ui_manager.h" |
| #include "chrome/browser/profiles/profile.h" |
| +#include "content/public/browser/browser_thread.h" |
| MessageCenterDisplayService::MessageCenterDisplayService( |
| Profile* profile, |
| @@ -32,12 +33,15 @@ void MessageCenterDisplayService::Close( |
| NotificationUIManager::GetProfileID(profile_)); |
| } |
| -bool MessageCenterDisplayService::GetDisplayed( |
| - std::set<std::string>* notifications) const { |
| - DCHECK(notifications); |
| +void MessageCenterDisplayService::GetDisplayed( |
| + const DisplayedNotificationsCallback& callback) const { |
| + auto displayed_notifications = base::MakeUnique<std::set<std::string>>(); |
| for (auto notification_id : ui_manager_->GetAllIdsByProfile( |
| NotificationUIManager::GetProfileID(profile_))) { |
| - notifications->insert(notification_id); |
| + displayed_notifications->insert(notification_id); |
| } |
|
Peter Beverloo
2017/03/17 15:46:04
Sorry that I missed this before -- GetAllIdsByProf
Miguel Garcia
2017/03/20 14:11:20
Done.
|
| - return true; |
| + content::BrowserThread::PostTask( |
| + content::BrowserThread::UI, FROM_HERE, |
| + base::Bind(callback, base::Passed(&displayed_notifications), |
| + true /* supports sync */)); |
| } |