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

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

Issue 2300093002: Make //content responsible for generating notification Ids (Closed)
Patch Set: comments Created 4 years, 3 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_notification_manager.cc
diff --git a/chrome/browser/notifications/message_center_notification_manager.cc b/chrome/browser/notifications/message_center_notification_manager.cc
index 99cc5904e7c555c5b33e2046ab3b096aeef67340..3b4010cab1637c5528043503574f4b9b1687361b 100644
--- a/chrome/browser/notifications/message_center_notification_manager.cc
+++ b/chrome/browser/notifications/message_center_notification_manager.cc
@@ -44,6 +44,7 @@
#include "ash/shell.h"
#endif
+using message_center::NotifierId;
MessageCenterNotificationManager::MessageCenterNotificationManager(
message_center::MessageCenter* message_center,
@@ -157,6 +158,11 @@ bool MessageCenterNotificationManager::Update(const Notification& notification,
// TODO(liyanhou): Add routing updated notifications to alternative
// providers.
+ // Non-persistent Web Notifications rely on receiving the Display() event
+ // to inform the developer, even when replacing a previous notification.
+ if (notification.notifier_id().type == NotifierId::WEB_PAGE)
+ notification.delegate()->Display();
+
// WARNING: You MUST use AddProfileNotification or update the message
// center via the notification within a ProfileNotification object or the
// profile ID will not be correctly set for ChromeOS.

Powered by Google App Engine
This is Rietveld 408576698