| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ | 5 #ifndef CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ |
| 6 #define CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ | 6 #define CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace net { | 32 namespace net { |
| 33 class X509Certificate; | 33 class X509Certificate; |
| 34 typedef std::vector<scoped_refptr<X509Certificate> > CertificateList; | 34 typedef std::vector<scoped_refptr<X509Certificate> > CertificateList; |
| 35 } | 35 } |
| 36 | 36 |
| 37 namespace policy { | 37 namespace policy { |
| 38 | 38 |
| 39 class ConfigurationPolicyProvider; | 39 class ConfigurationPolicyProvider; |
| 40 class ManagedModePolicyProvider; | |
| 41 class UserNetworkConfigurationUpdater; | 40 class UserNetworkConfigurationUpdater; |
| 42 class PolicyService; | 41 class PolicyService; |
| 43 class PolicyCertVerifier; | 42 class PolicyCertVerifier; |
| 44 | 43 |
| 45 // A BrowserContextKeyedService that creates and manages the per-Profile policy | 44 // A BrowserContextKeyedService that creates and manages the per-Profile policy |
| 46 // components. | 45 // components. |
| 47 class ProfilePolicyConnector : public BrowserContextKeyedService { | 46 class ProfilePolicyConnector : public BrowserContextKeyedService { |
| 48 public: | 47 public: |
| 49 explicit ProfilePolicyConnector(Profile* profile); | 48 explicit ProfilePolicyConnector(Profile* profile); |
| 50 virtual ~ProfilePolicyConnector(); | 49 virtual ~ProfilePolicyConnector(); |
| 51 | 50 |
| 52 // If |force_immediate_load| then disk caches will be loaded synchronously. | 51 // If |force_immediate_load| then disk caches will be loaded synchronously. |
| 53 void Init(bool force_immediate_load, | 52 void Init(bool force_immediate_load, |
| 54 base::SequencedTaskRunner* sequenced_task_runner); | 53 base::SequencedTaskRunner* sequenced_task_runner); |
| 55 | 54 |
| 56 void InitForTesting(scoped_ptr<PolicyService> service); | 55 void InitForTesting(scoped_ptr<PolicyService> service); |
| 57 | 56 |
| 58 // BrowserContextKeyedService: | 57 // BrowserContextKeyedService: |
| 59 virtual void Shutdown() OVERRIDE; | 58 virtual void Shutdown() OVERRIDE; |
| 60 | 59 |
| 61 // This is never NULL. | 60 // This is never NULL. |
| 62 PolicyService* policy_service() const { return policy_service_.get(); } | 61 PolicyService* policy_service() const { return policy_service_.get(); } |
| 63 | 62 |
| 64 #if defined(ENABLE_MANAGED_USERS) && defined(ENABLE_CONFIGURATION_POLICY) | |
| 65 ManagedModePolicyProvider* managed_mode_policy_provider() const { | |
| 66 return managed_mode_policy_provider_.get(); | |
| 67 } | |
| 68 #endif | |
| 69 | |
| 70 #if defined(OS_CHROMEOS) | 63 #if defined(OS_CHROMEOS) |
| 71 // Sets the CertVerifier on which the current list of Web trusted server and | 64 // Sets the CertVerifier on which the current list of Web trusted server and |
| 72 // CA certificates will be set. Policy updates will trigger further calls to | 65 // CA certificates will be set. Policy updates will trigger further calls to |
| 73 // |cert_verifier| later. |cert_verifier| must be valid until | 66 // |cert_verifier| later. |cert_verifier| must be valid until |
| 74 // SetPolicyCertVerifier is called again (with another CertVerifier or NULL) | 67 // SetPolicyCertVerifier is called again (with another CertVerifier or NULL) |
| 75 // or until this Connector is destructed. |cert_verifier|'s methods are only | 68 // or until this Connector is destructed. |cert_verifier|'s methods are only |
| 76 // called on the IO thread. This function must be called on the UI thread. | 69 // called on the IO thread. This function must be called on the UI thread. |
| 77 void SetPolicyCertVerifier(PolicyCertVerifier* cert_verifier); | 70 void SetPolicyCertVerifier(PolicyCertVerifier* cert_verifier); |
| 78 | 71 |
| 79 // Returns a callback that should be called if a policy installed certificate | 72 // Returns a callback that should be called if a policy installed certificate |
| (...skipping 28 matching lines...) Expand all Loading... |
| 108 bool is_primary_user_; | 101 bool is_primary_user_; |
| 109 | 102 |
| 110 scoped_ptr<ConfigurationPolicyProvider> special_user_policy_provider_; | 103 scoped_ptr<ConfigurationPolicyProvider> special_user_policy_provider_; |
| 111 scoped_ptr<UserNetworkConfigurationUpdater> network_configuration_updater_; | 104 scoped_ptr<UserNetworkConfigurationUpdater> network_configuration_updater_; |
| 112 | 105 |
| 113 base::WeakPtrFactory<ProfilePolicyConnector> weak_ptr_factory_; | 106 base::WeakPtrFactory<ProfilePolicyConnector> weak_ptr_factory_; |
| 114 #endif | 107 #endif |
| 115 | 108 |
| 116 Profile* profile_; | 109 Profile* profile_; |
| 117 | 110 |
| 118 #if defined(ENABLE_MANAGED_USERS) && defined(ENABLE_CONFIGURATION_POLICY) | |
| 119 scoped_ptr<ManagedModePolicyProvider> managed_mode_policy_provider_; | |
| 120 #endif | |
| 121 | |
| 122 #endif // ENABLE_CONFIGURATION_POLICY | 111 #endif // ENABLE_CONFIGURATION_POLICY |
| 123 | 112 |
| 124 scoped_ptr<PolicyService> policy_service_; | 113 scoped_ptr<PolicyService> policy_service_; |
| 125 | 114 |
| 126 DISALLOW_COPY_AND_ASSIGN(ProfilePolicyConnector); | 115 DISALLOW_COPY_AND_ASSIGN(ProfilePolicyConnector); |
| 127 }; | 116 }; |
| 128 | 117 |
| 129 } // namespace policy | 118 } // namespace policy |
| 130 | 119 |
| 131 #endif // CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ | 120 #endif // CHROME_BROWSER_POLICY_PROFILE_POLICY_CONNECTOR_H_ |
| OLD | NEW |