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