Chromium Code Reviews| Index: chrome/browser/ui/webui/chromeos/network_config_message_handler.cc |
| diff --git a/chrome/browser/ui/webui/chromeos/network_config_message_handler.cc b/chrome/browser/ui/webui/chromeos/network_config_message_handler.cc |
| index bb1feff04e8e3a971f83c417bee7893ac4406d0a..1b2882698b704a589101e3ceee68e6ff7089e56d 100644 |
| --- a/chrome/browser/ui/webui/chromeos/network_config_message_handler.cc |
| +++ b/chrome/browser/ui/webui/chromeos/network_config_message_handler.cc |
| @@ -11,6 +11,7 @@ |
| #include "base/logging.h" |
| #include "base/values.h" |
| #include "chromeos/login/login_state.h" |
| +#include "chromeos/network/device_state.h" |
| #include "chromeos/network/managed_network_configuration_handler.h" |
| #include "chromeos/network/network_configuration_handler.h" |
| #include "chromeos/network/network_state.h" |
| @@ -173,12 +174,32 @@ void NetworkConfigMessageHandler::GetShillProperties( |
| } |
| NetworkHandler::Get()->network_configuration_handler()->GetProperties( |
| service_path, |
| - base::Bind(&NetworkConfigMessageHandler::GetPropertiesSuccess, |
| + base::Bind(&NetworkConfigMessageHandler::GetShillPropertiesSuccess, |
| weak_ptr_factory_.GetWeakPtr(), callback_id), |
| base::Bind(&NetworkConfigMessageHandler::ErrorCallback, |
| weak_ptr_factory_.GetWeakPtr(), callback_id)); |
| } |
| +void NetworkConfigMessageHandler::GetShillPropertiesSuccess( |
| + int callback_id, |
| + const std::string& service_path, |
| + const base::DictionaryValue& dictionary) const { |
| + scoped_ptr<base::DictionaryValue> dictionary_copy(dictionary.DeepCopy()); |
| + |
| + // Get the device properties for debugging. |
| + std::string device; |
| + dictionary_copy->GetStringWithoutPathExpansion( |
| + shill::kDeviceProperty, &device); |
| + const DeviceState* device_state = |
| + NetworkHandler::Get()->network_state_handler()->GetDeviceState(device); |
| + if (device_state) { |
| + base::DictionaryValue* device_dictionary = |
| + device_state->properties().DeepCopy(); |
| + dictionary_copy->Set("Device", device_dictionary); |
|
pneubeck (no reviews)
2014/08/22 08:55:32
nit: FWIW, in ManagedNetworkConfigurationHandlerIm
stevenjb
2014/08/22 17:08:43
Done.
|
| + } |
| + GetPropertiesSuccess(callback_id, service_path, *dictionary_copy); |
| +} |
| + |
| void NetworkConfigMessageHandler::InvokeCallback( |
| const base::ListValue& arg_list) const { |
| web_ui()->CallJavascriptFunction( |