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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 const gcm::GCMClient::SendErrorDetails& send_error_details) { | 342 const gcm::GCMClient::SendErrorDetails& send_error_details) { |
343 NOTREACHED() << "The Push API shouldn't have sent messages upstream"; | 343 NOTREACHED() << "The Push API shouldn't have sent messages upstream"; |
344 } | 344 } |
345 | 345 |
346 void PushMessagingServiceImpl::OnSendAcknowledged( | 346 void PushMessagingServiceImpl::OnSendAcknowledged( |
347 const std::string& app_id, | 347 const std::string& app_id, |
348 const std::string& message_id) { | 348 const std::string& message_id) { |
349 NOTREACHED() << "The Push API shouldn't have sent messages upstream"; | 349 NOTREACHED() << "The Push API shouldn't have sent messages upstream"; |
350 } | 350 } |
351 | 351 |
352 // GetPushEndpoint method ------------------------------------------------------ | 352 // GetEndpoint method ---------------------------------------------------------- |
353 | 353 |
354 GURL PushMessagingServiceImpl::GetPushEndpoint() { | 354 GURL PushMessagingServiceImpl::GetEndpoint(bool standard_protocol) const { |
355 return GURL(std::string(kPushMessagingEndpoint)); | 355 return GURL(standard_protocol ? kPushMessagingPushProtocolEndpoint |
| 356 : kPushMessagingGcmEndpoint); |
356 } | 357 } |
357 | 358 |
358 // Subscribe and GetPermissionStatus methods ----------------------------------- | 359 // Subscribe and GetPermissionStatus methods ----------------------------------- |
359 | 360 |
360 void PushMessagingServiceImpl::SubscribeFromDocument( | 361 void PushMessagingServiceImpl::SubscribeFromDocument( |
361 const GURL& requesting_origin, | 362 const GURL& requesting_origin, |
362 int64_t service_worker_registration_id, | 363 int64_t service_worker_registration_id, |
363 int renderer_id, | 364 int renderer_id, |
364 int render_frame_id, | 365 int render_frame_id, |
365 const content::PushSubscriptionOptions& options, | 366 const content::PushSubscriptionOptions& options, |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 blink::WebPushPermissionStatusGranted; | 789 blink::WebPushPermissionStatusGranted; |
789 } | 790 } |
790 | 791 |
791 gcm::GCMDriver* PushMessagingServiceImpl::GetGCMDriver() const { | 792 gcm::GCMDriver* PushMessagingServiceImpl::GetGCMDriver() const { |
792 gcm::GCMProfileService* gcm_profile_service = | 793 gcm::GCMProfileService* gcm_profile_service = |
793 gcm::GCMProfileServiceFactory::GetForProfile(profile_); | 794 gcm::GCMProfileServiceFactory::GetForProfile(profile_); |
794 CHECK(gcm_profile_service); | 795 CHECK(gcm_profile_service); |
795 CHECK(gcm_profile_service->driver()); | 796 CHECK(gcm_profile_service->driver()); |
796 return gcm_profile_service->driver(); | 797 return gcm_profile_service->driver(); |
797 } | 798 } |
OLD | NEW |