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

Unified Diff: chrome/browser/services/gcm/push_messaging_service_impl.cc

Issue 658783002: Split PushMessagingStatus enum according to use case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/services/gcm/push_messaging_service_impl.h ('k') | content/browser/browser_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/services/gcm/push_messaging_service_impl.cc
diff --git a/chrome/browser/services/gcm/push_messaging_service_impl.cc b/chrome/browser/services/gcm/push_messaging_service_impl.cc
index ec7b461420d340288fffabedf7ac30dc566b2b98..ee49c0a12921645e09c7dcb76adb53a4cebe77ad 100644
--- a/chrome/browser/services/gcm/push_messaging_service_impl.cc
+++ b/chrome/browser/services/gcm/push_messaging_service_impl.cc
@@ -132,7 +132,7 @@ void PushMessagingServiceImpl::OnMessage(
void PushMessagingServiceImpl::DeliverMessageCallback(
const PushMessagingApplicationId& application_id,
const GCMClient::IncomingMessage& message,
- content::PushMessagingStatus status) {
+ content::PushDeliveryStatus status) {
// TODO(mvanouwerkerk): UMA logging.
// TODO(mvanouwerkerk): Is there a way to recover from failure?
}
@@ -172,10 +172,9 @@ void PushMessagingServiceImpl::Register(
if (profile_->GetPrefs()->GetInteger(
prefs::kPushMessagingRegistrationCount) >= kMaxRegistrations) {
- RegisterEnd(
- callback,
- std::string(),
- content::PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_LIMIT_REACHED);
+ RegisterEnd(callback,
+ std::string(),
+ content::PUSH_REGISTRATION_STATUS_LIMIT_REACHED);
return;
}
@@ -212,10 +211,9 @@ void PushMessagingServiceImpl::Register(
gcm::PushMessagingPermissionContextFactory::GetForProfile(profile_);
if (permission_context == NULL) {
- RegisterEnd(
- callback,
- std::string(),
- content::PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_PERMISSION_DENIED);
+ RegisterEnd(callback,
+ std::string(),
+ content::PUSH_REGISTRATION_STATUS_PERMISSION_DENIED);
return;
}
@@ -234,10 +232,10 @@ void PushMessagingServiceImpl::Register(
void PushMessagingServiceImpl::RegisterEnd(
const content::PushMessagingService::RegisterCallback& callback,
const std::string& registration_id,
- content::PushMessagingStatus status) {
+ content::PushRegistrationStatus status) {
GURL endpoint = GURL("https://android.googleapis.com/gcm/send");
callback.Run(endpoint, registration_id, status);
- if (status == content::PUSH_MESSAGING_STATUS_OK) {
+ if (status == content::PUSH_REGISTRATION_STATUS_SUCCESS) {
// TODO(johnme): Make sure the pref doesn't get out of sync after crashes.
int registration_count = profile_->GetPrefs()->GetInteger(
prefs::kPushMessagingRegistrationCount);
@@ -250,10 +248,10 @@ void PushMessagingServiceImpl::DidRegister(
const content::PushMessagingService::RegisterCallback& callback,
const std::string& registration_id,
GCMClient::Result result) {
- content::PushMessagingStatus status =
+ content::PushRegistrationStatus status =
result == GCMClient::SUCCESS
- ? content::PUSH_MESSAGING_STATUS_OK
- : content::PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_SERVICE_ERROR;
+ ? content::PUSH_REGISTRATION_STATUS_SUCCESS
+ : content::PUSH_REGISTRATION_STATUS_SERVICE_ERROR;
RegisterEnd(callback, registration_id, status);
}
@@ -263,10 +261,9 @@ void PushMessagingServiceImpl::DidRequestPermission(
const content::PushMessagingService::RegisterCallback& register_callback,
bool allow) {
if (!allow) {
- RegisterEnd(
- register_callback,
- std::string(),
- content::PUSH_MESSAGING_STATUS_REGISTRATION_FAILED_PERMISSION_DENIED);
+ RegisterEnd(register_callback,
+ std::string(),
+ content::PUSH_REGISTRATION_STATUS_PERMISSION_DENIED);
return;
}
« no previous file with comments | « chrome/browser/services/gcm/push_messaging_service_impl.h ('k') | content/browser/browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698