| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/browser/chromeos/cros/network_ui_data.h" | 10 #include "chrome/browser/chromeos/cros/network_ui_data.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class PolicyMap; | 23 class PolicyMap; |
| 24 | 24 |
| 25 // Keeps track of the network configuration policy settings and updates the | 25 // Keeps track of the network configuration policy settings and updates the |
| 26 // network definitions whenever the configuration changes. | 26 // network definitions whenever the configuration changes. |
| 27 class NetworkConfigurationUpdater { | 27 class NetworkConfigurationUpdater { |
| 28 public: | 28 public: |
| 29 NetworkConfigurationUpdater(PolicyService* policy_service, | 29 NetworkConfigurationUpdater(PolicyService* policy_service, |
| 30 chromeos::NetworkLibrary* network_library); | 30 chromeos::NetworkLibrary* network_library); |
| 31 virtual ~NetworkConfigurationUpdater(); | 31 virtual ~NetworkConfigurationUpdater(); |
| 32 | 32 |
| 33 // Web trust isn't given to certificates imported from ONC by default. |
| 34 // Setting |allow_web_trust| to true allows giving Web trust to the |
| 35 // certificates that request it. |
| 36 void set_allow_web_trust(bool allow) { allow_web_trust_ = allow; } |
| 37 |
| 33 // Empty network configuration blob. | 38 // Empty network configuration blob. |
| 34 static const char kEmptyConfiguration[]; | 39 static const char kEmptyConfiguration[]; |
| 35 | 40 |
| 36 private: | 41 private: |
| 37 // Extracts ONC string from |policy_map| and pushes the configuration to | 42 // Extracts ONC string from |policy_map| and pushes the configuration to |
| 38 // |network_library_| if it's different from |*cached_value| (which is | 43 // |network_library_| if it's different from |*cached_value| (which is |
| 39 // updated). | 44 // updated). |
| 40 void ApplyNetworkConfiguration(chromeos::NetworkUIData::ONCSource onc_source, | 45 void ApplyNetworkConfiguration(chromeos::NetworkUIData::ONCSource onc_source, |
| 41 std::string* cached_value, | 46 std::string* cached_value, |
| 42 const base::Value* previous, | 47 const base::Value* previous, |
| 43 const base::Value* current); | 48 const base::Value* current); |
| 44 | 49 |
| 45 // Wraps the policy service we read network configuration from. | 50 // Wraps the policy service we read network configuration from. |
| 46 PolicyChangeRegistrar policy_change_registrar_; | 51 PolicyChangeRegistrar policy_change_registrar_; |
| 47 | 52 |
| 48 // Network library to write network configuration to. | 53 // Network library to write network configuration to. |
| 49 chromeos::NetworkLibrary* network_library_; | 54 chromeos::NetworkLibrary* network_library_; |
| 50 | 55 |
| 56 // Whether Web trust is allowed or not. |
| 57 bool allow_web_trust_; |
| 58 |
| 51 // Current settings. | 59 // Current settings. |
| 52 std::string device_network_config_; | 60 std::string device_network_config_; |
| 53 std::string user_network_config_; | 61 std::string user_network_config_; |
| 54 | 62 |
| 55 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdater); | 63 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdater); |
| 56 }; | 64 }; |
| 57 | 65 |
| 58 } // namespace policy | 66 } // namespace policy |
| 59 | 67 |
| 60 #endif // CHROME_BROWSER_POLICY_NETWORK_CONFIGURATION_UPDATER_H_ | 68 #endif // CHROME_BROWSER_POLICY_NETWORK_CONFIGURATION_UPDATER_H_ |
| OLD | NEW |