| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/policy/cloud/user_policy_signin_service_factory.h" | 5 #include "chrome/browser/policy/cloud/user_policy_signin_service_factory.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 8 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 10 #include "chrome/browser/signin/signin_manager_factory.h" | 11 #include "chrome/browser/signin/signin_manager_factory.h" |
| 11 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
| 12 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 13 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
| 13 #include "components/user_prefs/pref_registry_syncable.h" | 14 #include "components/user_prefs/pref_registry_syncable.h" |
| 14 | 15 |
| 15 #if defined(OS_ANDROID) | 16 #if defined(OS_ANDROID) |
| 16 #include "chrome/browser/policy/cloud/user_policy_signin_service_android.h" | 17 #include "chrome/browser/policy/cloud/user_policy_signin_service_android.h" |
| 17 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | |
| 18 #else | 18 #else |
| 19 #include "chrome/browser/policy/cloud/user_policy_signin_service.h" | 19 #include "chrome/browser/policy/cloud/user_policy_signin_service.h" |
| 20 #include "chrome/browser/signin/token_service_factory.h" | |
| 21 #endif | 20 #endif |
| 22 | 21 |
| 23 namespace policy { | 22 namespace policy { |
| 24 | 23 |
| 25 UserPolicySigninServiceFactory::UserPolicySigninServiceFactory() | 24 UserPolicySigninServiceFactory::UserPolicySigninServiceFactory() |
| 26 : BrowserContextKeyedServiceFactory( | 25 : BrowserContextKeyedServiceFactory( |
| 27 "UserPolicySigninService", | 26 "UserPolicySigninService", |
| 28 BrowserContextDependencyManager::GetInstance()) { | 27 BrowserContextDependencyManager::GetInstance()) { |
| 29 #if defined(OS_ANDROID) | |
| 30 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); | 28 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); |
| 31 #else | |
| 32 DependsOn(TokenServiceFactory::GetInstance()); | |
| 33 #endif | |
| 34 DependsOn(SigninManagerFactory::GetInstance()); | 29 DependsOn(SigninManagerFactory::GetInstance()); |
| 35 DependsOn(UserCloudPolicyManagerFactory::GetInstance()); | 30 DependsOn(UserCloudPolicyManagerFactory::GetInstance()); |
| 36 } | 31 } |
| 37 | 32 |
| 38 UserPolicySigninServiceFactory::~UserPolicySigninServiceFactory() {} | 33 UserPolicySigninServiceFactory::~UserPolicySigninServiceFactory() {} |
| 39 | 34 |
| 40 // static | 35 // static |
| 41 UserPolicySigninService* UserPolicySigninServiceFactory::GetForProfile( | 36 UserPolicySigninService* UserPolicySigninServiceFactory::GetForProfile( |
| 42 Profile* profile) { | 37 Profile* profile) { |
| 43 return static_cast<UserPolicySigninService*>( | 38 return static_cast<UserPolicySigninService*>( |
| (...skipping 26 matching lines...) Expand all Loading... |
| 70 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 65 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 71 #if defined(OS_ANDROID) | 66 #if defined(OS_ANDROID) |
| 72 user_prefs->RegisterInt64Pref( | 67 user_prefs->RegisterInt64Pref( |
| 73 prefs::kLastPolicyCheckTime, | 68 prefs::kLastPolicyCheckTime, |
| 74 0, | 69 0, |
| 75 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 70 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 76 #endif | 71 #endif |
| 77 } | 72 } |
| 78 | 73 |
| 79 } // namespace policy | 74 } // namespace policy |
| OLD | NEW |