Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 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_CHROMEOS_POLICY_NETWORK_POLICY_SERVICE_FACTORY_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_POLICY_SERVICE_FACTORY_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "components/browser_context_keyed_service/browser_context_keyed_service _factory.h" | |
| 12 | |
| 13 template <typename T> struct DefaultSingletonTraits; | |
| 14 | |
| 15 class Profile; | |
| 16 | |
| 17 namespace policy { | |
| 18 | |
| 19 class NetworkPolicyService; | |
| 20 class PolicyCertVerifier; | |
| 21 | |
| 22 // Factory to create NetworkPolicyServices. | |
| 23 class NetworkPolicyServiceFactory : public BrowserContextKeyedServiceFactory { | |
| 24 public: | |
| 25 // Returns an existing NetworkPolicyService for |profile|. See | |
| 26 // CreateForProfile. | |
| 27 static NetworkPolicyService* GetForProfile(Profile* profile); | |
| 28 | |
| 29 // Creates a new NetworkPolicyService and returns the associated | |
| 30 // PolicyCertVerifier. Returns NULL if this service isn't allowed for | |
| 31 // |profile|, i.e. if NetworkConfigurationUpdater doesn't exists. | |
|
Joao da Silva
2013/11/11 12:38:19
*exist
pneubeck (no reviews)
2013/11/12 10:07:53
Done.
| |
| 32 // This service is created separately for the original profile and the | |
| 33 // incognito profile. | |
| 34 // Note: NetworkConfigurationUpdater is currently only created for the primary | |
| 35 // user's profile. | |
| 36 static scoped_ptr<PolicyCertVerifier> CreateForProfile(Profile* profile); | |
| 37 | |
| 38 static NetworkPolicyServiceFactory* GetInstance(); | |
| 39 | |
| 40 private: | |
| 41 friend struct DefaultSingletonTraits<NetworkPolicyServiceFactory>; | |
| 42 | |
| 43 NetworkPolicyServiceFactory(); | |
| 44 virtual ~NetworkPolicyServiceFactory(); | |
| 45 | |
| 46 // BrowserContextKeyedServiceFactory: | |
| 47 virtual BrowserContextKeyedService* BuildServiceInstanceFor( | |
| 48 content::BrowserContext* context) const OVERRIDE; | |
| 49 virtual void RegisterProfilePrefs( | |
| 50 user_prefs::PrefRegistrySyncable* registry) OVERRIDE; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(NetworkPolicyServiceFactory); | |
| 53 }; | |
| 54 | |
| 55 } // namespace policy | |
| 56 | |
| 57 #endif // CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_POLICY_SERVICE_FACTORY_H_ | |
| OLD | NEW |