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()); |