| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_NETWORK_CONFIGURATION_UPDATER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_NETWORK_CONFIGURATION_UPDATER_H_ |
| 6 #define CHROME_BROWSER_POLICY_NETWORK_CONFIGURATION_UPDATER_H_ | 6 #define CHROME_BROWSER_POLICY_NETWORK_CONFIGURATION_UPDATER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 class NetworkConfigurationUpdater | 24 class NetworkConfigurationUpdater |
| 25 : public ConfigurationPolicyProvider::Observer { | 25 : public ConfigurationPolicyProvider::Observer { |
| 26 public: | 26 public: |
| 27 NetworkConfigurationUpdater(ConfigurationPolicyProvider* provider, | 27 NetworkConfigurationUpdater(ConfigurationPolicyProvider* provider, |
| 28 chromeos::NetworkLibrary* network_library); | 28 chromeos::NetworkLibrary* network_library); |
| 29 virtual ~NetworkConfigurationUpdater(); | 29 virtual ~NetworkConfigurationUpdater(); |
| 30 | 30 |
| 31 // ConfigurationPolicyProvider::Observer: | 31 // ConfigurationPolicyProvider::Observer: |
| 32 virtual void OnUpdatePolicy(ConfigurationPolicyProvider* provider) OVERRIDE; | 32 virtual void OnUpdatePolicy(ConfigurationPolicyProvider* provider) OVERRIDE; |
| 33 | 33 |
| 34 // Empty network configuration blob. |
| 35 static const char kEmptyConfiguration[]; |
| 36 |
| 34 private: | 37 private: |
| 35 // Grabs network configuration from policy and applies it. | 38 // Grabs network configuration from policy and applies it. |
| 36 void Update(); | 39 void Update(); |
| 37 | 40 |
| 38 // Extracts ONC string from |policy_map| and pushes the configuration to | 41 // Extracts ONC string from |policy_map| and pushes the configuration to |
| 39 // |network_library_| if it's different from |*cached_value| (which is | 42 // |network_library_| if it's different from |*cached_value| (which is |
| 40 // updated). | 43 // updated). |
| 41 void ApplyNetworkConfiguration(const PolicyMap& policy_map, | 44 void ApplyNetworkConfiguration(const PolicyMap& policy_map, |
| 42 ConfigurationPolicyType policy_type, | 45 ConfigurationPolicyType policy_type, |
| 43 chromeos::NetworkUIData::ONCSource onc_source, | 46 chromeos::NetworkUIData::ONCSource onc_source, |
| 44 std::string* cached_value); | 47 std::string* cached_value); |
| 45 | 48 |
| 46 // Wraps the provider we read network configuration from. | 49 // Wraps the provider we read network configuration from. |
| 47 ConfigurationPolicyObserverRegistrar provider_registrar_; | 50 ConfigurationPolicyObserverRegistrar provider_registrar_; |
| 48 | 51 |
| 49 // Network library to write network configuration to. | 52 // Network library to write network configuration to. |
| 50 chromeos::NetworkLibrary* network_library_; | 53 chromeos::NetworkLibrary* network_library_; |
| 51 | 54 |
| 52 // Current settings. | 55 // Current settings. |
| 53 std::string device_network_config_; | 56 std::string device_network_config_; |
| 54 std::string user_network_config_; | 57 std::string user_network_config_; |
| 55 | 58 |
| 56 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdater); | 59 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdater); |
| 57 }; | 60 }; |
| 58 | 61 |
| 59 } // namespace policy | 62 } // namespace policy |
| 60 | 63 |
| 61 #endif // CHROME_BROWSER_POLICY_NETWORK_CONFIGURATION_UPDATER_H_ | 64 #endif // CHROME_BROWSER_POLICY_NETWORK_CONFIGURATION_UPDATER_H_ |
| OLD | NEW |