Chromium Code Reviews| Index: content/browser/notification_message_filter.h |
| diff --git a/content/browser/notification_message_filter.h b/content/browser/notification_message_filter.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fb97f83cd1f5a7043ab57df305f6996cac3fcf0e |
| --- /dev/null |
| +++ b/content/browser/notification_message_filter.h |
| @@ -0,0 +1,49 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_BROWSER_NOTIFICATION_MESSAGE_FILTER_H_ |
| +#define CONTENT_BROWSER_NOTIFICATION_MESSAGE_FILTER_H_ |
| + |
| +#include "content/public/browser/browser_message_filter.h" |
| +#include "third_party/WebKit/public/platform/WebNotificationPermission.h" |
|
Mike West
2014/10/24 13:20:18
I think you can forward-declare this.
Peter Beverloo
2014/10/24 13:57:35
Nope, it's an enum and we can't forward declare (n
|
| + |
| +class GURL; |
| + |
| +namespace content { |
| + |
| +class BrowserContext; |
| +class ContentClient; |
| +class ResourceContext; |
| +struct ShowDesktopNotificationHostMsgParams; |
| + |
| +class NotificationMessageFilter : public BrowserMessageFilter { |
| + public: |
| + NotificationMessageFilter( |
| + int process_id, |
| + ResourceContext* resource_context, |
| + BrowserContext* browser_context); |
| + |
| + // BrowserMessageFilter implementation. Called on the UI thread. |
| + bool OnMessageReceived(const IPC::Message& message) override; |
| + void OverrideThreadForMessage( |
| + const IPC::Message& message, content::BrowserThread::ID* thread) override; |
| + |
| + protected: |
| + ~NotificationMessageFilter() override; |
| + |
| + private: |
| + void OnCheckNotificationPermission( |
| + const GURL& origin, blink::WebNotificationPermission* permission); |
| + void OnShowPlatformNotification( |
| + int notification_id, const ShowDesktopNotificationHostMsgParams& params); |
| + void OnClosePlatformNotification(int notification_id); |
| + |
| + int process_id_; |
| + ResourceContext* resource_context_; |
| + BrowserContext* browser_context_; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_NOTIFICATION_MESSAGE_FILTER_H_ |