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

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

Issue 165993005: [GCM] Make sure GCM checkout logic is invoked when the profile is signed out (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test Created 6 years, 10 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/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 aff75d89c5d017478446879f41fd05ac13f3b9db..c5b2469073530f9c970ccbc2ccf0f2db328ae997 100644
--- a/chrome/browser/services/gcm/gcm_profile_service_factory.cc
+++ b/chrome/browser/services/gcm/gcm_profile_service_factory.cc
@@ -14,7 +14,8 @@ namespace gcm {
// 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 @@ GCMProfileServiceFactory::~GCMProfileServiceFactory() {
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());

Powered by Google App Engine
This is Rietveld 408576698