| 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 #ifndef CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_STATUS_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ |
| 6 #define CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_STATUS_H_ | 6 #define CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ |
| 7 | 7 |
| 8 namespace content { | 8 namespace content { |
| 9 | 9 |
| 10 enum PushMessagingStatus { | 10 enum PushRegistrationStatus { |
| 11 // Everything is ok. | 11 // Registration was successful. |
| 12 PUSH_MESSAGING_STATUS_OK, | 12 PUSH_REGISTRATION_STATUS_SUCCESS, |
| 13 | 13 |
| 14 // Registration failed because there is no Service Worker. | 14 // Registration failed because there is no Service Worker. |
| 15 PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_NO_SERVICE_WORKER, | 15 PUSH_REGISTRATION_STATUS_NO_SERVICE_WORKER, |
| 16 | 16 |
| 17 // Registration failed because the push service is not available. | 17 // Registration failed because the push service is not available. |
| 18 PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_SERVICE_NOT_AVAILABLE, | 18 PUSH_REGISTRATION_STATUS_SERVICE_NOT_AVAILABLE, |
| 19 | 19 |
| 20 // Registration failed because the maximum number of registratons has been | 20 // Registration failed because the maximum number of registratons has been |
| 21 // reached. | 21 // reached. |
| 22 PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_LIMIT_REACHED, | 22 PUSH_REGISTRATION_STATUS_LIMIT_REACHED, |
| 23 | 23 |
| 24 // Registration failed because permission was denied. | 24 // Registration failed because permission was denied. |
| 25 PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_PERMISSION_DENIED, | 25 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED, |
| 26 | 26 |
| 27 // Registration failed in the push service implemented by the embedder. | 27 // Registration failed in the push service implemented by the embedder. |
| 28 PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_SERVICE_ERROR, | 28 PUSH_REGISTRATION_STATUS_SERVICE_ERROR, |
| 29 |
| 30 // Used for IPC message range checks. |
| 31 PUSH_REGISTRATION_STATUS_LAST = PUSH_REGISTRATION_STATUS_SERVICE_ERROR |
| 32 }; |
| 33 |
| 34 enum PushDeliveryStatus { |
| 35 // The message was successfully delivered. |
| 36 PUSH_DELIVERY_STATUS_SUCCESS, |
| 29 | 37 |
| 30 // The message could not be delivered because no service worker was found. | 38 // The message could not be delivered because no service worker was found. |
| 31 PUSH_MESSAGING_STATUS_MESSAGE_DELIVERY_FAILED_NO_SERVICE_WORKER, | 39 PUSH_DELIVERY_STATUS_NO_SERVICE_WORKER, |
| 32 | 40 |
| 33 // The message could not be delivered because of a service worker error. | 41 // The message could not be delivered because of a service worker error. |
| 34 PUSH_MESSAGING_STATUS_MESSAGE_DELIVERY_FAILED_SERVICE_WORKER_ERROR, | 42 PUSH_DELIVERY_STATUS_SERVICE_WORKER_ERROR, |
| 35 | |
| 36 // Generic error (a more specific error should be used whenever possible). | |
| 37 PUSH_MESSAGING_STATUS_ERROR, | |
| 38 | 43 |
| 39 // Used for IPC message range checks. | 44 // Used for IPC message range checks. |
| 40 PUSH_MESSAGING_STATUS_LAST = PUSH_MESSAGING_STATUS_ERROR | 45 PUSH_DELIVERY_STATUS_LAST = PUSH_DELIVERY_STATUS_SERVICE_WORKER_ERROR |
| 41 }; | 46 }; |
| 42 | 47 |
| 43 const char* PushMessagingStatusToString(PushMessagingStatus status); | 48 const char* PushRegistrationStatusToString(PushRegistrationStatus status); |
| 44 | 49 |
| 45 } // namespace content | 50 } // namespace content |
| 46 | 51 |
| 47 #endif // CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_STATUS_H_ | 52 #endif // CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_H_ |
| OLD | NEW |