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

Unified Diff: chrome/browser/extensions/api/gcm/gcm_api.cc

Issue 225403021: Extract Profile-independent GCMService from GCMProfileService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Provide GCMService with the list of all accounts. It does use it after all. Created 6 years, 8 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
Index: chrome/browser/extensions/api/gcm/gcm_api.cc
diff --git a/chrome/browser/extensions/api/gcm/gcm_api.cc b/chrome/browser/extensions/api/gcm/gcm_api.cc
index 65b1d49ec5b647fa87d069f6f85fd9cdff02b7f6..1da179921b7dfd202d9ddaad645c451c51516ca0 100644
--- a/chrome/browser/extensions/api/gcm/gcm_api.cc
+++ b/chrome/browser/extensions/api/gcm/gcm_api.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/services/gcm/gcm_profile_service.h"
#include "chrome/browser/services/gcm/gcm_profile_service_factory.h"
+#include "chrome/browser/services/gcm/gcm_service.h"
#include "chrome/common/extensions/api/gcm.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/extension.h"
@@ -97,7 +98,7 @@ bool GcmApiFunction::IsGcmApiEnabled() const {
gcm::GCMProfileService::ALWAYS_DISABLED;
}
-gcm::GCMProfileService* GcmApiFunction::GCMProfileService() const {
+gcm::GCMService* GcmApiFunction::GCMService() const {
jianli 2014/04/17 00:33:19 GCMProfileServiceFactory::GetForProfile returns GC
bartfab (slow) 2014/04/17 14:20:01 Done.
return gcm::GCMProfileServiceFactory::GetForProfile(
Profile::FromBrowserContext(browser_context()));
}
@@ -111,7 +112,7 @@ bool GcmRegisterFunction::DoWork() {
api::gcm::Register::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
- GCMProfileService()->Register(
+ GCMService()->Register(
GetExtension()->id(),
params->sender_ids,
base::Bind(&GcmRegisterFunction::CompleteFunctionWithResult, this));
@@ -132,7 +133,7 @@ GcmUnregisterFunction::GcmUnregisterFunction() {}
GcmUnregisterFunction::~GcmUnregisterFunction() {}
bool GcmUnregisterFunction::DoWork() {
- GCMProfileService()->Unregister(
+ GCMService()->Unregister(
GetExtension()->id(),
base::Bind(&GcmUnregisterFunction::CompleteFunctionWithResult, this));
@@ -162,7 +163,7 @@ bool GcmSendFunction::DoWork() {
if (params->message.time_to_live.get())
outgoing_message.time_to_live = *params->message.time_to_live;
- GCMProfileService()->Send(
+ GCMService()->Send(
GetExtension()->id(),
params->message.destination_id,
outgoing_message,

Powered by Google App Engine
This is Rietveld 408576698