Index: chrome/browser/services/gcm/gcm_profile_service_factory.cc |
diff --git a/chrome/browser/services/gcm/gcm_profile_service_factory.cc b/chrome/browser/services/gcm/gcm_profile_service_factory.cc |
index 2e380b1579c4542e8d3e1eacd52d159352c6a8f3..2cd5bd723ca605c4259b7ff90987b56b42139ce1 100644 |
--- a/chrome/browser/services/gcm/gcm_profile_service_factory.cc |
+++ b/chrome/browser/services/gcm/gcm_profile_service_factory.cc |
@@ -50,11 +50,9 @@ GCMProfileServiceFactory::~GCMProfileServiceFactory() { |
KeyedService* GCMProfileServiceFactory::BuildServiceInstanceFor( |
content::BrowserContext* context) const { |
- Profile* profile = static_cast<Profile*>(context); |
- GCMProfileService* service = new GCMProfileService(profile); |
- scoped_ptr<GCMClientFactory> gcm_client_factory(new GCMClientFactory); |
- service->Initialize(gcm_client_factory.Pass()); |
- return service; |
+ return new GCMProfileService( |
+ Profile::FromBrowserContext(context), |
+ scoped_ptr<GCMClientFactory>(new GCMClientFactory)); |
} |
content::BrowserContext* GCMProfileServiceFactory::GetBrowserContextToUse( |