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 #ifndef CONTENT_BROWSER_NOTIFICATION_MESSAGE_FILTER_H_
6 #define CONTENT_BROWSER_NOTIFICATION_MESSAGE_FILTER_H_
8 #include "content/public/browser/browser_message_filter.h"
9 #include "third_party/WebKit/public/platform/WebNotificationPermission.h"
15 class ResourceContext
;
16 struct ShowDesktopNotificationHostMsgParams
;
18 class NotificationMessageFilter
: public BrowserMessageFilter
{
20 NotificationMessageFilter(
22 ResourceContext
* resource_context
);
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
;
30 ~NotificationMessageFilter() override
;
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
);
40 ResourceContext
* resource_context_
;
43 } // namespace content
45 #endif // CONTENT_BROWSER_NOTIFICATION_MESSAGE_FILTER_H_