Replace FINAL and OVERRIDE with their C++11 counterparts in content/renderer
[chromium-blink-merge.git] / content / renderer / push_messaging_dispatcher.h
blobe0c5c99136cdc1edc797354f1e0b0247b52a1252
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_DISPATCHER_H_
6 #define CONTENT_RENDERER_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/WebPushClient.h"
15 class GURL;
17 namespace IPC {
18 class Message;
19 } // namespace IPC
21 namespace blink {
22 class WebServiceWorkerProvider;
23 class WebString;
24 } // namespace blink
26 namespace content {
28 struct Manifest;
30 class PushMessagingDispatcher : public RenderFrameObserver,
31 public blink::WebPushClient {
32 public:
33 explicit PushMessagingDispatcher(RenderFrame* render_frame);
34 virtual ~PushMessagingDispatcher();
36 private:
37 // RenderFrame::Observer implementation.
38 virtual bool OnMessageReceived(const IPC::Message& message) override;
40 // WebPushClient implementation.
41 virtual void registerPushMessaging(
42 const blink::WebString& sender_id,
43 blink::WebPushRegistrationCallbacks* callbacks,
44 blink::WebServiceWorkerProvider* service_worker_provider);
46 void DoRegister(const std::string& sender_id,
47 blink::WebPushRegistrationCallbacks* callbacks,
48 blink::WebServiceWorkerProvider* service_worker_provider,
49 const Manifest& manifest);
51 void OnRegisterSuccess(int32 callbacks_id,
52 const GURL& endpoint,
53 const std::string& registration_id);
55 void OnRegisterError(int32 callbacks_id, PushMessagingStatus status);
57 IDMap<blink::WebPushRegistrationCallbacks, IDMapOwnPointer>
58 registration_callbacks_;
60 DISALLOW_COPY_AND_ASSIGN(PushMessagingDispatcher);
63 } // namespace content
65 #endif // CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_