ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / content / browser / notifications / page_notification_delegate.cc
blobdacfffbfd22da5db3bdede2ead526dd7b294d480
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/browser/notifications/page_notification_delegate.h"
7 #include "content/browser/notifications/notification_message_filter.h"
8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 #include "content/common/platform_notification_messages.h"
10 #include "content/public/browser/render_process_host.h"
12 namespace content {
14 PageNotificationDelegate::PageNotificationDelegate(int render_process_id,
15 int notification_id)
16 : render_process_id_(render_process_id),
17 notification_id_(notification_id) {}
19 PageNotificationDelegate::~PageNotificationDelegate() {}
21 void PageNotificationDelegate::NotificationDisplayed() {
22 RenderProcessHost* sender = RenderProcessHost::FromID(render_process_id_);
23 if (!sender)
24 return;
26 sender->Send(new PlatformNotificationMsg_DidShow(notification_id_));
29 // TODO(peter): Remove |by_user| since we're not using that anywhere.
30 void PageNotificationDelegate::NotificationClosed(bool by_user) {
31 RenderProcessHost* sender = RenderProcessHost::FromID(render_process_id_);
32 if (!sender)
33 return;
35 sender->Send(new PlatformNotificationMsg_DidClose(notification_id_));
36 static_cast<RenderProcessHostImpl*>(sender)
37 ->notification_message_filter()->DidCloseNotification(notification_id_);
40 void PageNotificationDelegate::NotificationClick() {
41 RenderProcessHost* sender = RenderProcessHost::FromID(render_process_id_);
42 if (!sender)
43 return;
45 sender->Send(new PlatformNotificationMsg_DidClick(notification_id_));
48 } // namespace content