Index: chrome/browser/notifications/notification_ui_manager_mac.h |
diff --git a/chrome/browser/notifications/notification_ui_manager_mac.h b/chrome/browser/notifications/notification_ui_manager_mac.h |
index 59a8a11e49023acabd91fe03facbae8ab4759c2c..5544c334394c602e2900b319e9872c7eec3081e6 100644 |
--- a/chrome/browser/notifications/notification_ui_manager_mac.h |
+++ b/chrome/browser/notifications/notification_ui_manager_mac.h |
@@ -10,10 +10,11 @@ |
#include "base/mac/scoped_nsobject.h" |
#include "base/macros.h" |
-#include "chrome/browser/notifications/notification_ui_manager.h" |
+#include "chrome/browser/notifications/notification_display_service.h" |
class Notification; |
@class NotificationCenterDelegate; |
+@class NSUserNotificationCenter; |
class PrefService; |
class Profile; |
@@ -21,34 +22,26 @@ class Profile; |
// send platform notifications to the Notification Center on 10.8 and above. |
// 10.7 and below don't offer native notification support so chrome |
// notifications are still used there. |
-class NotificationUIManagerMac : public NotificationUIManager { |
+class NotificationUIManagerMac : public NotificationDisplayService { |
public: |
- NotificationUIManagerMac(); |
+ NotificationUIManagerMac(Profile* profile, |
+ NSUserNotificationCenter* notification_center); |
Peter Beverloo
2016/03/21 15:57:04
What about having a SetUserNotificationCenterForTe
Miguel Garcia
2016/03/21 17:43:03
The usual pattern for testing has usually been to
|
~NotificationUIManagerMac() override; |
- // NotificationUIManager implementation |
- void Add(const Notification& notification, Profile* profile) override; |
- bool Update(const Notification& notification, Profile* profile) override; |
- |
- // |delegate_id| need to reference a PersistentNotificationDelegate |
- const Notification* FindById(const std::string& delegate_id, |
- ProfileID profile_id) const override; |
- |
- // |delegate_id| need to reference a PersistentNotificationDelegate |
- bool CancelById(const std::string& delegate_id, |
- ProfileID profile_id) override; |
- std::set<std::string> GetAllIdsByProfileAndSourceOrigin( |
- ProfileID profile_id, |
- const GURL& source) override; |
- std::set<std::string> GetAllIdsByProfile(ProfileID profile_id) override; |
- bool CancelAllBySourceOrigin(const GURL& source_origin) override; |
- bool CancelAllByProfile(ProfileID profile_id) override; |
- void CancelAll() override; |
+ // NotificationDisplayService implementation |
+ void Display(const Notification& notification) override; |
+ |
+ bool Close(const std::string& persistent_notification_id) override; |
+ std::set<std::string> GetDisplayed() const override; |
+ bool SupportsNotificationCenter() const override; |
private: |
// Cocoa class that receives callbacks from the NSUserNotificationCenter. |
base::scoped_nsobject<NotificationCenterDelegate> delegate_; |
+ // The notification center to use, this can be overriden in tests |
+ NSUserNotificationCenter* notification_center_; |
+ |
DISALLOW_COPY_AND_ASSIGN(NotificationUIManagerMac); |
}; |