OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_POLICY_USER_POLICY_SIGNIN_SERVICE_FACTORY_H_ | |
6 #define CHROME_BROWSER_POLICY_USER_POLICY_SIGNIN_SERVICE_FACTORY_H_ | |
7 | |
8 #include "base/memory/singleton.h" | |
9 #include "chrome/browser/profiles/profile_keyed_service_factory.h" | |
10 | |
11 namespace policy { | |
12 | |
13 class UserPolicySigninService; | |
14 | |
15 // Singleton that owns all UserPolicySigninServices and creates/deletes them as | |
16 // new Profiles are created/shutdown. | |
17 class UserPolicySigninServiceFactory : public ProfileKeyedServiceFactory { | |
18 public: | |
19 // Returns an instance of the UserPolicySigninServiceFactory singleton. | |
20 static UserPolicySigninServiceFactory* GetInstance(); | |
21 | |
22 // Returns the instance of UserPolicySigninService for the passed |profile|. | |
23 // Used primarily for testing. | |
24 static UserPolicySigninService* GetForProfile(Profile* profile); | |
25 | |
26 protected: | |
27 // ProfileKeyedServiceFactory implementation. | |
28 virtual ProfileKeyedService* BuildServiceInstanceFor( | |
29 Profile* profile) const OVERRIDE; | |
30 | |
31 // Overridden to cause this object to be created when the profile is created. | |
32 virtual bool ServiceIsCreatedWithProfile() OVERRIDE; | |
33 | |
34 // Register the preferences related to cloud-based user policy. | |
35 virtual void RegisterUserPrefs(PrefService* user_prefs) OVERRIDE; | |
36 | |
37 private: | |
38 friend struct DefaultSingletonTraits<UserPolicySigninServiceFactory>; | |
39 | |
40 UserPolicySigninServiceFactory(); | |
41 virtual ~UserPolicySigninServiceFactory(); | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(UserPolicySigninServiceFactory); | |
44 }; | |
45 | |
46 } // namespace policy | |
47 | |
48 #endif // CHROME_BROWSER_POLICY_USER_POLICY_SIGNIN_SERVICE_FACTORY_H_ | |
OLD | NEW |