| 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 28bbbed27fa38b6ca6a6bcfff2f43faafb0422b3..80c310ccfdfacceb2c00987035a8dc4ef3bc3067 100644
|
| --- a/chrome/browser/notifications/platform_notification_service_impl.h
|
| +++ b/chrome/browser/notifications/platform_notification_service_impl.h
|
| @@ -22,7 +22,7 @@
|
| #include "content/public/common/persistent_notification_status.h"
|
|
|
| class NotificationDelegate;
|
| -class NotificationUIManager;
|
| +class NotificationDisplayService;
|
|
|
| namespace content {
|
| class BrowserContext;
|
| @@ -49,6 +49,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);
|
| +
|
| // Load the profile corresponding to |profile_id| and perform the
|
| // |operation| on the given notification once it has been loaded.
|
| void ProcessPersistentNotificationOperation(
|
| @@ -77,10 +80,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);
|
|
|
| @@ -136,20 +135,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.
|
| - scoped_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.
|
| @@ -159,6 +150,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);
|
| };
|
|
|
|
|