Chromium Code Reviews| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 // We split this out for UMA, but it must be indistinguishable to JS. | 45 // We split this out for UMA, but it must be indistinguishable to JS. |
| 46 return PushRegistrationStatusToString( | 46 return PushRegistrationStatusToString( |
| 47 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED); | 47 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED); |
| 48 | 48 |
| 49 case PUSH_REGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE: | 49 case PUSH_REGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE: |
| 50 return "Registration failed - could not retrieve the public key"; | 50 return "Registration failed - could not retrieve the public key"; |
| 51 | 51 |
| 52 case PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING: | 52 case PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING: |
| 53 return "Registration failed - missing applicationServerKey, and manifest " | 53 return "Registration failed - missing applicationServerKey, and manifest " |
| 54 "empty or missing"; | 54 "empty or missing"; |
| 55 | |
| 56 case PUSH_REGISTRATION_STATUS_SENDER_ID_MISMATCH: | |
| 57 return "Registration failed - A subscription with a different sender ID " | |
|
johnme
2016/11/08 13:39:55
Let's be explicit. How about "A subscription with
awdf
2016/11/08 14:39:16
ok - how about "Registration failed - A subscripti
| |
| 58 "already exists"; | |
| 55 } | 59 } |
| 56 NOTREACHED(); | 60 NOTREACHED(); |
| 57 return ""; | 61 return ""; |
| 58 } | 62 } |
| 59 | 63 |
| 60 const char* PushUnregistrationStatusToString(PushUnregistrationStatus status) { | 64 const char* PushUnregistrationStatusToString(PushUnregistrationStatus status) { |
| 61 switch (status) { | 65 switch (status) { |
| 62 case PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED: | 66 case PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED: |
| 63 return "Unregistration successful - from push service"; | 67 return "Unregistration successful - from push service"; |
| 64 | 68 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 83 return "Unregistration failed - storage error"; | 87 return "Unregistration failed - storage error"; |
| 84 | 88 |
| 85 case PUSH_UNREGISTRATION_STATUS_NETWORK_ERROR: | 89 case PUSH_UNREGISTRATION_STATUS_NETWORK_ERROR: |
| 86 return "Unregistration failed - could not connect to push server"; | 90 return "Unregistration failed - could not connect to push server"; |
| 87 } | 91 } |
| 88 NOTREACHED(); | 92 NOTREACHED(); |
| 89 return ""; | 93 return ""; |
| 90 } | 94 } |
| 91 | 95 |
| 92 } // namespace content | 96 } // namespace content |
| OLD | NEW |