OLD | NEW |
| (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 #ifndef CONTENT_BROWSER_NOTIFICATION_MESSAGE_FILTER_H_ | |
6 #define CONTENT_BROWSER_NOTIFICATION_MESSAGE_FILTER_H_ | |
7 | |
8 #include "content/public/browser/browser_message_filter.h" | |
9 #include "third_party/WebKit/public/platform/WebNotificationPermission.h" | |
10 | |
11 class GURL; | |
12 | |
13 namespace content { | |
14 | |
15 class ResourceContext; | |
16 struct ShowDesktopNotificationHostMsgParams; | |
17 | |
18 class NotificationMessageFilter : public BrowserMessageFilter { | |
19 public: | |
20 NotificationMessageFilter( | |
21 int process_id, | |
22 ResourceContext* resource_context); | |
23 | |
24 // BrowserMessageFilter implementation. Called on the UI thread. | |
25 bool OnMessageReceived(const IPC::Message& message) override; | |
26 void OverrideThreadForMessage( | |
27 const IPC::Message& message, content::BrowserThread::ID* thread) override; | |
28 | |
29 protected: | |
30 ~NotificationMessageFilter() override; | |
31 | |
32 private: | |
33 void OnCheckNotificationPermission( | |
34 const GURL& origin, blink::WebNotificationPermission* permission); | |
35 void OnShowPlatformNotification( | |
36 int notification_id, const ShowDesktopNotificationHostMsgParams& params); | |
37 void OnClosePlatformNotification(int notification_id); | |
38 | |
39 int process_id_; | |
40 ResourceContext* resource_context_; | |
41 }; | |
42 | |
43 } // namespace content | |
44 | |
45 #endif // CONTENT_BROWSER_NOTIFICATION_MESSAGE_FILTER_H_ | |
OLD | NEW |