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 CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ | 5 #ifndef CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ |
6 #define CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ | 6 #define CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 bool success, | 225 bool success, |
226 bool not_found); | 226 bool not_found); |
227 | 227 |
228 // Helper methods ------------------------------------------------------------ | 228 // Helper methods ------------------------------------------------------------ |
229 | 229 |
230 // Normalizes the |sender_info|. In most cases the |sender_info| will be | 230 // Normalizes the |sender_info|. In most cases the |sender_info| will be |
231 // passed through to the GCM Driver as-is, but NIST P-256 application server | 231 // passed through to the GCM Driver as-is, but NIST P-256 application server |
232 // keys have to be encoded using the URL-safe variant of the base64 encoding. | 232 // keys have to be encoded using the URL-safe variant of the base64 encoding. |
233 std::string NormalizeSenderInfo(const std::string& sender_info) const; | 233 std::string NormalizeSenderInfo(const std::string& sender_info) const; |
234 | 234 |
235 // Checks if a given origin is allowed to use Push. | |
236 bool IsPermissionSet(const GURL& origin); | |
237 | |
238 // Wrapper around {GCMDriver, InstanceID}::GetEncryptionInfo. | 235 // Wrapper around {GCMDriver, InstanceID}::GetEncryptionInfo. |
239 void GetEncryptionInfoForAppId( | 236 void GetEncryptionInfoForAppId( |
240 const std::string& app_id, | 237 const std::string& app_id, |
241 const std::string& sender_id, | 238 const std::string& sender_id, |
242 gcm::GCMEncryptionProvider::EncryptionInfoCallback callback); | 239 gcm::GCMEncryptionProvider::EncryptionInfoCallback callback); |
243 | 240 |
244 gcm::GCMDriver* GetGCMDriver() const; | 241 gcm::GCMDriver* GetGCMDriver() const; |
245 | 242 |
246 instance_id::InstanceIDDriver* GetInstanceIDDriver() const; | 243 instance_id::InstanceIDDriver* GetInstanceIDDriver() const; |
247 | 244 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 // True when shutdown has started. Do not allow processing of incoming | 289 // True when shutdown has started. Do not allow processing of incoming |
293 // messages when this is true. | 290 // messages when this is true. |
294 bool shutdown_started_ = false; | 291 bool shutdown_started_ = false; |
295 | 292 |
296 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_; | 293 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_; |
297 | 294 |
298 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl); | 295 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl); |
299 }; | 296 }; |
300 | 297 |
301 #endif // CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ | 298 #endif // CHROME_BROWSER_PUSH_MESSAGING_PUSH_MESSAGING_SERVICE_IMPL_H_ |
OLD | NEW |