| 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 <bitset> | 7 #include <bitset> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/barrier_closure.h" | 10 #include "base/barrier_closure.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 content::PUSH_USER_VISIBLE_STATUS_LAST + 1); | 76 content::PUSH_USER_VISIBLE_STATUS_LAST + 1); |
| 77 } | 77 } |
| 78 | 78 |
| 79 blink::WebPushPermissionStatus ToPushPermission(ContentSetting setting) { | 79 blink::WebPushPermissionStatus ToPushPermission(ContentSetting setting) { |
| 80 switch (setting) { | 80 switch (setting) { |
| 81 case CONTENT_SETTING_ALLOW: | 81 case CONTENT_SETTING_ALLOW: |
| 82 return blink::WebPushPermissionStatusGranted; | 82 return blink::WebPushPermissionStatusGranted; |
| 83 case CONTENT_SETTING_BLOCK: | 83 case CONTENT_SETTING_BLOCK: |
| 84 return blink::WebPushPermissionStatusDenied; | 84 return blink::WebPushPermissionStatusDenied; |
| 85 case CONTENT_SETTING_ASK: | 85 case CONTENT_SETTING_ASK: |
| 86 return blink::WebPushPermissionStatusDefault; | 86 return blink::WebPushPermissionStatusPrompt; |
| 87 default: | 87 default: |
| 88 NOTREACHED(); | 88 NOTREACHED(); |
| 89 return blink::WebPushPermissionStatusDenied; | 89 return blink::WebPushPermissionStatusDenied; |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 | 92 |
| 93 void UnregisterCallbackToClosure( | 93 void UnregisterCallbackToClosure( |
| 94 const base::Closure& closure, content::PushUnregistrationStatus status) { | 94 const base::Closure& closure, content::PushUnregistrationStatus status) { |
| 95 closure.Run(); | 95 closure.Run(); |
| 96 } | 96 } |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 CONTENT_SETTING_ALLOW; | 905 CONTENT_SETTING_ALLOW; |
| 906 } | 906 } |
| 907 | 907 |
| 908 gcm::GCMDriver* PushMessagingServiceImpl::GetGCMDriver() const { | 908 gcm::GCMDriver* PushMessagingServiceImpl::GetGCMDriver() const { |
| 909 gcm::GCMProfileService* gcm_profile_service = | 909 gcm::GCMProfileService* gcm_profile_service = |
| 910 gcm::GCMProfileServiceFactory::GetForProfile(profile_); | 910 gcm::GCMProfileServiceFactory::GetForProfile(profile_); |
| 911 CHECK(gcm_profile_service); | 911 CHECK(gcm_profile_service); |
| 912 CHECK(gcm_profile_service->driver()); | 912 CHECK(gcm_profile_service->driver()); |
| 913 return gcm_profile_service->driver(); | 913 return gcm_profile_service->driver(); |
| 914 } | 914 } |
| OLD | NEW |