| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 ipsec->GetIntegerWithoutPathExpansion(kIKEVersion, &ike_version); | 146 ipsec->GetIntegerWithoutPathExpansion(kIKEVersion, &ike_version); |
| 147 RemoveEntryUnless(ipsec, kEAP, ike_version == 2); | 147 RemoveEntryUnless(ipsec, kEAP, ike_version == 2); |
| 148 RemoveEntryUnless(ipsec, kGroup, ike_version == 1); | 148 RemoveEntryUnless(ipsec, kGroup, ike_version == 1); |
| 149 RemoveEntryUnless(ipsec, kXAUTH, ike_version == 1); | 149 RemoveEntryUnless(ipsec, kXAUTH, ike_version == 1); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void Normalizer::NormalizeNetworkConfiguration(base::DictionaryValue* network) { | 152 void Normalizer::NormalizeNetworkConfiguration(base::DictionaryValue* network) { |
| 153 bool remove = false; | 153 bool remove = false; |
| 154 network->GetBooleanWithoutPathExpansion(::onc::kRemove, &remove); | 154 network->GetBooleanWithoutPathExpansion(::onc::kRemove, &remove); |
| 155 if (remove) { | 155 if (remove) { |
| 156 network->RemoveWithoutPathExpansion(::onc::network_config::kIPConfigs, | 156 network->RemoveWithoutPathExpansion(::onc::network_config::kStaticIPConfig, |
| 157 NULL); | 157 NULL); |
| 158 network->RemoveWithoutPathExpansion(::onc::network_config::kName, NULL); | 158 network->RemoveWithoutPathExpansion(::onc::network_config::kName, NULL); |
| 159 network->RemoveWithoutPathExpansion(::onc::network_config::kNameServers, | 159 network->RemoveWithoutPathExpansion(::onc::network_config::kNameServers, |
| 160 NULL); | 160 NULL); |
| 161 network->RemoveWithoutPathExpansion(::onc::network_config::kProxySettings, | 161 network->RemoveWithoutPathExpansion(::onc::network_config::kProxySettings, |
| 162 NULL); | 162 NULL); |
| 163 network->RemoveWithoutPathExpansion(::onc::network_config::kSearchDomains, | 163 network->RemoveWithoutPathExpansion(::onc::network_config::kSearchDomains, |
| 164 NULL); | 164 NULL); |
| 165 network->RemoveWithoutPathExpansion(::onc::network_config::kType, NULL); | 165 network->RemoveWithoutPathExpansion(::onc::network_config::kType, NULL); |
| 166 // Fields dependent on kType are removed afterwards, too. | 166 // Fields dependent on kType are removed afterwards, too. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 std::string security; | 218 std::string security; |
| 219 wifi->GetStringWithoutPathExpansion(::onc::wifi::kSecurity, &security); | 219 wifi->GetStringWithoutPathExpansion(::onc::wifi::kSecurity, &security); |
| 220 RemoveEntryUnless(wifi, kEAP, security == kWEP_8021X || security == kWPA_EAP); | 220 RemoveEntryUnless(wifi, kEAP, security == kWEP_8021X || security == kWPA_EAP); |
| 221 RemoveEntryUnless(wifi, kPassphrase, | 221 RemoveEntryUnless(wifi, kPassphrase, |
| 222 security == kWEP_PSK || security == kWPA_PSK); | 222 security == kWEP_PSK || security == kWPA_PSK); |
| 223 } | 223 } |
| 224 | 224 |
| 225 } // namespace onc | 225 } // namespace onc |
| 226 } // namespace chromeos | 226 } // namespace chromeos |
| OLD | NEW |