| 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 a8a5be20d4d07d333fbb44ceb1b196262f64d172..ca57f8af9eff399d596e6390336646f32595c450 100644
|
| --- a/chrome/browser/extensions/api/gcm/gcm_api.cc
|
| +++ b/chrome/browser/extensions/api/gcm/gcm_api.cc
|
| @@ -97,8 +97,14 @@ bool GcmApiFunction::RunImpl() {
|
| }
|
|
|
| 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 {
|
|
|