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_POLICY_CERT_SERVICE_FACTORY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_POLICY_CERT_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 PolicyCertService; |
| 20 class PolicyCertVerifier; |
| 21 |
| 22 // Factory to create PolicyCertServices. |
| 23 class PolicyCertServiceFactory : public BrowserContextKeyedServiceFactory { |
| 24 public: |
| 25 // Returns an existing PolicyCertService for |profile|. See |
| 26 // CreateForProfile. |
| 27 static PolicyCertService* GetForProfile(Profile* profile); |
| 28 |
| 29 // Creates a new PolicyCertService and returns the associated |
| 30 // PolicyCertVerifier. Returns NULL if this service isn't allowed for |
| 31 // |profile|, i.e. if NetworkConfigurationUpdater doesn't exist. |
| 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 PolicyCertServiceFactory* GetInstance(); |
| 39 |
| 40 private: |
| 41 friend struct DefaultSingletonTraits<PolicyCertServiceFactory>; |
| 42 |
| 43 PolicyCertServiceFactory(); |
| 44 virtual ~PolicyCertServiceFactory(); |
| 45 |
| 46 // BrowserContextKeyedServiceFactory: |
| 47 virtual BrowserContextKeyedService* BuildServiceInstanceFor( |
| 48 content::BrowserContext* context) const OVERRIDE; |
| 49 virtual content::BrowserContext* GetBrowserContextToUse( |
| 50 content::BrowserContext* context) const OVERRIDE; |
| 51 virtual void RegisterProfilePrefs( |
| 52 user_prefs::PrefRegistrySyncable* registry) OVERRIDE; |
| 53 virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; |
| 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(PolicyCertServiceFactory); |
| 56 }; |
| 57 |
| 58 } // namespace policy |
| 59 |
| 60 #endif // CHROME_BROWSER_CHROMEOS_POLICY_POLICY_CERT_SERVICE_FACTORY_H_ |
OLD | NEW |