| 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 "content/child/push_messaging/push_provider.h" | 5 #include "content/child/push_messaging/push_provider.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 } // namespace | 39 } // namespace |
| 40 | 40 |
| 41 const blink::WebPushError PushRegistrationStatusToWebPushError( | 41 const blink::WebPushError PushRegistrationStatusToWebPushError( |
| 42 PushRegistrationStatus status) { | 42 PushRegistrationStatus status) { |
| 43 blink::WebPushError::ErrorType error_type; | 43 blink::WebPushError::ErrorType error_type; |
| 44 switch (status) { | 44 switch (status) { |
| 45 case PUSH_REGISTRATION_STATUS_PERMISSION_DENIED: | 45 case PUSH_REGISTRATION_STATUS_PERMISSION_DENIED: |
| 46 error_type = blink::WebPushError::ErrorTypeNotAllowed; | 46 error_type = blink::WebPushError::ErrorTypeNotAllowed; |
| 47 break; | 47 break; |
| 48 case PUSH_REGISTRATION_STATUS_SENDER_ID_MISMATCH: |
| 49 error_type = blink::WebPushError::ErrorTypeInvalidState; |
| 50 break; |
| 48 case PUSH_REGISTRATION_STATUS_SUCCESS_FROM_PUSH_SERVICE: | 51 case PUSH_REGISTRATION_STATUS_SUCCESS_FROM_PUSH_SERVICE: |
| 49 case PUSH_REGISTRATION_STATUS_NO_SERVICE_WORKER: | 52 case PUSH_REGISTRATION_STATUS_NO_SERVICE_WORKER: |
| 50 case PUSH_REGISTRATION_STATUS_SERVICE_NOT_AVAILABLE: | 53 case PUSH_REGISTRATION_STATUS_SERVICE_NOT_AVAILABLE: |
| 51 case PUSH_REGISTRATION_STATUS_LIMIT_REACHED: | 54 case PUSH_REGISTRATION_STATUS_LIMIT_REACHED: |
| 52 case PUSH_REGISTRATION_STATUS_SERVICE_ERROR: | 55 case PUSH_REGISTRATION_STATUS_SERVICE_ERROR: |
| 53 case PUSH_REGISTRATION_STATUS_NO_SENDER_ID: | 56 case PUSH_REGISTRATION_STATUS_NO_SENDER_ID: |
| 54 case PUSH_REGISTRATION_STATUS_STORAGE_ERROR: | 57 case PUSH_REGISTRATION_STATUS_STORAGE_ERROR: |
| 55 case PUSH_REGISTRATION_STATUS_SUCCESS_FROM_CACHE: | 58 case PUSH_REGISTRATION_STATUS_SUCCESS_FROM_CACHE: |
| 56 case PUSH_REGISTRATION_STATUS_NETWORK_ERROR: | 59 case PUSH_REGISTRATION_STATUS_NETWORK_ERROR: |
| 57 case PUSH_REGISTRATION_STATUS_INCOGNITO_PERMISSION_DENIED: | 60 case PUSH_REGISTRATION_STATUS_INCOGNITO_PERMISSION_DENIED: |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 "supported."; | 300 "supported."; |
| 298 } | 301 } |
| 299 | 302 |
| 300 callbacks->onError( | 303 callbacks->onError( |
| 301 blink::WebPushError(error, blink::WebString::fromUTF8(error_message))); | 304 blink::WebPushError(error, blink::WebString::fromUTF8(error_message))); |
| 302 | 305 |
| 303 permission_status_callbacks_.Remove(request_id); | 306 permission_status_callbacks_.Remove(request_id); |
| 304 } | 307 } |
| 305 | 308 |
| 306 } // namespace content | 309 } // namespace content |
| OLD | NEW |