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

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

Issue 2916383004: Revert of Minimize the delegate dependencies for non persistent notifications. (Closed)
Patch Set: Created 3 years, 7 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/non_persistent_notification_handler.h
diff --git a/chrome/browser/notifications/non_persistent_notification_handler.h b/chrome/browser/notifications/non_persistent_notification_handler.h
index 77ce8820cf4a4e0ea4bfdcd772fe67c6c851c63a..78ad623cbda87fa334d8ea738b465c6a064fec08 100644
--- a/chrome/browser/notifications/non_persistent_notification_handler.h
+++ b/chrome/browser/notifications/non_persistent_notification_handler.h
@@ -5,8 +5,13 @@
#ifndef CHROME_BROWSER_NOTIFICATIONS_NON_PERSISTENT_NOTIFICATION_HANDLER_H_
#define CHROME_BROWSER_NOTIFICATIONS_NON_PERSISTENT_NOTIFICATION_HANDLER_H_
+#include <unordered_map>
+
#include "base/macros.h"
+#include "base/memory/ref_counted.h"
#include "chrome/browser/notifications/notification_handler.h"
+
+class NotificationDelegate;
// NotificationHandler implementation for non persistent notifications.
class NonPersistentNotificationHandler : public NotificationHandler {
@@ -28,7 +33,14 @@
void OpenSettings(Profile* profile) override;
+ void RegisterNotification(const std::string& notification_id,
+ NotificationDelegate* delegate) override;
+
private:
+ // map of delegate objects keyed by notification id.
+ std::unordered_map<std::string, scoped_refptr<NotificationDelegate>>
+ notifications_;
+
DISALLOW_COPY_AND_ASSIGN(NonPersistentNotificationHandler);
};

Powered by Google App Engine
This is Rietveld 408576698