Enable right clicking on the applist doodle web contents and log the data.
[chromium-blink-merge.git] / content / renderer / push_messaging / push_messaging_dispatcher.h
blob06fc37188d480c786768974eea71747ac13c2fd4
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 <string>
10 #include "base/id_map.h"
11 #include "content/public/common/push_messaging_status.h"
12 #include "content/public/renderer/render_frame_observer.h"
13 #include "third_party/WebKit/public/platform/modules/push_messaging/WebPushClient.h"
14 #include "third_party/WebKit/public/platform/modules/push_messaging/WebPushPermissionStatus.h"
16 class GURL;
18 namespace IPC {
19 class Message;
20 } // namespace IPC
22 namespace content {
24 struct Manifest;
26 class PushMessagingDispatcher : public RenderFrameObserver,
27 public blink::WebPushClient {
28 public:
29 explicit PushMessagingDispatcher(RenderFrame* render_frame);
30 virtual ~PushMessagingDispatcher();
32 private:
33 // RenderFrame::Observer implementation.
34 bool OnMessageReceived(const IPC::Message& message) override;
36 // WebPushClient implementation.
37 virtual void registerPushMessaging(
38 blink::WebServiceWorkerRegistration* service_worker_registration,
39 blink::WebPushRegistrationCallbacks* callbacks); // override
41 void DoRegister(
42 blink::WebServiceWorkerRegistration* service_worker_registration,
43 blink::WebPushRegistrationCallbacks* callbacks,
44 const Manifest& manifest);
46 void OnRegisterFromDocumentSuccess(int32 request_id,
47 const GURL& endpoint,
48 const std::string& registration_id);
50 void OnRegisterFromDocumentError(int32 request_id,
51 PushRegistrationStatus status);
53 IDMap<blink::WebPushRegistrationCallbacks, IDMapOwnPointer>
54 registration_callbacks_;
56 DISALLOW_COPY_AND_ASSIGN(PushMessagingDispatcher);
59 } // namespace content
61 #endif // CONTENT_RENDERER_PUSH_MESSAGING_PUSH_MESSAGING_DISPATCHER_H_