| 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..0eb5ee55a7e12c50606d41368dbc42d537bcda92
|
| --- /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/common/push_messaging_status.h"
|
| +#include "content/public/renderer/render_view_observer.h"
|
| +#include "third_party/WebKit/public/platform/WebPushClient.h"
|
| +#include "third_party/WebKit/public/platform/WebPushMessagingError.h"
|
| +#include "third_party/WebKit/public/platform/WebString.h"
|
| +
|
| +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& channel_name,
|
| + blink::WebPushRegistrationCallbacks* callbacks) OVERRIDE;
|
| +
|
| + void OnRegisterSuccess(int32 callbacks_id,
|
| + const std::string& endpoint,
|
| + const std::string& registration_id,
|
| + const std::string& channel_name);
|
| +
|
| + void OnRegisterError(int32 callbacks_id, PushMessagingStatus status);
|
| +
|
| + IDMap<blink::WebPushRegistrationCallbacks, IDMapOwnPointer>
|
| + registration_callbacks_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(PushMessagingDispatcher);
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_
|
|
|