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