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

Unified Diff: content/browser/notifications/page_notification_delegate.cc

Issue 1904163002: Move Web Notifications to use Mojo Base URL: https://chromium.googlesource.com/chromium/src.git@skbitmap-blink
Patch Set: it works \o/ 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: 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..8fcbeae66bd62c660ef2321f96aa765a5e38ffc7 100644
--- a/content/browser/notifications/page_notification_delegate.cc
+++ b/content/browser/notifications/page_notification_delegate.cc
@@ -4,45 +4,25 @@
#include "content/browser/notifications/page_notification_delegate.h"
-#include "content/browser/notifications/notification_message_filter.h"
-#include "content/browser/renderer_host/render_process_host_impl.h"
-#include "content/common/platform_notification_messages.h"
-#include "content/public/browser/render_process_host.h"
-
namespace content {
-PageNotificationDelegate::PageNotificationDelegate(int render_process_id,
- int notification_id)
- : render_process_id_(render_process_id),
- notification_id_(notification_id) {}
+PageNotificationDelegate::PageNotificationDelegate(
+ blink::mojom::NotificationClientPtr notification_client)
+ : notification_client_(std::move(notification_client)) {}
PageNotificationDelegate::~PageNotificationDelegate() {}
-void PageNotificationDelegate::NotificationDisplayed() {
- RenderProcessHost* sender = RenderProcessHost::FromID(render_process_id_);
- if (!sender)
- return;
-
- sender->Send(new PlatformNotificationMsg_DidShow(notification_id_));
-}
+void PageNotificationDelegate::NotificationDisplayed() {}
void PageNotificationDelegate::NotificationClosed() {
- RenderProcessHost* sender = RenderProcessHost::FromID(render_process_id_);
- if (!sender)
- return;
-
- sender->Send(new PlatformNotificationMsg_DidClose(notification_id_));
- static_cast<RenderProcessHostImpl*>(sender)
- ->notification_message_filter()
- ->DidCloseNotification(notification_id_);
+ if (notification_client_.is_bound())
+ notification_client_->OnClose(
+ blink::mojom::NotificationCloseResult::CLOSED);
}
void PageNotificationDelegate::NotificationClick() {
- RenderProcessHost* sender = RenderProcessHost::FromID(render_process_id_);
- if (!sender)
- return;
-
- sender->Send(new PlatformNotificationMsg_DidClick(notification_id_));
+ if (notification_client_.is_bound())
+ notification_client_->OnClick();
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698