Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Unified Diff: content/public/common/push_messaging_status.h

Issue 366323002: Push API: use an enum to indicate status. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Tweak mock error message. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/browser/push_messaging_service.h ('k') | content/public/common/push_messaging_status.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/push_messaging_status.h
diff --git a/content/public/common/push_messaging_status.h b/content/public/common/push_messaging_status.h
new file mode 100644
index 0000000000000000000000000000000000000000..1b77c1452f9aef16a344ce8de7afbea33b621132
--- /dev/null
+++ b/content/public/common/push_messaging_status.h
@@ -0,0 +1,41 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_STATUS_H_
+#define CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_STATUS_H_
+
+namespace content {
+
+enum PushMessagingStatus {
+ // Everything is ok.
+ PUSH_MESSAGING_STATUS_OK,
+
+ // Registration failed because there is no Service Worker.
+ PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_NO_SERVICE_WORKER,
+
+ // Registration failed because the push service is not available.
+ PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_SERVICE_NOT_AVAILABLE,
+
+ // Registration failed because the maximum number of registratons has been
+ // reached.
+ PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_LIMIT_REACHED,
+
+ // Registration failed because permission was denied.
+ PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_PERMISSION_DENIED,
+
+ // Registration failed in the push service implemented by the embedder.
+ PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_SERVICE_ERROR,
+
+ // Generic error (a more specific error should be used whenever possible).
+ PUSH_MESSAGING_STATUS_ERROR,
+
+ // Used for IPC message range checks.
+ PUSH_MESSAGING_STATUS_LAST = PUSH_MESSAGING_STATUS_ERROR
+};
+
+const char* PushMessagingStatusToString(PushMessagingStatus status);
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_COMMON_PUSH_MESSAGING_STATUS_STATUS_H_
« no previous file with comments | « content/public/browser/push_messaging_service.h ('k') | content/public/common/push_messaging_status.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698