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