Chromium Code Reviews| 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_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | |
| 9 | |
| 10 #include "chrome/browser/chromeos/policy/network_configuration_updater.h" | 8 #include "chrome/browser/chromeos/policy/network_configuration_updater.h" |
| 11 #include "chrome/browser/policy/policy_service.h" | 9 #include "chrome/browser/policy/policy_service.h" |
| 12 #include "chromeos/network/onc/onc_constants.h" | 10 #include "chromeos/network/onc/onc_constants.h" |
| 13 | 11 |
| 14 namespace base { | 12 namespace base { |
| 15 class Value; | 13 class Value; |
| 16 } | 14 } |
| 17 | 15 |
| 16 namespace chromeos { | |
| 17 class CertificateHandler; | |
| 18 class ManagedNetworkConfigurationHandler; | |
| 19 } | |
| 20 | |
| 18 namespace policy { | 21 namespace policy { |
| 19 | 22 |
| 20 class PolicyMap; | 23 class PolicyMap; |
| 21 | 24 |
| 22 // This implementation pushes policies to the | 25 // This implementation pushes policies to the |
| 23 // ManagedNetworkConfigurationHandler. User policies are only pushed after | 26 // ManagedNetworkConfigurationHandler. User policies are only pushed after |
| 24 // OnUserPolicyInitialized() was called. | 27 // OnUserPolicyInitialized() was called. |
| 25 // TODO(pneubeck): Certificates are not implemented yet, they are silently | 28 // TODO(pneubeck): Certificates are not implemented yet, they are silently |
| 26 // ignored. | 29 // ignored. |
| 27 class NetworkConfigurationUpdaterImpl : public NetworkConfigurationUpdater { | 30 class NetworkConfigurationUpdaterImpl : public NetworkConfigurationUpdater { |
| 28 public: | 31 public: |
| 29 explicit NetworkConfigurationUpdaterImpl(PolicyService* policy_service); | 32 explicit NetworkConfigurationUpdaterImpl( |
|
Joao da Silva
2013/04/22 10:38:09
No need to be explicit.
pneubeck (no reviews)
2013/04/23 18:05:25
Done.
| |
| 33 PolicyService* policy_service, | |
| 34 chromeos::ManagedNetworkConfigurationHandler* network_config_handler, | |
| 35 chromeos::CertificateHandler* certificate_handler); | |
| 30 virtual ~NetworkConfigurationUpdaterImpl(); | 36 virtual ~NetworkConfigurationUpdaterImpl(); |
| 31 | 37 |
| 32 // NetworkConfigurationUpdater overrides. | 38 // NetworkConfigurationUpdater overrides. |
| 33 | |
| 34 virtual void OnUserPolicyInitialized() OVERRIDE; | 39 virtual void OnUserPolicyInitialized() OVERRIDE; |
| 35 virtual void set_allow_trusted_certificates_from_policy(bool allow) OVERRIDE { | |
| 36 } | |
| 37 virtual net::CertTrustAnchorProvider* GetCertTrustAnchorProvider() OVERRIDE; | |
| 38 | 40 |
| 39 private: | 41 private: |
| 40 // Callback that's called by |policy_service_| if the respective ONC policy | 42 // Callback that's called by |policy_service_| if the respective ONC policy |
| 41 // changed. | 43 // changed. |
| 42 void OnPolicyChanged(chromeos::onc::ONCSource onc_source, | 44 void OnPolicyChanged(chromeos::onc::ONCSource onc_source, |
| 43 const base::Value* previous, | 45 const base::Value* previous, |
| 44 const base::Value* current); | 46 const base::Value* current); |
| 45 | 47 |
| 46 void ApplyNetworkConfiguration(chromeos::onc::ONCSource onc_source); | 48 void ApplyNetworkConfiguration(chromeos::onc::ONCSource onc_source); |
| 47 | 49 |
| 48 // Whether the user policy is already available. | 50 // Whether the user policy is already available. |
| 49 bool user_policy_initialized_; | 51 bool user_policy_initialized_; |
| 50 | 52 |
| 51 // Wraps the policy service we read network configuration from. | 53 // Wraps the policy service we read network configuration from. |
| 52 PolicyChangeRegistrar policy_change_registrar_; | 54 PolicyChangeRegistrar policy_change_registrar_; |
| 53 | 55 |
| 54 // The policy service storing the ONC policies. | 56 // The policy service storing the ONC policies. |
| 55 PolicyService* policy_service_; | 57 PolicyService* policy_service_; |
| 56 | 58 |
| 59 chromeos::ManagedNetworkConfigurationHandler* network_config_handler_; | |
| 60 chromeos::CertificateHandler* certificate_handler_; | |
|
stevenjb
2013/04/22 16:53:41
Add a comment to the effect that these are pointer
pneubeck (no reviews)
2013/04/23 18:05:25
Done.
| |
| 61 | |
| 57 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdaterImpl); | 62 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdaterImpl); |
| 58 }; | 63 }; |
| 59 | 64 |
| 60 } // namespace policy | 65 } // namespace policy |
| 61 | 66 |
| 62 #endif // CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_H_ | 67 #endif // CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_H_ |
| OLD | NEW |