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 |
11 const char* PushRegistrationStatusToString(PushRegistrationStatus status) { | 11 const char* PushRegistrationStatusToString(PushRegistrationStatus status) { |
12 switch (status) { | 12 switch (status) { |
13 case PUSH_REGISTRATION_STATUS_SUCCESS: | 13 case PUSH_REGISTRATION_STATUS_SUCCESS: |
14 return "Registration successful"; | 14 return "Registration successful"; |
15 | 15 |
| 16 case PUSH_REGISTRATION_STATUS_SUCCESS_FROM_CACHE: |
| 17 return "Registration successful (from cache)"; |
| 18 |
16 case PUSH_REGISTRATION_STATUS_NO_SERVICE_WORKER: | 19 case PUSH_REGISTRATION_STATUS_NO_SERVICE_WORKER: |
17 return "Registration failed - no Service Worker"; | 20 return "Registration failed - no Service Worker"; |
18 | 21 |
19 case PUSH_REGISTRATION_STATUS_SERVICE_NOT_AVAILABLE: | 22 case PUSH_REGISTRATION_STATUS_SERVICE_NOT_AVAILABLE: |
20 return "Registration failed - push service not available"; | 23 return "Registration failed - push service not available"; |
21 | 24 |
22 case PUSH_REGISTRATION_STATUS_LIMIT_REACHED: | 25 case PUSH_REGISTRATION_STATUS_LIMIT_REACHED: |
23 return "Registration failed - registration limit has been reached"; | 26 return "Registration failed - registration limit has been reached"; |
24 | 27 |
25 case PUSH_REGISTRATION_STATUS_PERMISSION_DENIED: | 28 case PUSH_REGISTRATION_STATUS_PERMISSION_DENIED: |
26 return "Registration failed - permission denied"; | 29 return "Registration failed - permission denied"; |
27 | 30 |
28 case PUSH_REGISTRATION_STATUS_SERVICE_ERROR: | 31 case PUSH_REGISTRATION_STATUS_SERVICE_ERROR: |
29 return "Registration failed - push service error"; | 32 return "Registration failed - push service error"; |
30 | 33 |
31 case PUSH_REGISTRATION_STATUS_NO_SENDER_ID: | 34 case PUSH_REGISTRATION_STATUS_NO_SENDER_ID: |
32 return "Registration failed - no sender id provided"; | 35 return "Registration failed - no sender id provided"; |
33 | 36 |
34 case PUSH_REGISTRATION_STATUS_STORAGE_ERROR: | 37 case PUSH_REGISTRATION_STATUS_STORAGE_ERROR: |
35 return "Registration failed - storage error"; | 38 return "Registration failed - storage error"; |
36 } | 39 } |
37 NOTREACHED(); | 40 NOTREACHED(); |
38 return ""; | 41 return ""; |
39 } | 42 } |
40 | 43 |
41 } // namespace content | 44 } // namespace content |
OLD | NEW |