Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1757)

Unified Diff: chrome/browser/notifications/message_center_display_service.cc

Issue 2714743002: Retrive displayed notifications asynchronously
Patch Set: apply review comments from https://codereview.chromium.org/2709213005/ Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..aab92388e93f79f2c7e4c46a67043a281e8e0b2f 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,
@@ -41,3 +42,14 @@ bool MessageCenterDisplayService::GetDisplayed(
}
return true;
}
+
+void MessageCenterDisplayService::GetDisplayedAsync(
+ const NotificationCommon::NotificationResultCallback& callback) const {
+ std::unique_ptr<std::set<std::string>> displayed_notifications =
+ base::MakeUnique<std::set<std::string>>();
+ GetDisplayed(displayed_notifications.get());
+ content::BrowserThread::PostTask(
+ content::BrowserThread::IO, FROM_HERE,
+ base::Bind(callback, base::Passed(&displayed_notifications),
+ true /* supports sync */));
+}

Powered by Google App Engine
This is Rietveld 408576698