OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 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/policy/profile_policy_connector_factory.h" | |
6 | |
7 #include "chrome/browser/policy/profile_policy_connector.h" | |
8 #include "chrome/browser/profiles/profile.h" | |
9 #include "chrome/browser/profiles/profile_dependency_manager.h" | |
10 | |
11 namespace policy { | |
12 | |
13 // static | |
14 ProfilePolicyConnector* ProfilePolicyConnectorFactory::GetForProfile( | |
15 Profile* profile) { | |
16 return static_cast<ProfilePolicyConnector*>( | |
17 GetInstance()->GetServiceForProfile(profile, true)); | |
18 } | |
19 | |
20 // static | |
21 ProfilePolicyConnectorFactory* ProfilePolicyConnectorFactory::GetInstance() { | |
22 return Singleton<ProfilePolicyConnectorFactory>::get(); | |
23 } | |
24 | |
25 ProfilePolicyConnectorFactory::ProfilePolicyConnectorFactory() | |
26 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) { | |
27 // TODO(jknotten): | |
28 // DependsOn(URLRequestContextGetterFactory::GetInstance()); | |
29 // DependsOn(PrefServiceFactory::GetInstance()); | |
30 // See comment in profile_policy_connector.h w.r.t. Shutdown() | |
31 } | |
32 | |
33 ProfilePolicyConnectorFactory::~ProfilePolicyConnectorFactory() { | |
34 } | |
35 | |
36 ProfileKeyedService* ProfilePolicyConnectorFactory::BuildServiceInstanceFor( | |
37 Profile* profile) const { | |
38 return new ProfilePolicyConnector(profile); | |
39 } | |
40 | |
41 } // namespace policy | |
OLD | NEW |