Index: chrome/browser/notifications/profile_notification.h |
diff --git a/chrome/browser/notifications/profile_notification.h b/chrome/browser/notifications/profile_notification.h |
index 527ece367b9ec4f3ed000d32c7bdba5c1aef4959..445ca9eb5d282d278519e417ebec24ac35b899fa 100644 |
--- a/chrome/browser/notifications/profile_notification.h |
+++ b/chrome/browser/notifications/profile_notification.h |
@@ -9,13 +9,15 @@ |
#include "chrome/browser/notifications/notification.h" |
#include "chrome/browser/notifications/notification_ui_manager.h" |
+#include "content/public/browser/notification_observer.h" |
+#include "content/public/browser/notification_registrar.h" |
class ScopedKeepAlive; |
// This class keeps a Notification objects and its corresponding Profile, so |
// that when the Notification UI manager needs to return or cancel all |
// notifications for a given Profile we have the ability to do this. |
-class ProfileNotification { |
+class ProfileNotification : public content::NotificationObserver { |
public: |
// Returns a string that uniquely identifies a profile + delegate_id pair. |
// The profile_id is used as an identifier to identify a profile instance; it |
@@ -24,11 +26,16 @@ class ProfileNotification { |
ProfileID profile_id); |
ProfileNotification(Profile* profile, const Notification& notification); |
- ~ProfileNotification(); |
+ ~ProfileNotification() override; |
ProfileID profile_id() const { return profile_id_; } |
const Notification& notification() const { return notification_; } |
+ // content::NotificationObserver: |
+ void Observe(int type, |
+ const content::NotificationSource& source, |
+ const content::NotificationDetails& details) override; |
+ |
private: |
// Used for equality comparision in notification maps. |
ProfileID profile_id_; |
@@ -37,6 +44,8 @@ class ProfileNotification { |
std::unique_ptr<ScopedKeepAlive> keep_alive_; |
+ content::NotificationRegistrar registrar_; |
+ |
DISALLOW_COPY_AND_ASSIGN(ProfileNotification); |
}; |