| 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" |
| 11 #include "chromeos/network/onc/onc_signature.h" | 11 #include "chromeos/network/onc/onc_signature.h" |
| 12 #include "chromeos/network/onc/onc_utils.h" |
| 12 #include "components/onc/onc_constants.h" | 13 #include "components/onc/onc_constants.h" |
| 13 | 14 |
| 14 namespace chromeos { | 15 namespace chromeos { |
| 15 namespace onc { | 16 namespace onc { |
| 16 | 17 |
| 17 Normalizer::Normalizer(bool remove_recommended_fields) | 18 Normalizer::Normalizer(bool remove_recommended_fields) |
| 18 : remove_recommended_fields_(remove_recommended_fields) { | 19 : remove_recommended_fields_(remove_recommended_fields) { |
| 19 } | 20 } |
| 20 | 21 |
| 21 Normalizer::~Normalizer() { | 22 Normalizer::~Normalizer() { |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 } | 226 } |
| 226 | 227 |
| 227 void Normalizer::NormalizeWiFi(base::DictionaryValue* wifi) { | 228 void Normalizer::NormalizeWiFi(base::DictionaryValue* wifi) { |
| 228 using namespace ::onc::wifi; | 229 using namespace ::onc::wifi; |
| 229 | 230 |
| 230 std::string security; | 231 std::string security; |
| 231 wifi->GetStringWithoutPathExpansion(::onc::wifi::kSecurity, &security); | 232 wifi->GetStringWithoutPathExpansion(::onc::wifi::kSecurity, &security); |
| 232 RemoveEntryUnless(wifi, kEAP, security == kWEP_8021X || security == kWPA_EAP); | 233 RemoveEntryUnless(wifi, kEAP, security == kWEP_8021X || security == kWPA_EAP); |
| 233 RemoveEntryUnless(wifi, kPassphrase, | 234 RemoveEntryUnless(wifi, kPassphrase, |
| 234 security == kWEP_PSK || security == kWPA_PSK); | 235 security == kWEP_PSK || security == kWPA_PSK); |
| 236 FillInHexSSIDField(wifi); |
| 235 } | 237 } |
| 236 | 238 |
| 237 } // namespace onc | 239 } // namespace onc |
| 238 } // namespace chromeos | 240 } // namespace chromeos |
| OLD | NEW |