| 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 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" | 5 #include "chrome/browser/push_messaging/push_messaging_service_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/barrier_closure.h" | 9 #include "base/barrier_closure.h" |
| 10 #include "base/base64url.h" | 10 #include "base/base64url.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 const gcm::GCMClient::SendErrorDetails& send_error_details) { | 328 const gcm::GCMClient::SendErrorDetails& send_error_details) { |
| 329 NOTREACHED() << "The Push API shouldn't have sent messages upstream"; | 329 NOTREACHED() << "The Push API shouldn't have sent messages upstream"; |
| 330 } | 330 } |
| 331 | 331 |
| 332 void PushMessagingServiceImpl::OnSendAcknowledged( | 332 void PushMessagingServiceImpl::OnSendAcknowledged( |
| 333 const std::string& app_id, | 333 const std::string& app_id, |
| 334 const std::string& message_id) { | 334 const std::string& message_id) { |
| 335 NOTREACHED() << "The Push API shouldn't have sent messages upstream"; | 335 NOTREACHED() << "The Push API shouldn't have sent messages upstream"; |
| 336 } | 336 } |
| 337 | 337 |
| 338 // GetPushEndpoint method ------------------------------------------------------ | 338 // GetEndpoint method ---------------------------------------------------------- |
| 339 | 339 |
| 340 GURL PushMessagingServiceImpl::GetPushEndpoint() { | 340 GURL PushMessagingServiceImpl::GetEndpoint(bool standard_protocol) const { |
| 341 return GURL(std::string(kPushMessagingEndpoint)); | 341 return GURL(standard_protocol ? kPushMessagingPushProtocolEndpoint |
| 342 : kPushMessagingEndpoint); |
| 342 } | 343 } |
| 343 | 344 |
| 344 // Subscribe and GetPermissionStatus methods ----------------------------------- | 345 // Subscribe and GetPermissionStatus methods ----------------------------------- |
| 345 | 346 |
| 346 void PushMessagingServiceImpl::SubscribeFromDocument( | 347 void PushMessagingServiceImpl::SubscribeFromDocument( |
| 347 const GURL& requesting_origin, | 348 const GURL& requesting_origin, |
| 348 int64_t service_worker_registration_id, | 349 int64_t service_worker_registration_id, |
| 349 int renderer_id, | 350 int renderer_id, |
| 350 int render_frame_id, | 351 int render_frame_id, |
| 351 const content::PushSubscriptionOptions& options, | 352 const content::PushSubscriptionOptions& options, |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 blink::WebPushPermissionStatusGranted; | 775 blink::WebPushPermissionStatusGranted; |
| 775 } | 776 } |
| 776 | 777 |
| 777 gcm::GCMDriver* PushMessagingServiceImpl::GetGCMDriver() const { | 778 gcm::GCMDriver* PushMessagingServiceImpl::GetGCMDriver() const { |
| 778 gcm::GCMProfileService* gcm_profile_service = | 779 gcm::GCMProfileService* gcm_profile_service = |
| 779 gcm::GCMProfileServiceFactory::GetForProfile(profile_); | 780 gcm::GCMProfileServiceFactory::GetForProfile(profile_); |
| 780 CHECK(gcm_profile_service); | 781 CHECK(gcm_profile_service); |
| 781 CHECK(gcm_profile_service->driver()); | 782 CHECK(gcm_profile_service->driver()); |
| 782 return gcm_profile_service->driver(); | 783 return gcm_profile_service->driver(); |
| 783 } | 784 } |
| OLD | NEW |