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 #ifndef CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_FACTORY_H_ | |
5 #define CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_FACTORY_H_ | |
6 | |
7 #include "base/compiler_specific.h" | |
8 #include "base/memory/singleton.h" | |
9 #include "chrome/browser/profiles/profile_keyed_service_factory.h" | |
10 | |
11 class Profile; | |
12 | |
13 namespace policy { | |
14 | |
15 class ProfilePolicyConnector; | |
16 | |
17 // Singleton that owns all ProfilePolicyConnectors and associates them with | |
18 // Profiles. Listens for the Profile's destruction notification and cleans up | |
19 // the associated ProfilePolicyConnector. | |
20 | |
21 class ProfilePolicyConnectorFactory : public ProfileKeyedServiceFactory { | |
22 public: | |
23 // Returns the ProfilePolicyConnector that contains profile-specific | |
24 // policy bits for |profile|. | |
25 static ProfilePolicyConnector* GetForProfile(Profile* profile); | |
26 | |
27 static ProfilePolicyConnectorFactory* GetInstance(); | |
28 | |
29 private: | |
30 friend struct DefaultSingletonTraits<ProfilePolicyConnectorFactory>; | |
31 | |
32 ProfilePolicyConnectorFactory(); | |
33 virtual ~ProfilePolicyConnectorFactory(); | |
34 | |
35 // ProfileKeyedServiceFactory: | |
36 virtual ProfileKeyedService* BuildServiceInstanceFor( | |
37 Profile* profile) const OVERRIDE; | |
38 | |
39 DISALLOW_COPY_AND_ASSIGN(ProfilePolicyConnectorFactory); | |
40 }; | |
41 | |
42 } // namespace policy | |
43 | |
44 #endif // CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_FACTORY_H_ | |
OLD | NEW |