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/public/common/push_messaging_status.h" | 5 #include "content/public/common/push_messaging_status.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 return "Registration failed - push service error"; | 29 return "Registration failed - push service error"; |
30 | 30 |
31 case PUSH_REGISTRATION_STATUS_NO_SENDER_ID: | 31 case PUSH_REGISTRATION_STATUS_NO_SENDER_ID: |
32 return "Registration failed - no sender id provided"; | 32 return "Registration failed - no sender id provided"; |
33 | 33 |
34 case PUSH_REGISTRATION_STATUS_STORAGE_ERROR: | 34 case PUSH_REGISTRATION_STATUS_STORAGE_ERROR: |
35 return "Registration failed - storage error"; | 35 return "Registration failed - storage error"; |
36 | 36 |
37 case PUSH_REGISTRATION_STATUS_SUCCESS_FROM_CACHE: | 37 case PUSH_REGISTRATION_STATUS_SUCCESS_FROM_CACHE: |
38 return "Registration successful - from cache"; | 38 return "Registration successful - from cache"; |
| 39 |
| 40 case PUSH_REGISTRATION_STATUS_NETWORK_ERROR: |
| 41 return "Registration failed - could not connect to push server"; |
| 42 |
| 43 case PUSH_REGISTRATION_STATUS_INCOGNITO_PERMISSION_DENIED: |
| 44 // We split this out for UMA, but it must be indistinguishable to JS. |
| 45 return PushRegistrationStatusToString( |
| 46 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED); |
39 } | 47 } |
40 NOTREACHED(); | 48 NOTREACHED(); |
41 return ""; | 49 return ""; |
| 50 } |
| 51 |
| 52 const char* PushUnregistrationStatusToString(PushUnregistrationStatus status) { |
| 53 switch (status) { |
| 54 case PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED: |
| 55 return "Unregistration successful - from push service"; |
| 56 |
| 57 case PUSH_UNREGISTRATION_STATUS_SUCCESS_WAS_NOT_REGISTERED: |
| 58 return "Unregistration successful - was not registered"; |
| 59 |
| 60 case PUSH_UNREGISTRATION_STATUS_PENDING_WILL_RETRY_NETWORK_ERROR: |
| 61 return "Unregistration pending - a network error occurred, but it will" |
| 62 "be retried until it succeeds"; |
| 63 |
| 64 case PUSH_UNREGISTRATION_STATUS_NO_SERVICE_WORKER: |
| 65 return "Unregistration failed - no Service Worker"; |
| 66 |
| 67 case PUSH_UNREGISTRATION_STATUS_SERVICE_NOT_AVAILABLE: |
| 68 return "Unregistration failed - push service not available"; |
| 69 |
| 70 case PUSH_UNREGISTRATION_STATUS_SERVICE_ERROR: |
| 71 return "Unregistration failed - push service error"; |
| 72 |
| 73 case PUSH_UNREGISTRATION_STATUS_STORAGE_ERROR: |
| 74 return "Unregistration failed - storage error"; |
| 75 |
| 76 case PUSH_UNREGISTRATION_STATUS_NETWORK_ERROR: |
| 77 return "Unregistration failed - could not connect to push server"; |
| 78 } |
| 79 NOTREACHED(); |
| 80 return ""; |
42 } | 81 } |
43 | 82 |
44 } // namespace content | 83 } // namespace content |
OLD | NEW |