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

Unified Diff: chromeos/network/onc/onc_normalizer.cc

Issue 749013003: ONC: Add IPAddressConfigType and NameServersConfigType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Alywas use empty dictionary to clear StaticIPConfig properties Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/network/onc/onc_merger.cc ('k') | chromeos/network/onc/onc_normalizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/onc/onc_normalizer.cc
diff --git a/chromeos/network/onc/onc_normalizer.cc b/chromeos/network/onc/onc_normalizer.cc
index 88796bf2fa83b69b5eb498613ff501b012f4e470..4ec5ddf67653d7fcdf3945a494f90d9553bea386 100644
--- a/chromeos/network/onc/onc_normalizer.cc
+++ b/chromeos/network/onc/onc_normalizer.cc
@@ -173,6 +173,19 @@ void Normalizer::NormalizeNetworkConfiguration(base::DictionaryValue* network) {
RemoveEntryUnless(network,
::onc::network_config::kWiFi,
type == ::onc::network_type::kWiFi);
+
+ std::string ip_address_config_type, name_servers_config_type;
+ network->GetStringWithoutPathExpansion(
+ ::onc::network_config::kIPAddressConfigType, &ip_address_config_type);
+ network->GetStringWithoutPathExpansion(
+ ::onc::network_config::kNameServersConfigType, &name_servers_config_type);
+ RemoveEntryUnless(
+ network, ::onc::network_config::kStaticIPConfig,
+ (ip_address_config_type == ::onc::network_config::kIPConfigTypeStatic) ||
+ (name_servers_config_type ==
+ ::onc::network_config::kIPConfigTypeStatic));
+ // TODO(pneubeck): Remove fields from StaticIPConfig not specified by
+ // IP[Address|Nameservers]ConfigType.
}
void Normalizer::NormalizeOpenVPN(base::DictionaryValue* openvpn) {
« no previous file with comments | « chromeos/network/onc/onc_merger.cc ('k') | chromeos/network/onc/onc_normalizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698