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

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

Issue 2152823003: Push: Update sender ID missing error messages for applicationServerKey (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also fix PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING Created 4 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 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
(...skipping 11 matching lines...) Expand all
22 case PUSH_REGISTRATION_STATUS_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_REGISTRATION_STATUS_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_REGISTRATION_STATUS_SERVICE_ERROR: 28 case PUSH_REGISTRATION_STATUS_SERVICE_ERROR:
29 return "Registration failed - push service error"; 29 return "Registration failed - push service error";
30 30
31 case PUSH_REGISTRATION_STATUS_NO_SENDER_ID: 31 case PUSH_REGISTRATION_STATUS_NO_SENDER_ID:
32 return "Registration failed - gcm_sender_id not found in manifest"; 32 return "Registration failed - missing applicationServerKey, and "
33 "gcm_sender_id not found in manifest";
33 34
34 case PUSH_REGISTRATION_STATUS_STORAGE_ERROR: 35 case PUSH_REGISTRATION_STATUS_STORAGE_ERROR:
35 return "Registration failed - storage error"; 36 return "Registration failed - storage error";
36 37
37 case PUSH_REGISTRATION_STATUS_SUCCESS_FROM_CACHE: 38 case PUSH_REGISTRATION_STATUS_SUCCESS_FROM_CACHE:
38 return "Registration successful - from cache"; 39 return "Registration successful - from cache";
39 40
40 case PUSH_REGISTRATION_STATUS_NETWORK_ERROR: 41 case PUSH_REGISTRATION_STATUS_NETWORK_ERROR:
41 return "Registration failed - could not connect to push server"; 42 return "Registration failed - could not connect to push server";
42 43
43 case PUSH_REGISTRATION_STATUS_INCOGNITO_PERMISSION_DENIED: 44 case PUSH_REGISTRATION_STATUS_INCOGNITO_PERMISSION_DENIED:
44 // We split this out for UMA, but it must be indistinguishable to JS. 45 // We split this out for UMA, but it must be indistinguishable to JS.
45 return PushRegistrationStatusToString( 46 return PushRegistrationStatusToString(
46 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED); 47 PUSH_REGISTRATION_STATUS_PERMISSION_DENIED);
47 48
48 case PUSH_REGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE: 49 case PUSH_REGISTRATION_STATUS_PUBLIC_KEY_UNAVAILABLE:
49 return "Registration failed - could not retrieve the public key"; 50 return "Registration failed - could not retrieve the public key";
50 51
51 case PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING: 52 case PUSH_REGISTRATION_STATUS_MANIFEST_EMPTY_OR_MISSING:
52 return "Registration failed - manifest empty or missing"; 53 return "Registration failed - missing applicationServerKey, and manifest "
54 "empty or missing";
53 } 55 }
54 NOTREACHED(); 56 NOTREACHED();
55 return ""; 57 return "";
56 } 58 }
57 59
58 const char* PushUnregistrationStatusToString(PushUnregistrationStatus status) { 60 const char* PushUnregistrationStatusToString(PushUnregistrationStatus status) {
59 switch (status) { 61 switch (status) {
60 case PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED: 62 case PUSH_UNREGISTRATION_STATUS_SUCCESS_UNREGISTERED:
61 return "Unregistration successful - from push service"; 63 return "Unregistration successful - from push service";
62 64
(...skipping 18 matching lines...) Expand all
81 return "Unregistration failed - storage error"; 83 return "Unregistration failed - storage error";
82 84
83 case PUSH_UNREGISTRATION_STATUS_NETWORK_ERROR: 85 case PUSH_UNREGISTRATION_STATUS_NETWORK_ERROR:
84 return "Unregistration failed - could not connect to push server"; 86 return "Unregistration failed - could not connect to push server";
85 } 87 }
86 NOTREACHED(); 88 NOTREACHED();
87 return ""; 89 return "";
88 } 90 }
89 91
90 } // namespace content 92 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698