| 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 "chrome/browser/chromeos/policy/network_configuration_updater.h" | 8 #include "chrome/browser/chromeos/policy/network_configuration_updater.h" |
| 9 #include "chrome/browser/policy/policy_service.h" | 9 #include "chrome/browser/policy/policy_service.h" |
| 10 #include "chromeos/network/onc/onc_constants.h" | 10 #include "chromeos/network/onc/onc_constants.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 class PolicyMap; | 23 class PolicyMap; |
| 24 | 24 |
| 25 // This implementation pushes policies to the | 25 // This implementation pushes policies to the |
| 26 // ManagedNetworkConfigurationHandler. User policies are only pushed after | 26 // ManagedNetworkConfigurationHandler. User policies are only pushed after |
| 27 // OnUserPolicyInitialized() was called. | 27 // OnUserPolicyInitialized() was called. |
| 28 class NetworkConfigurationUpdaterImpl : public NetworkConfigurationUpdater { | 28 class NetworkConfigurationUpdaterImpl : public NetworkConfigurationUpdater { |
| 29 public: | 29 public: |
| 30 NetworkConfigurationUpdaterImpl( | 30 NetworkConfigurationUpdaterImpl( |
| 31 PolicyService* policy_service, | 31 PolicyService* policy_service, |
| 32 chromeos::ManagedNetworkConfigurationHandler* network_config_handler, | |
| 33 scoped_ptr<chromeos::CertificateHandler> certificate_handler); | 32 scoped_ptr<chromeos::CertificateHandler> certificate_handler); |
| 34 virtual ~NetworkConfigurationUpdaterImpl(); | 33 virtual ~NetworkConfigurationUpdaterImpl(); |
| 35 | 34 |
| 36 // NetworkConfigurationUpdater overrides. | 35 // NetworkConfigurationUpdater overrides. |
| 37 virtual void OnUserPolicyInitialized( | 36 virtual void OnUserPolicyInitialized( |
| 38 bool allow_trusted_certs_from_policy, | 37 bool allow_trusted_certs_from_policy, |
| 39 const std::string& hashed_username) OVERRIDE; | 38 const std::string& hashed_username) OVERRIDE; |
| 40 | 39 |
| 41 private: | 40 private: |
| 42 // Callback that's called by |policy_service_| if the respective ONC policy | 41 // Callback that's called by |policy_service_| if the respective ONC policy |
| 43 // changed. | 42 // changed. |
| 44 void OnPolicyChanged(chromeos::onc::ONCSource onc_source, | 43 void OnPolicyChanged(chromeos::onc::ONCSource onc_source, |
| 45 const base::Value* previous, | 44 const base::Value* previous, |
| 46 const base::Value* current); | 45 const base::Value* current); |
| 47 | 46 |
| 48 void ApplyNetworkConfiguration(chromeos::onc::ONCSource onc_source); | 47 void ApplyNetworkConfiguration(chromeos::onc::ONCSource onc_source); |
| 49 | 48 |
| 50 // Wraps the policy service we read network configuration from. | 49 // Wraps the policy service we read network configuration from. |
| 51 PolicyChangeRegistrar policy_change_registrar_; | 50 PolicyChangeRegistrar policy_change_registrar_; |
| 52 | 51 |
| 53 // The policy service storing the ONC policies. | 52 // The policy service storing the ONC policies. |
| 54 PolicyService* policy_service_; | 53 PolicyService* policy_service_; |
| 55 | 54 |
| 56 // Pointer to the global singleton or mock provided to the constructor. | |
| 57 chromeos::ManagedNetworkConfigurationHandler* network_config_handler_; | |
| 58 | |
| 59 // User hash of the user that the user policy applies to. | 55 // User hash of the user that the user policy applies to. |
| 60 std::string hashed_username_; | 56 std::string hashed_username_; |
| 61 | 57 |
| 62 scoped_ptr<chromeos::CertificateHandler> certificate_handler_; | 58 scoped_ptr<chromeos::CertificateHandler> certificate_handler_; |
| 63 | 59 |
| 64 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdaterImpl); | 60 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdaterImpl); |
| 65 }; | 61 }; |
| 66 | 62 |
| 67 } // namespace policy | 63 } // namespace policy |
| 68 | 64 |
| 69 #endif // CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_H_ | 65 #endif // CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_H_ |
| OLD | NEW |