| 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, | 162 network->RemoveWithoutPathExpansion(::onc::network_config::kSearchDomains, |
| 165 NULL); | 163 NULL); |
| 166 network->RemoveWithoutPathExpansion(::onc::network_config::kType, NULL); | 164 network->RemoveWithoutPathExpansion(::onc::network_config::kType, NULL); |
| 167 // Fields dependent on kType are removed afterwards, too. | 165 // Fields dependent on kType are removed afterwards, too. |
| 168 } | 166 } |
| 169 | 167 |
| 170 std::string type; | 168 std::string type; |
| 171 network->GetStringWithoutPathExpansion(::onc::network_config::kType, &type); | 169 network->GetStringWithoutPathExpansion(::onc::network_config::kType, &type); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 std::string security; | 236 std::string security; |
| 239 wifi->GetStringWithoutPathExpansion(::onc::wifi::kSecurity, &security); | 237 wifi->GetStringWithoutPathExpansion(::onc::wifi::kSecurity, &security); |
| 240 RemoveEntryUnless(wifi, kEAP, security == kWEP_8021X || security == kWPA_EAP); | 238 RemoveEntryUnless(wifi, kEAP, security == kWEP_8021X || security == kWPA_EAP); |
| 241 RemoveEntryUnless(wifi, kPassphrase, | 239 RemoveEntryUnless(wifi, kPassphrase, |
| 242 security == kWEP_PSK || security == kWPA_PSK); | 240 security == kWEP_PSK || security == kWPA_PSK); |
| 243 FillInHexSSIDField(wifi); | 241 FillInHexSSIDField(wifi); |
| 244 } | 242 } |
| 245 | 243 |
| 246 } // namespace onc | 244 } // namespace onc |
| 247 } // namespace chromeos | 245 } // namespace chromeos |
| OLD | NEW |