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

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

Issue 1814923002: Nuke NotificationUIManager from PlatformNotificationServiceImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@profile_manager_load
Patch Set: Created 4 years, 8 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/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 e375a8d283b65d454f3dd39e12a8e1b4e14b69f0..a9481dc006bce5b435d56617c0d618fc0cefab5d 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.h
+++ b/chrome/browser/notifications/platform_notification_service_impl.h
@@ -24,7 +24,7 @@
#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h"
class NotificationDelegate;
-class NotificationUIManager;
+class NotificationDisplayService;
namespace content {
class BrowserContext;
@@ -51,6 +51,10 @@ class PlatformNotificationServiceImpl
// be called from any thread.
static PlatformNotificationServiceImpl* GetInstance();
+ // Returns the notification display service to use. This is overriden in tests
+ // TODO(miguelg) make it private once the tests are updated
+ 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(
@@ -79,9 +83,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);
@@ -138,20 +139,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.
@@ -161,6 +154,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);
};

Powered by Google App Engine
This is Rietveld 408576698