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

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

Issue 2093953002: Introduce a new API to handle native notification clicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 5 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/message_center_display_service.cc
diff --git a/chrome/browser/notifications/message_center_display_service.cc b/chrome/browser/notifications/message_center_display_service.cc
index 8dc7420cafe2b9fdc9811c8ff68980b7a12b6de2..34beeabdd54a0f01e3de970621f5788e116cd013 100644
--- a/chrome/browser/notifications/message_center_display_service.cc
+++ b/chrome/browser/notifications/message_center_display_service.cc
@@ -15,12 +15,19 @@ MessageCenterDisplayService::MessageCenterDisplayService(
MessageCenterDisplayService::~MessageCenterDisplayService() {}
-void MessageCenterDisplayService::Display(const std::string& notification_id,
- const Notification& notification) {
+void MessageCenterDisplayService::Display(
+ NotificationCommon::Type notification_type,
+ const std::string& notification_id,
+ const Notification& notification) {
+ // TODO(miguelg): MCDS should stop relying on the |notification|'s delegate
+ // for Close/Click operations once the Notification object becomes a mojom
+ // type.
ui_manager_->Add(notification, profile_);
}
-void MessageCenterDisplayService::Close(const std::string& notification_id) {
+void MessageCenterDisplayService::Close(
+ NotificationCommon::Type notification_type,
+ const std::string& notification_id) {
ui_manager_->CancelById(notification_id,
NotificationUIManager::GetProfileID(profile_));
}

Powered by Google App Engine
This is Rietveld 408576698