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

Unified Diff: chrome/browser/notifications/notification_platform_bridge.h

Issue 2749453002: Make GetDisplayedNotifications asynchronous. (Closed)
Patch Set: review Created 3 years, 9 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/notification_platform_bridge.h
diff --git a/chrome/browser/notifications/notification_platform_bridge.h b/chrome/browser/notifications/notification_platform_bridge.h
index 720245c8c8eb12465b5ab9d6d5ed949b4daa636f..231a0fd35094f85f9850eaebdb2c60f220f54ad8 100644
--- a/chrome/browser/notifications/notification_platform_bridge.h
+++ b/chrome/browser/notifications/notification_platform_bridge.h
@@ -8,6 +8,7 @@
#include <set>
#include <string>
+#include "base/callback_forward.h"
#include "base/macros.h"
#include "chrome/browser/notifications/notification_common.h"
@@ -19,6 +20,10 @@ class Notification;
// TODO(miguelg): Add support for click and close events.
class NotificationPlatformBridge {
public:
+ using DisplayedNotificationsCallback =
+ base::Callback<void(std::unique_ptr<std::set<std::string>>,
+ bool /* supports_synchronization */)>;
+
static NotificationPlatformBridge* Create();
virtual ~NotificationPlatformBridge() {}
@@ -35,14 +40,12 @@ class NotificationPlatformBridge {
virtual void Close(const std::string& profile_id,
const std::string& notification_id) = 0;
- // Fills in |notifications| with a set of notification ids currently being
- // displayed for a given profile.
- // The return value expresses whether the underlying platform has the
- // capability to provide displayed notifications so the empty set
- // can be disambiguated.
- virtual bool GetDisplayed(const std::string& profile_id,
- bool incognito,
- std::set<std::string>* notification_ids) const = 0;
+ // Writes the ids of all currently displaying notifications and posts
+ // |callback| with the result.
+ virtual void GetDisplayed(
+ const std::string& profile_id,
+ bool incognito,
+ const DisplayedNotificationsCallback& callback) const = 0;
protected:
NotificationPlatformBridge() {}

Powered by Google App Engine
This is Rietveld 408576698