Index: chrome/browser/extensions/api/gcm/gcm_api.cc |
=================================================================== |
--- chrome/browser/extensions/api/gcm/gcm_api.cc (revision 255183) |
+++ chrome/browser/extensions/api/gcm/gcm_api.cc (working copy) |
@@ -97,8 +97,14 @@ |
} |
bool GcmApiFunction::IsGcmApiEnabled() const { |
- return gcm::GCMProfileService::IsGCMEnabled( |
- Profile::FromBrowserContext(context())); |
+ Profile* profile = Profile::FromBrowserContext(context()); |
+ |
+ // GCM is not supported in incognito mode. |
+ if (profile->IsOffTheRecord()) |
+ return false; |
+ |
+ return gcm::GCMProfileService::GetGCMEnabledState(profile) != |
+ gcm::GCMProfileService::ALWAYS_DISABLED; |
} |
gcm::GCMProfileService* GcmApiFunction::GCMProfileService() const { |