Chromium Code Reviews| Index: chrome/browser/notifications/platform_notification_service_impl.h |
| diff --git a/chrome/browser/notifications/platform_notification_service_impl.h b/chrome/browser/notifications/platform_notification_service_impl.h |
| index b26aa2ab322385caa0143be82514cb72d4a37fd1..efd39c458451d138bb464d35dcc4c1ad0a695647 100644 |
| --- a/chrome/browser/notifications/platform_notification_service_impl.h |
| +++ b/chrome/browser/notifications/platform_notification_service_impl.h |
| @@ -23,7 +23,7 @@ |
| #include "content/public/common/persistent_notification_status.h" |
| class NotificationDelegate; |
| -class NotificationUIManager; |
| +class NotificationDisplayService; |
| namespace content { |
| class BrowserContext; |
| @@ -50,6 +50,9 @@ class PlatformNotificationServiceImpl |
| // be called from any thread. |
| static PlatformNotificationServiceImpl* GetInstance(); |
| + // Returns the notification display service to use. This is overriden in tests |
| + NotificationDisplayService* GetNotificationDisplayService(Profile* profile); |
|
Peter Beverloo
2016/04/20 17:34:08
TODO on changing to be private for prosperity?
Miguel Garcia
2016/04/21 14:32:10
Done.
|
| + |
| // Load the profile corresponding to |profile_id| and perform the |
| // |operation| on the given notification once it has been loaded. |
| void ProcessPersistentNotificationOperation( |
| @@ -78,9 +81,6 @@ class PlatformNotificationServiceImpl |
| const GURL& origin, |
| bool by_user); |
| - // Returns the Notification UI Manager through which notifications can be |
| - // displayed to the user. Can be overridden for testing. |
| - NotificationUIManager* GetNotificationUIManager() const; |
| // Open the Notification settings screen when clicking the right button. |
| void OpenNotificationSettings(content::BrowserContext* browser_context); |
| @@ -137,20 +137,12 @@ class PlatformNotificationServiceImpl |
| const content::NotificationResources& notification_resources, |
| NotificationDelegate* delegate) const; |
| - // Overrides the Notification UI Manager to use to |manager|. Only to be |
| - // used by tests. Tests are responsible for cleaning up after themselves. |
| - void SetNotificationUIManagerForTesting(NotificationUIManager* manager); |
| - |
| // Returns a display name for an origin, to be used in the context message |
| base::string16 DisplayNameForContextMessage(Profile* profile, |
| const GURL& origin) const; |
| - // Platforms that display native notification interact with them through this |
| - // object. |
| - std::unique_ptr<NotificationUIManager> native_notification_ui_manager_; |
| - |
| - // Weak reference. Ownership maintains with the test. |
| - NotificationUIManager* notification_ui_manager_for_tests_; |
| + void SetNotificationDisplayServiceForTesting( |
| + NotificationDisplayService* service); |
| // Mapping between a persistent notification id and the id of the associated |
| // message_center::Notification object. Must only be used on the UI thread. |
| @@ -160,6 +152,9 @@ class PlatformNotificationServiceImpl |
| // programmatically to avoid dispatching close events for them. |
| std::unordered_set<int64_t> closed_notifications_; |
| + // Only set and used for tests, owned by the caller in that case. |
| + NotificationDisplayService* test_display_service_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(PlatformNotificationServiceImpl); |
| }; |