| 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 26 matching lines...) Expand all Loading... |
| 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 | 39 |
| 40 case PUSH_REGISTRATION_STATUS_NETWORK_ERROR: | 40 case PUSH_REGISTRATION_STATUS_NETWORK_ERROR: |
| 41 return "Registration failed - could not connect to push server"; | 41 return "Registration failed - could not connect to push server"; |
| 42 | 42 |
| 43 case PUSH_REGISTRATION_STATUS_INCOGNITO_PERMISSION_DENIED: | 43 case PUSH_REGISTRATION_STATUS_INCOGNITO_PERMISSION_DENIED: |
| 44 // We split this out for UMA, but it must be indistinguishable to JS. | 44 // We split this out for UMA, but it must be indistinguishable to JS. |
| 45 return PushRegistrationStatusToString( | 45 return PushRegistrationStatusToString( |
| 46 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED); | 46 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED); |
| 47 |
| 48 case PUSH_REGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE: |
| 49 return "Registration failed - could not retrieve the public key"; |
| 47 } | 50 } |
| 48 NOTREACHED(); | 51 NOTREACHED(); |
| 49 return ""; | 52 return ""; |
| 50 } | 53 } |
| 51 | 54 |
| 52 const char* PushUnregistrationStatusToString(PushUnregistrationStatus status) { | 55 const char* PushUnregistrationStatusToString(PushUnregistrationStatus status) { |
| 53 switch (status) { | 56 switch (status) { |
| 54 case PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED: | 57 case PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED: |
| 55 return "Unregistration successful - from push service"; | 58 return "Unregistration successful - from push service"; |
| 56 | 59 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 75 return "Unregistration failed - storage error"; | 78 return "Unregistration failed - storage error"; |
| 76 | 79 |
| 77 case PUSH_UNREGISTRATION_STATUS_NETWORK_ERROR: | 80 case PUSH_UNREGISTRATION_STATUS_NETWORK_ERROR: |
| 78 return "Unregistration failed - could not connect to push server"; | 81 return "Unregistration failed - could not connect to push server"; |
| 79 } | 82 } |
| 80 NOTREACHED(); | 83 NOTREACHED(); |
| 81 return ""; | 84 return ""; |
| 82 } | 85 } |
| 83 | 86 |
| 84 } // namespace content | 87 } // namespace content |
| OLD | NEW |