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

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

Issue 750313003: ONC: Add IPConfigType. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ipconfig_object
Patch Set: Change clearing of StaticIPConfig. Created 6 years 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 | « no previous file | chromeos/network/onc/onc_normalizer_unittest.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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 std::string type; 169 std::string type;
170 network->GetStringWithoutPathExpansion(::onc::network_config::kType, &type); 170 network->GetStringWithoutPathExpansion(::onc::network_config::kType, &type);
171 RemoveEntryUnless(network, 171 RemoveEntryUnless(network,
172 ::onc::network_config::kEthernet, 172 ::onc::network_config::kEthernet,
173 type == ::onc::network_type::kEthernet); 173 type == ::onc::network_type::kEthernet);
174 RemoveEntryUnless( 174 RemoveEntryUnless(
175 network, ::onc::network_config::kVPN, type == ::onc::network_type::kVPN); 175 network, ::onc::network_config::kVPN, type == ::onc::network_type::kVPN);
176 RemoveEntryUnless(network, 176 RemoveEntryUnless(network,
177 ::onc::network_config::kWiFi, 177 ::onc::network_config::kWiFi,
178 type == ::onc::network_type::kWiFi); 178 type == ::onc::network_type::kWiFi);
179
180 std::string ipconfig_type;
181 network->GetStringWithoutPathExpansion(::onc::network_config::kIPConfigType,
182 &ipconfig_type);
183 RemoveEntryUnless(network,
184 ::onc::network_config::kStaticIPConfig,
185 type == ::onc::network_config::kIPConfigTypeStatic);
179 } 186 }
180 187
181 void Normalizer::NormalizeOpenVPN(base::DictionaryValue* openvpn) { 188 void Normalizer::NormalizeOpenVPN(base::DictionaryValue* openvpn) {
182 std::string clientcert_type; 189 std::string clientcert_type;
183 openvpn->GetStringWithoutPathExpansion(::onc::client_cert::kClientCertType, 190 openvpn->GetStringWithoutPathExpansion(::onc::client_cert::kClientCertType,
184 &clientcert_type); 191 &clientcert_type);
185 RemoveEntryUnless(openvpn, 192 RemoveEntryUnless(openvpn,
186 ::onc::client_cert::kClientCertPattern, 193 ::onc::client_cert::kClientCertPattern,
187 clientcert_type == ::onc::client_cert::kPattern); 194 clientcert_type == ::onc::client_cert::kPattern);
188 RemoveEntryUnless(openvpn, 195 RemoveEntryUnless(openvpn,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 236
230 std::string security; 237 std::string security;
231 wifi->GetStringWithoutPathExpansion(::onc::wifi::kSecurity, &security); 238 wifi->GetStringWithoutPathExpansion(::onc::wifi::kSecurity, &security);
232 RemoveEntryUnless(wifi, kEAP, security == kWEP_8021X || security == kWPA_EAP); 239 RemoveEntryUnless(wifi, kEAP, security == kWEP_8021X || security == kWPA_EAP);
233 RemoveEntryUnless(wifi, kPassphrase, 240 RemoveEntryUnless(wifi, kPassphrase,
234 security == kWEP_PSK || security == kWPA_PSK); 241 security == kWEP_PSK || security == kWPA_PSK);
235 } 242 }
236 243
237 } // namespace onc 244 } // namespace onc
238 } // namespace chromeos 245 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chromeos/network/onc/onc_normalizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698