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/bind.h" | 10 #include "base/bind.h" |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 const GURL& embedding_origin, | 399 const GURL& embedding_origin, |
400 bool user_visible) { | 400 bool user_visible) { |
401 // TODO(peter): Consider |user_visible| when checking Push permission. | 401 // TODO(peter): Consider |user_visible| when checking Push permission. |
402 | 402 |
403 PushMessagingPermissionContext* permission_context = | 403 PushMessagingPermissionContext* permission_context = |
404 PushMessagingPermissionContextFactory::GetForProfile(profile_); | 404 PushMessagingPermissionContextFactory::GetForProfile(profile_); |
405 return ToPushPermission(permission_context->GetPermissionStatus( | 405 return ToPushPermission(permission_context->GetPermissionStatus( |
406 requesting_origin, embedding_origin)); | 406 requesting_origin, embedding_origin)); |
407 } | 407 } |
408 | 408 |
| 409 bool PushMessagingServiceImpl::SupportNonVisibleMessages() { |
| 410 return false; |
| 411 } |
| 412 |
409 void PushMessagingServiceImpl::RegisterEnd( | 413 void PushMessagingServiceImpl::RegisterEnd( |
410 const content::PushMessagingService::RegisterCallback& callback, | 414 const content::PushMessagingService::RegisterCallback& callback, |
411 const std::string& registration_id, | 415 const std::string& registration_id, |
412 content::PushRegistrationStatus status) { | 416 content::PushRegistrationStatus status) { |
413 callback.Run(registration_id, status); | 417 callback.Run(registration_id, status); |
414 } | 418 } |
415 | 419 |
416 void PushMessagingServiceImpl::DidRegister( | 420 void PushMessagingServiceImpl::DidRegister( |
417 const PushMessagingAppIdentifier& app_identifier, | 421 const PushMessagingAppIdentifier& app_identifier, |
418 const content::PushMessagingService::RegisterCallback& callback, | 422 const content::PushMessagingService::RegisterCallback& callback, |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 CONTENT_SETTING_ALLOW; | 644 CONTENT_SETTING_ALLOW; |
641 } | 645 } |
642 | 646 |
643 gcm::GCMDriver* PushMessagingServiceImpl::GetGCMDriver() const { | 647 gcm::GCMDriver* PushMessagingServiceImpl::GetGCMDriver() const { |
644 gcm::GCMProfileService* gcm_profile_service = | 648 gcm::GCMProfileService* gcm_profile_service = |
645 gcm::GCMProfileServiceFactory::GetForProfile(profile_); | 649 gcm::GCMProfileServiceFactory::GetForProfile(profile_); |
646 CHECK(gcm_profile_service); | 650 CHECK(gcm_profile_service); |
647 CHECK(gcm_profile_service->driver()); | 651 CHECK(gcm_profile_service->driver()); |
648 return gcm_profile_service->driver(); | 652 return gcm_profile_service->driver(); |
649 } | 653 } |
OLD | NEW |