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

Unified Diff: chromeos/network/onc/onc_translator_onc_to_shill.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/network/onc/onc_signature.cc ('k') | chromeos/network/onc/onc_validator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/onc/onc_translator_onc_to_shill.cc
diff --git a/chromeos/network/onc/onc_translator_onc_to_shill.cc b/chromeos/network/onc/onc_translator_onc_to_shill.cc
index 8e30af55446f6889b6c35922c488bf602039aae8..05b746fdffe52065ce0038cf8f656384ff0d78d1 100644
--- a/chromeos/network/onc/onc_translator_onc_to_shill.cc
+++ b/chromeos/network/onc/onc_translator_onc_to_shill.cc
@@ -257,6 +257,17 @@ void LocalTranslator::TranslateNetworkConfiguration() {
if (type == ::onc::network_type::kVPN)
CopyFieldFromONCToShill(::onc::network_config::kName, shill::kNameProperty);
+ std::string ipconfig_type;
+ onc_object_->GetStringWithoutPathExpansion(
+ ::onc::network_config::kIPConfigType, &ipconfig_type);
+
+ if (ipconfig_type == ::onc::network_config::kIPConfigTypeDHCP) {
+ // Clear the properties of StaticIPConfig.
+ shill_dictionary_->SetWithoutPathExpansion(shill::kStaticIPConfigProperty,
+ base::Value::CreateNullValue());
+ }
+ // Otherwise, the StaticIPConfig is set and translated.
+
CopyFieldsAccordingToSignature();
}
« no previous file with comments | « chromeos/network/onc/onc_signature.cc ('k') | chromeos/network/onc/onc_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698