Fix a couple bugs in the settings_page_header wrt breadcrumbs.
[chromium-blink-merge.git] / content / renderer / push_messaging / push_messaging_dispatcher.h
blob18bf060f416c2a388456fbfa6fe80b3e0a41efdf
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_RENDERER_PUSH_MESSAGING_PUSH_MESSAGING_DISPATCHER_H_
6 #define CONTENT_RENDERER_PUSH_MESSAGING_PUSH_MESSAGING_DISPATCHER_H_
8 #include <stdint.h>
9 #include <string>
11 #include "base/id_map.h"
12 #include "content/public/common/push_messaging_status.h"
13 #include "content/public/renderer/render_frame_observer.h"
14 #include "third_party/WebKit/public/platform/modules/push_messaging/WebPushClient.h"
15 #include "third_party/WebKit/public/platform/modules/push_messaging/WebPushPermissionStatus.h"
17 class GURL;
19 namespace blink {
20 struct WebPushSubscriptionOptions;
23 namespace IPC {
24 class Message;
25 } // namespace IPC
27 namespace content {
29 struct Manifest;
31 class PushMessagingDispatcher : public RenderFrameObserver,
32 public blink::WebPushClient {
33 public:
34 explicit PushMessagingDispatcher(RenderFrame* render_frame);
35 virtual ~PushMessagingDispatcher();
37 private:
38 // RenderFrame::Observer implementation.
39 bool OnMessageReceived(const IPC::Message& message) override;
41 // WebPushClient implementation.
42 virtual void subscribe(
43 blink::WebServiceWorkerRegistration* service_worker_registration,
44 const blink::WebPushSubscriptionOptions& options,
45 blink::WebPushSubscriptionCallbacks* callbacks);
47 void DoSubscribe(
48 blink::WebServiceWorkerRegistration* service_worker_registration,
49 const blink::WebPushSubscriptionOptions& options,
50 blink::WebPushSubscriptionCallbacks* callbacks,
51 const Manifest& manifest);
53 void OnSubscribeFromDocumentSuccess(int32_t request_id,
54 const GURL& endpoint);
56 void OnSubscribeFromDocumentError(int32_t request_id,
57 PushRegistrationStatus status);
59 IDMap<blink::WebPushSubscriptionCallbacks, IDMapOwnPointer>
60 subscription_callbacks_;
62 DISALLOW_COPY_AND_ASSIGN(PushMessagingDispatcher);
65 } // namespace content
67 #endif // CONTENT_RENDERER_PUSH_MESSAGING_PUSH_MESSAGING_DISPATCHER_H_