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

Side by Side Diff: content/browser/notification_message_filter.cc

Issue 644643005: Implement a RenderFrame-less path for Web Notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove now unused ipc messages Created 6 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #include "content/browser/notification_message_filter.h"
6
7 #include "content/common/platform_notification_messages.h"
8 #include "content/public/common/content_client.h"
9
10 NotificationMessageFilter::NotificationMessageFilter(
11 int process_id,
12 ResourceContext* resource_context,
13 BrowserContext* browser_context)
14 : BrowserMessageFilter(PlatformNotificationMsgStart),
15 process_id_(process_id),
16 resource_context_(resource_context),
17 browser_context_(browser_context) {}
18
19 NotificationMessageFilter::~NotificationMessageFilter() {}
20
21 bool NotificationMessageFilter::OnMessageReceived(const IPC::Message& message) {
22 bool handled = true;
23 IPC_BEGIN_MESSAGE_MAP(NotificationMessageFilter, message)
24 IPC_MESSAGE_HANDLER(PlatformNotificationHostMsg_CheckPermission,
25 OnCheckNotificationPermission)
26 IPC_MESSAGE_HANDLER(PlatformNotificationHostMsg_Show,
27 OnShowPlatformNotification)
28 IPC_MESSAGE_HANDLER(PlatformNotificationHostMsg_Close,
29 OnClosePlatformNotification)
30 IPC_MESSAGE_UNHANDLED(handled = false)
31 IPC_END_MESSAGE_MAP()
32
33 return handled;
34 }
35
36 void NotificationMessageFilter::OverrideThreadForMessage(
37 const IPC::Message& message, content::BrowserThread::ID* thread) {
38 if (message.type() == PlatformNotificationHostMsg_Show::ID ||
39 message.type() == PlatformNotificationHostMsg_Close::ID)
40 *thread = BrowserThread::UI;
41 }
42
43 void NotificationMessageFilter::OnCheckNotificationPermission(
44 const GURL& origin, blink::WebNotificationPermission* permission) {
45 *permission =
46 GetContentClient()->browser()->CheckDesktopNotificationPermission(
47 origin,
48 resource_context_,
49 process_id_);
50 }
51
52 void NotificationMessageFilter::OnShowPlatformNotification(
53 int notification_id, const ShowDesktopNotificationHostMsgParams& params) {
54 // TODO(peter): Implement the DesktopNotificationDelegate.
55 NOTIMPLEMENTED();
56 }
57
58 void NotificationMessageFilter::OnClosePlatformNotification(
59 int notification_id) {
60 // TODO(peter): Implement the ability to close notifications.
61 NOTIMPLEMENTED();
62 }
63
64 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698