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

Unified Diff: chrome/browser/extensions/api/gcm/gcm_api.cc

Issue 184273011: Merge 253787 "[GCM] Make sure GCM checkout logic is invoked when..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1847/src/
Patch Set: 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/gcm/gcm_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « no previous file | chrome/browser/extensions/api/gcm/gcm_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698