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

Side by Side Diff: content/public/common/push_messaging_status.cc

Issue 658783002: Split PushMessagingStatus enum according to use case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
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* PushMessagingStatusToString(PushMessagingStatus status) { 11 const char* PushRegistrationStatusToString(PushRegistrationStatus status) {
12 switch (status) { 12 switch (status) {
13 case PUSH_MESSAGING_STATUS_OK: 13 case PUSH_REGISTRATION_STATUS_SUCCESS:
14 return "Operation has succeeded"; 14 return "Registration successful";
15 15
palmer 2014/10/16 23:07:01 Whitespace nit: Whatever git cl format says
johnme 2014/10/17 12:18:25 git cl format didn't make any changes here (though
16 case PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_NO_SERVICE_WORKER: 16 case PUSH_REGISTRATION_STATUS_NO_SERVICE_WORKER:
17 return "Registration failed - no Service Worker"; 17 return "Registration failed - no Service Worker";
18 18
19 case PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_SERVICE_NOT_AVAILABLE: 19 case PUSH_REGISTRATION_STATUS_SERVICE_NOT_AVAILABLE:
20 return "Registration failed - push service not available"; 20 return "Registration failed - push service not available";
21 21
22 case PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_LIMIT_REACHED: 22 case PUSH_REGISTRATION_STATUS_LIMIT_REACHED:
23 return "Registration failed - registration limit has been reached"; 23 return "Registration failed - registration limit has been reached";
24 24
25 case PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_PERMISSION_DENIED: 25 case PUSH_REGISTRATION_STATUS_PERMISSION_DENIED:
26 return "Registration failed - permission denied"; 26 return "Registration failed - permission denied";
27 27
28 case PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_SERVICE_ERROR: 28 case PUSH_REGISTRATION_STATUS_SERVICE_ERROR:
29 return "Registration failed - push service error"; 29 return "Registration failed - push service error";
30
31 case PUSH_MESSAGING_STATUS_MESSAGE_DELIVERY_FAILED_NO_SERVICE_WORKER:
32 return "Message delivery failed - no Service Worker";
33
34 case PUSH_MESSAGING_STATUS_MESSAGE_DELIVERY_FAILED_SERVICE_WORKER_ERROR:
35 return "Message delivery failed - Service Worker error";
36
37 case PUSH_MESSAGING_STATUS_ERROR:
38 return "Operation has failed (unspecified reason)";
39 } 30 }
40 NOTREACHED(); 31 NOTREACHED();
41 return ""; 32 return "";
42 } 33 }
43 34
44 } // namespace content 35 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/push_messaging_status.h ('k') | content/renderer/push_messaging_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698