| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 } | 225 } |
| 226 | 226 |
| 227 void Normalizer::NormalizeVPN(base::DictionaryValue* vpn) { | 227 void Normalizer::NormalizeVPN(base::DictionaryValue* vpn) { |
| 228 using namespace ::onc::vpn; | 228 using namespace ::onc::vpn; |
| 229 | 229 |
| 230 std::string type; | 230 std::string type; |
| 231 vpn->GetStringWithoutPathExpansion(::onc::vpn::kType, &type); | 231 vpn->GetStringWithoutPathExpansion(::onc::vpn::kType, &type); |
| 232 RemoveEntryUnless(vpn, kOpenVPN, type == kOpenVPN); | 232 RemoveEntryUnless(vpn, kOpenVPN, type == kOpenVPN); |
| 233 RemoveEntryUnless(vpn, kIPsec, type == kIPsec || type == kTypeL2TP_IPsec); | 233 RemoveEntryUnless(vpn, kIPsec, type == kIPsec || type == kTypeL2TP_IPsec); |
| 234 RemoveEntryUnless(vpn, kL2TP, type == kTypeL2TP_IPsec); | 234 RemoveEntryUnless(vpn, kL2TP, type == kTypeL2TP_IPsec); |
| 235 RemoveEntryUnless(vpn, kThirdPartyVpn, type == kThirdPartyVpn); |
| 235 } | 236 } |
| 236 | 237 |
| 237 void Normalizer::NormalizeWiFi(base::DictionaryValue* wifi) { | 238 void Normalizer::NormalizeWiFi(base::DictionaryValue* wifi) { |
| 238 using namespace ::onc::wifi; | 239 using namespace ::onc::wifi; |
| 239 | 240 |
| 240 std::string security; | 241 std::string security; |
| 241 wifi->GetStringWithoutPathExpansion(::onc::wifi::kSecurity, &security); | 242 wifi->GetStringWithoutPathExpansion(::onc::wifi::kSecurity, &security); |
| 242 RemoveEntryUnless(wifi, kEAP, security == kWEP_8021X || security == kWPA_EAP); | 243 RemoveEntryUnless(wifi, kEAP, security == kWEP_8021X || security == kWPA_EAP); |
| 243 RemoveEntryUnless(wifi, kPassphrase, | 244 RemoveEntryUnless(wifi, kPassphrase, |
| 244 security == kWEP_PSK || security == kWPA_PSK); | 245 security == kWEP_PSK || security == kWPA_PSK); |
| 245 FillInHexSSIDField(wifi); | 246 FillInHexSSIDField(wifi); |
| 246 } | 247 } |
| 247 | 248 |
| 248 } // namespace onc | 249 } // namespace onc |
| 249 } // namespace chromeos | 250 } // namespace chromeos |
| OLD | NEW |