Chromium Code Reviews| Index: chromeos/network/onc/onc_translator_shill_to_onc.cc |
| diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc |
| index 11b802fadeeba7edef3f215161b13ec07c768306..4516a6f07edafdc618f40361148f83692dfb9055 100644 |
| --- a/chromeos/network/onc/onc_translator_shill_to_onc.cc |
| +++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc |
| @@ -12,6 +12,7 @@ |
| #include "base/logging.h" |
| #include "base/values.h" |
| #include "chromeos/network/network_state.h" |
| +#include "chromeos/network/network_state_handler.h" |
| #include "chromeos/network/onc/onc_signature.h" |
| #include "chromeos/network/onc/onc_translation_tables.h" |
| #include "chromeos/network/shill_property_util.h" |
| @@ -458,5 +459,27 @@ scoped_ptr<base::DictionaryValue> TranslateShillServiceToONCPart( |
| return translator.CreateTranslatedONCObject(); |
| } |
| +scoped_ptr<base::ListValue> TranslateShillNetworkListToONC( |
|
pneubeck (no reviews)
2014/05/08 13:25:12
see my comment in the other CL. Please move out of
stevenjb
2014/05/08 22:32:26
Done, but note: there is a dependency on NetworkSt
pneubeck (no reviews)
2014/05/12 13:37:07
Yes, that one is only comparing to Shill constants
|
| + NetworkTypePattern pattern) { |
| + NetworkStateHandler::NetworkStateList network_states; |
| + NetworkHandler::Get()->network_state_handler()->GetNetworkListByType( |
| + pattern, &network_states); |
| + |
| + scoped_ptr<base::ListValue> network_properties_list(new base::ListValue); |
| + for (NetworkStateHandler::NetworkStateList::iterator it = |
| + network_states.begin(); |
| + it != network_states.end(); |
| + ++it) { |
| + base::DictionaryValue shill_dictionary; |
| + (*it)->GetStateProperties(&shill_dictionary); |
| + |
| + scoped_ptr<base::DictionaryValue> onc_network_part = |
| + TranslateShillServiceToONCPart( |
| + shill_dictionary, &chromeos::onc::kNetworkWithStateSignature); |
| + network_properties_list->Append(onc_network_part.release()); |
| + } |
| + return network_properties_list.Pass(); |
| +} |
| + |
| } // namespace onc |
| } // namespace chromeos |