Chromium Code Reviews| Index: chromeos/network/network_util.cc |
| diff --git a/chromeos/network/network_util.cc b/chromeos/network/network_util.cc |
| index bcec78d0384f7bbc9af75fba47c64ab6069230f0..19f05b1af92a45545bcaac7e48ce76a42ce92ff6 100644 |
| --- a/chromeos/network/network_util.cc |
| +++ b/chromeos/network/network_util.cc |
| @@ -7,11 +7,14 @@ |
| #include "base/strings/string_tokenizer.h" |
| #include "base/strings/string_util.h" |
| #include "base/strings/stringprintf.h" |
| +#include "chromeos/login/login_state.h" |
| +#include "chromeos/network/managed_network_configuration_handler.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/onc/onc_translator.h" |
| +#include "chromeos/network/onc/onc_utils.h" |
| #include "third_party/cros_system_api/dbus/service_constants.h" |
| namespace chromeos { |
| @@ -162,6 +165,10 @@ scoped_ptr<base::ListValue> TranslateNetworkListToONC( |
| NetworkHandler::Get()->network_state_handler()->GetNetworkListByType( |
| pattern, configured_only, visible_only, limit, &network_states); |
| + std::string userhash = LoginState::Get()->primary_user_hash(); |
|
pneubeck (no reviews)
2014/07/11 20:35:07
It seems to me that this is unexpected and will ev
stevenjb
2014/07/11 21:26:10
I'll rip this out for now, it's handy but not wort
|
| + ManagedNetworkConfigurationHandler* config_handler = |
| + NetworkHandler::Get()->managed_network_configuration_handler(); |
| + |
| scoped_ptr<base::ListValue> network_properties_list(new base::ListValue); |
| for (NetworkStateHandler::NetworkStateList::iterator it = |
| network_states.begin(); |
| @@ -175,9 +182,10 @@ scoped_ptr<base::ListValue> TranslateNetworkListToONC( |
| onc_dictionary->SetBoolean("visible", (*it)->visible()); |
| onc_dictionary->SetString("profile_path", (*it)->profile_path()); |
| onc_dictionary->SetString("service_path", (*it)->path()); |
| - std::string onc_source = (*it)->ui_data().GetONCSourceAsString(); |
| - if (!onc_source.empty()) |
| - onc_dictionary->SetString("onc_source", onc_source); |
| + ::onc::ONCSource onc_source; |
| + config_handler->FindPolicyByGUID(userhash, (*it)->guid(), &onc_source); |
| + onc_dictionary->SetString("onc_source", |
| + onc::GetSourceAsString(onc_source)); |
| } |
| network_properties_list->Append(onc_dictionary.release()); |