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

Unified Diff: chrome/browser/services/gcm/instance_id/instance_id_profile_service.cc

Issue 1128123003: Implement InstanceID API functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 5 years, 7 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 | « chrome/browser/services/gcm/instance_id/instance_id_profile_service.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/services/gcm/instance_id/instance_id_profile_service.cc
diff --git a/chrome/browser/services/gcm/instance_id/instance_id_profile_service.cc b/chrome/browser/services/gcm/instance_id/instance_id_profile_service.cc
index 60d3c2a04a24400a7bfd9d7c5cb96629dd404cf0..47a6f3a06ca398a748512b1369e86e658217662e 100644
--- a/chrome/browser/services/gcm/instance_id/instance_id_profile_service.cc
+++ b/chrome/browser/services/gcm/instance_id/instance_id_profile_service.cc
@@ -8,10 +8,25 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/services/gcm/gcm_profile_service.h"
#include "chrome/browser/services/gcm/gcm_profile_service_factory.h"
+#include "chrome/common/chrome_version_info.h"
#include "components/gcm_driver/instance_id/instance_id_driver.h"
namespace instance_id {
+// static
+bool InstanceIDProfileService::IsInstanceIDEnabled(Profile* profile) {
+ // Instance ID depends on GCM which has to been enabled.
+ if (!gcm::GCMProfileService::IsGCMEnabled(profile))
+ return false;
+
+ // Enabled for trunk build.
+ chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
+ if (channel == chrome::VersionInfo::CHANNEL_UNKNOWN)
+ return true;
+
+ return InstanceIDDriver::IsInstanceIDEnabled();
+}
+
InstanceIDProfileService::InstanceIDProfileService(Profile* profile) {
DCHECK(!profile->IsOffTheRecord());
« no previous file with comments | « chrome/browser/services/gcm/instance_id/instance_id_profile_service.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698