Chromium Code Reviews| Index: content/renderer/push_messaging_dispatcher.h |
| diff --git a/content/renderer/push_messaging_dispatcher.h b/content/renderer/push_messaging_dispatcher.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7e5796587d928da730afcc5509694079674e8bad |
| --- /dev/null |
| +++ b/content/renderer/push_messaging_dispatcher.h |
| @@ -0,0 +1,50 @@ |
| +// 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_RENDERER_PUSH_MESSAGING_DISPATCHER_H_ |
| +#define CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/id_map.h" |
| +#include "content/public/renderer/render_view_observer.h" |
| +#include "ipc/ipc_message.h" |
|
jochen (gone - plz use gerrit)
2014/04/08 07:42:18
can be forward declared?
Michael van Ouwerkerk
2014/04/08 13:27:00
Done.
|
| +#include "third_party/WebKit/public/platform/WebPushClient.h" |
| +#include "third_party/WebKit/public/platform/WebPushError.h" |
|
jochen (gone - plz use gerrit)
2014/04/08 07:42:18
not needed in the header?
Michael van Ouwerkerk
2014/04/08 13:27:00
Done.
|
| +#include "third_party/WebKit/public/platform/WebString.h" |
|
jochen (gone - plz use gerrit)
2014/04/08 07:42:18
can be forward declared?
Michael van Ouwerkerk
2014/04/08 13:27:00
Done.
|
| +#include "url/gurl.h" |
|
jochen (gone - plz use gerrit)
2014/04/08 07:42:18
can be forward declared?
Michael van Ouwerkerk
2014/04/08 13:27:00
Done.
|
| + |
| +namespace content { |
| +class RenderViewImpl; |
| + |
| +class PushMessagingDispatcher : public RenderViewObserver, |
| + public blink::WebPushClient { |
| + public: |
| + explicit PushMessagingDispatcher(RenderViewImpl* render_view); |
| + virtual ~PushMessagingDispatcher(); |
| + |
| + private: |
| + // RenderView::Observer implementation. |
| + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| + |
| + // WebPushClient implementation. |
| + virtual void registerPushMessaging( |
| + const blink::WebString& sender_id, |
| + blink::WebPushRegistrationCallbacks* callbacks) OVERRIDE; |
| + |
| + void OnRegisterSuccess(int32 callbacks_id, |
| + const GURL& endpoint, |
| + const std::string& registration_id); |
| + |
| + void OnRegisterError(int32 callbacks_id); |
| + |
| + IDMap<blink::WebPushRegistrationCallbacks, IDMapOwnPointer> |
| + registration_callbacks_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(PushMessagingDispatcher); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_ |