Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Side by Side Diff: chromeos/network/onc/onc_normalizer.cc

Issue 540333002: ONC: Fix Static-/Saved-/IPConfig. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed another unit test. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos/network/onc/onc_merger_unittest.cc ('k') | chromeos/network/onc/onc_signature.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chromeos/network/onc/onc_merger_unittest.cc ('k') | chromeos/network/onc/onc_signature.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698