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

Unified Diff: chrome/browser/notifications/stub_notification_display_service.cc

Issue 2941743002: Revert of Deprecate native and extension notification delegates. (Closed)
Patch Set: Created 3 years, 6 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/stub_notification_display_service.cc
diff --git a/chrome/browser/notifications/stub_notification_display_service.cc b/chrome/browser/notifications/stub_notification_display_service.cc
index 578c43a8b8edc4b0153e7e80186278b5ad1f405b..3a94e79456643c788fceb77fe0e080b92c10ff02 100644
--- a/chrome/browser/notifications/stub_notification_display_service.cc
+++ b/chrome/browser/notifications/stub_notification_display_service.cc
@@ -7,7 +7,6 @@
#include <algorithm>
#include "base/memory/ptr_util.h"
-#include "chrome/browser/notifications/notification_handler.h"
#include "chrome/browser/profiles/profile.h"
// static
@@ -18,7 +17,7 @@
}
StubNotificationDisplayService::StubNotificationDisplayService(Profile* profile)
- : NotificationDisplayService(profile), profile_(profile) {}
+ : NotificationDisplayService(profile) {}
StubNotificationDisplayService::~StubNotificationDisplayService() = default;
@@ -36,22 +35,20 @@
if (iter == notifications_.end())
return;
- NotificationHandler* handler = GetNotificationHandler(notification_type);
- DCHECK(handler);
- handler->OnClose(profile_, iter->second.origin_url().spec(), notification_id,
- by_user);
+ // TODO(peter): Invoke the handlers when that has been generalized.
+ iter->second.delegate()->Close(by_user);
+
notifications_.erase(iter);
}
void StubNotificationDisplayService::RemoveAllNotifications(
NotificationCommon::Type notification_type,
bool by_user) {
- NotificationHandler* handler = GetNotificationHandler(notification_type);
- DCHECK(handler);
for (auto iter = notifications_.begin(); iter != notifications_.end();) {
if (iter->first == notification_type) {
- handler->OnClose(profile_, iter->second.origin_url().spec(),
- iter->second.id(), by_user);
+ // TODO(peter): Invoke the handlers when that has been generalized.
+ iter->second.delegate()->Close(by_user);
+
iter = notifications_.erase(iter);
} else {
iter++;

Powered by Google App Engine
This is Rietveld 408576698