| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/services/gcm/instance_id/instance_id_profile_service.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 #include "chrome/browser/profiles/profile.h" | |
| 9 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" | |
| 10 #include "components/gcm_driver/gcm_profile_service.h" | |
| 11 #include "components/gcm_driver/instance_id/instance_id_driver.h" | |
| 12 | |
| 13 namespace instance_id { | |
| 14 | |
| 15 // static | |
| 16 bool InstanceIDProfileService::IsInstanceIDEnabled(Profile* profile) { | |
| 17 // Instance ID depends on GCM which has to been enabled. | |
| 18 if (!gcm::GCMProfileService::IsGCMEnabled(profile->GetPrefs())) | |
| 19 return false; | |
| 20 | |
| 21 return InstanceIDDriver::IsInstanceIDEnabled(); | |
| 22 } | |
| 23 | |
| 24 InstanceIDProfileService::InstanceIDProfileService(Profile* profile) { | |
| 25 DCHECK(!profile->IsOffTheRecord()); | |
| 26 | |
| 27 driver_.reset(new InstanceIDDriver( | |
| 28 gcm::GCMProfileServiceFactory::GetForProfile(profile)->driver())); | |
| 29 } | |
| 30 | |
| 31 InstanceIDProfileService::~InstanceIDProfileService() { | |
| 32 } | |
| 33 | |
| 34 } // namespace instance_id | |
| OLD | NEW |