| 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
|
|
|