Index: chrome/browser/services/gcm/gcm_profile_service_factory.cc |
=================================================================== |
--- chrome/browser/services/gcm/gcm_profile_service_factory.cc (revision 255183) |
+++ chrome/browser/services/gcm/gcm_profile_service_factory.cc (working copy) |
@@ -14,7 +14,8 @@ |
// static |
GCMProfileService* GCMProfileServiceFactory::GetForProfile(Profile* profile) { |
- if (!gcm::GCMProfileService::IsGCMEnabled(profile)) |
+ // GCM is not supported in incognito mode. |
+ if (profile->IsOffTheRecord()) |
return NULL; |
return static_cast<GCMProfileService*>( |
@@ -38,8 +39,6 @@ |
BrowserContextKeyedService* GCMProfileServiceFactory::BuildServiceInstanceFor( |
content::BrowserContext* context) const { |
Profile* profile = static_cast<Profile*>(context); |
- if (!gcm::GCMProfileService::IsGCMEnabled(profile)) |
- return NULL; |
GCMProfileService* service = new GCMProfileService(profile); |
scoped_ptr<GCMClientFactory> gcm_client_factory(new GCMClientFactory); |
service->Initialize(gcm_client_factory.Pass()); |