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

Unified Diff: content/browser/notifications/page_notification_delegate.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: content/browser/notifications/page_notification_delegate.cc
diff --git a/content/browser/notifications/page_notification_delegate.cc b/content/browser/notifications/page_notification_delegate.cc
index 03f5b588e69c4510d97754f5707143ede15d0c67..478582917cdc0c915002319794a262bf6d4251f9 100644
--- a/content/browser/notifications/page_notification_delegate.cc
+++ b/content/browser/notifications/page_notification_delegate.cc
@@ -11,9 +11,12 @@
namespace content {
-PageNotificationDelegate::PageNotificationDelegate(int render_process_id,
- int notification_id)
+PageNotificationDelegate::PageNotificationDelegate(
+ int render_process_id,
+ int non_persistent_notification_id,
+ const std::string& notification_id)
: render_process_id_(render_process_id),
+ non_persistent_notification_id_(non_persistent_notification_id),
notification_id_(notification_id) {}
PageNotificationDelegate::~PageNotificationDelegate() {}
@@ -23,7 +26,8 @@ void PageNotificationDelegate::NotificationDisplayed() {
if (!sender)
return;
- sender->Send(new PlatformNotificationMsg_DidShow(notification_id_));
+ sender->Send(
+ new PlatformNotificationMsg_DidShow(non_persistent_notification_id_));
}
void PageNotificationDelegate::NotificationClosed() {
@@ -31,7 +35,9 @@ void PageNotificationDelegate::NotificationClosed() {
if (!sender)
return;
- sender->Send(new PlatformNotificationMsg_DidClose(notification_id_));
+ sender->Send(
+ new PlatformNotificationMsg_DidClose(non_persistent_notification_id_));
+
static_cast<RenderProcessHostImpl*>(sender)
->notification_message_filter()
->DidCloseNotification(notification_id_);
@@ -42,7 +48,8 @@ void PageNotificationDelegate::NotificationClick() {
if (!sender)
return;
- sender->Send(new PlatformNotificationMsg_DidClick(notification_id_));
+ sender->Send(
+ new PlatformNotificationMsg_DidClick(non_persistent_notification_id_));
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698