OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 25 matching lines...) Expand all Loading... |
36 bool success, | 36 bool success, |
37 const std::vector<uint8_t>& p256dh, | 37 const std::vector<uint8_t>& p256dh, |
38 const std::vector<uint8_t>& auth)>; | 38 const std::vector<uint8_t>& auth)>; |
39 | 39 |
40 using StringCallback = base::Callback<void(const std::string& data, | 40 using StringCallback = base::Callback<void(const std::string& data, |
41 bool success, | 41 bool success, |
42 bool not_found)>; | 42 bool not_found)>; |
43 | 43 |
44 virtual ~PushMessagingService() {} | 44 virtual ~PushMessagingService() {} |
45 | 45 |
46 // Returns the absolute URL exposed by the push server where the webapp server | 46 // Returns the absolute URL to the endpoint of the push service where messages |
47 // can send push messages. This is currently assumed to be the same for all | 47 // should be posted to. Should return an endpoint compatible with the Web Push |
48 // origins and push registrations. | 48 // Protocol when |standard_protocol| is true. |
49 virtual GURL GetPushEndpoint() = 0; | 49 virtual GURL GetEndpoint(bool standard_protocol) const = 0; |
50 | 50 |
51 // Subscribe the given |options.sender_info| with the push messaging service | 51 // Subscribe the given |options.sender_info| with the push messaging service |
52 // in a document context. The frame is known and a permission UI may be | 52 // in a document context. The frame is known and a permission UI may be |
53 // displayed to the user. | 53 // displayed to the user. |
54 virtual void SubscribeFromDocument(const GURL& requesting_origin, | 54 virtual void SubscribeFromDocument(const GURL& requesting_origin, |
55 int64_t service_worker_registration_id, | 55 int64_t service_worker_registration_id, |
56 int renderer_id, | 56 int renderer_id, |
57 int render_frame_id, | 57 int render_frame_id, |
58 const PushSubscriptionOptions& options, | 58 const PushSubscriptionOptions& options, |
59 const RegisterCallback& callback) = 0; | 59 const RegisterCallback& callback) = 0; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // |service_worker_registration_id| for the given |origin|. | 102 // |service_worker_registration_id| for the given |origin|. |
103 static void ClearPushSubscriptionID(BrowserContext* browser_context, | 103 static void ClearPushSubscriptionID(BrowserContext* browser_context, |
104 const GURL& origin, | 104 const GURL& origin, |
105 int64_t service_worker_registration_id, | 105 int64_t service_worker_registration_id, |
106 const base::Closure& callback); | 106 const base::Closure& callback); |
107 }; | 107 }; |
108 | 108 |
109 } // namespace content | 109 } // namespace content |
110 | 110 |
111 #endif // CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_ | 111 #endif // CONTENT_PUBLIC_BROWSER_PUSH_MESSAGING_SERVICE_H_ |
OLD | NEW |