| 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 #include "chromeos/network/onc/onc_normalizer.h" | 5 #include "chromeos/network/onc/onc_normalizer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 RemoveEntryUnless(ipsec, kXAUTH, ike_version == 1); | 150 RemoveEntryUnless(ipsec, kXAUTH, ike_version == 1); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void Normalizer::NormalizeNetworkConfiguration(base::DictionaryValue* network) { | 153 void Normalizer::NormalizeNetworkConfiguration(base::DictionaryValue* network) { |
| 154 bool remove = false; | 154 bool remove = false; |
| 155 network->GetBooleanWithoutPathExpansion(::onc::kRemove, &remove); | 155 network->GetBooleanWithoutPathExpansion(::onc::kRemove, &remove); |
| 156 if (remove) { | 156 if (remove) { |
| 157 network->RemoveWithoutPathExpansion(::onc::network_config::kStaticIPConfig, | 157 network->RemoveWithoutPathExpansion(::onc::network_config::kStaticIPConfig, |
| 158 NULL); | 158 NULL); |
| 159 network->RemoveWithoutPathExpansion(::onc::network_config::kName, NULL); | 159 network->RemoveWithoutPathExpansion(::onc::network_config::kName, NULL); |
| 160 network->RemoveWithoutPathExpansion(::onc::network_config::kNameServers, | |
| 161 NULL); | |
| 162 network->RemoveWithoutPathExpansion(::onc::network_config::kProxySettings, | 160 network->RemoveWithoutPathExpansion(::onc::network_config::kProxySettings, |
| 163 NULL); | 161 NULL); |
| 164 network->RemoveWithoutPathExpansion(::onc::network_config::kSearchDomains, | |
| 165 NULL); | |
| 166 network->RemoveWithoutPathExpansion(::onc::network_config::kType, NULL); | 162 network->RemoveWithoutPathExpansion(::onc::network_config::kType, NULL); |
| 167 // Fields dependent on kType are removed afterwards, too. | 163 // Fields dependent on kType are removed afterwards, too. |
| 168 } | 164 } |
| 169 | 165 |
| 170 std::string type; | 166 std::string type; |
| 171 network->GetStringWithoutPathExpansion(::onc::network_config::kType, &type); | 167 network->GetStringWithoutPathExpansion(::onc::network_config::kType, &type); |
| 172 RemoveEntryUnless(network, | 168 RemoveEntryUnless(network, |
| 173 ::onc::network_config::kEthernet, | 169 ::onc::network_config::kEthernet, |
| 174 type == ::onc::network_type::kEthernet); | 170 type == ::onc::network_type::kEthernet); |
| 175 RemoveEntryUnless( | 171 RemoveEntryUnless( |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 std::string security; | 227 std::string security; |
| 232 wifi->GetStringWithoutPathExpansion(::onc::wifi::kSecurity, &security); | 228 wifi->GetStringWithoutPathExpansion(::onc::wifi::kSecurity, &security); |
| 233 RemoveEntryUnless(wifi, kEAP, security == kWEP_8021X || security == kWPA_EAP); | 229 RemoveEntryUnless(wifi, kEAP, security == kWEP_8021X || security == kWPA_EAP); |
| 234 RemoveEntryUnless(wifi, kPassphrase, | 230 RemoveEntryUnless(wifi, kPassphrase, |
| 235 security == kWEP_PSK || security == kWPA_PSK); | 231 security == kWEP_PSK || security == kWPA_PSK); |
| 236 FillInHexSSIDField(wifi); | 232 FillInHexSSIDField(wifi); |
| 237 } | 233 } |
| 238 | 234 |
| 239 } // namespace onc | 235 } // namespace onc |
| 240 } // namespace chromeos | 236 } // namespace chromeos |
| OLD | NEW |