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

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

Issue 11414101: This adds ManagedNetworkConfigurationHandler first pass (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: upload after merge Created 7 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_translator.h ('k') | chromeos/network/onc/onc_translator_shill_to_onc.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 9bc9d48fffa8c005b81fa17182767a04b7ca048b..fb702951e0dcf0a6fbdbd1f8a3acadbb1a41b2ac 100644
--- a/chromeos/network/onc/onc_translator_onc_to_shill.cc
+++ b/chromeos/network/onc/onc_translator_onc_to_shill.cc
@@ -190,7 +190,7 @@ void LocalTranslator::AddValueAccordingToSignature(
if (value.get() == NULL)
return;
const OncFieldSignature* field_signature =
- GetFieldSignature(*onc_signature_, onc_name);
+ GetOncFieldSignature(*onc_signature_, onc_name);
DCHECK(field_signature != NULL);
if (field_signature == NULL || field_signature->shill_property_name == NULL)
return;
@@ -235,7 +235,7 @@ void TranslateONCHierarchy(const OncValueSignature& signature,
continue;
const OncFieldSignature* field_signature =
- GetFieldSignature(signature, it.key());
+ GetOncFieldSignature(signature, it.key());
TranslateONCHierarchy(*field_signature->value_signature, *inner_object,
shill_dictionary);
@@ -244,9 +244,25 @@ void TranslateONCHierarchy(const OncValueSignature& signature,
} // namespace
+std::vector<std::string> TranslateONCPropertyNamesToShill(
+ const std::vector<std::string>& onc_names,
+ const OncValueSignature* signature) {
+ std::vector<std::string> result;
+ for (std::vector<std::string>::const_iterator iter = onc_names.begin();
+ iter != onc_names.end(); ++iter) {
+ const OncFieldSignature* field_signature =
+ GetOncFieldSignature(*signature, *iter);
+ DCHECK(field_signature != NULL);
+ if (field_signature == NULL || field_signature->shill_property_name == NULL)
+ continue;
+ result.push_back(field_signature->shill_property_name);
+ }
+ return result;
+}
+
scoped_ptr<base::DictionaryValue> TranslateONCObjectToShill(
- const OncValueSignature* onc_signature,
- const base::DictionaryValue& onc_object) {
+ const base::DictionaryValue& onc_object,
+ const OncValueSignature* onc_signature) {
CHECK(onc_signature != NULL);
scoped_ptr<base::DictionaryValue> shill_dictionary(new base::DictionaryValue);
TranslateONCHierarchy(*onc_signature, onc_object, shill_dictionary.get());
« no previous file with comments | « chromeos/network/onc/onc_translator.h ('k') | chromeos/network/onc/onc_translator_shill_to_onc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698