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

Unified Diff: chrome/browser/ui/webui/chromeos/network_config_message_handler.cc

Issue 540613002: Translate Saved/StaticIPConfig properties from ONC to Shill (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests Created 6 years, 3 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 | « no previous file | chromeos/network/onc/onc_signature.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7d88bcd4af62c47064fe6a45542f8009e0e5a100..ec5833ede6cc7d2e8a5889ca205278408d1b0c50 100644
--- a/chrome/browser/ui/webui/chromeos/network_config_message_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/network_config_message_handler.cc
@@ -152,8 +152,10 @@ void NetworkConfigMessageHandler::GetPropertiesSuccess(
return_arg_list.AppendInteger(callback_id);
base::DictionaryValue* network_properties = dictionary.DeepCopy();
+ // Set the 'ServicePath' property for debugging.
network_properties->SetStringWithoutPathExpansion(
- ::onc::network_config::kGUID, service_path);
+ "ServicePath", service_path);
+
return_arg_list.Append(network_properties);
InvokeCallback(return_arg_list);
}
@@ -185,6 +187,8 @@ void NetworkConfigMessageHandler::GetShillPropertiesSuccess(
const std::string& service_path,
const base::DictionaryValue& dictionary) const {
scoped_ptr<base::DictionaryValue> dictionary_copy(dictionary.DeepCopy());
+ // Set the 'ServicePath' property for debugging.
+ dictionary_copy->SetStringWithoutPathExpansion("ServicePath", service_path);
// Get the device properties for debugging.
std::string device;
@@ -196,8 +200,21 @@ void NetworkConfigMessageHandler::GetShillPropertiesSuccess(
base::DictionaryValue* device_dictionary =
device_state->properties().DeepCopy();
dictionary_copy->Set(shill::kDeviceProperty, device_dictionary);
+
+ // Convert IPConfig dictionary to a ListValue.
+ base::ListValue* ip_configs = new base::ListValue;
+ for (base::DictionaryValue::Iterator iter(device_state->ip_configs());
+ !iter.IsAtEnd(); iter.Advance()) {
+ ip_configs->Append(iter.value().DeepCopy());
+ }
+ device_dictionary->SetWithoutPathExpansion(
+ shill::kIPConfigsProperty, ip_configs);
}
- GetPropertiesSuccess(callback_id, service_path, *dictionary_copy);
+
+ base::ListValue return_arg_list;
+ return_arg_list.AppendInteger(callback_id);
+ return_arg_list.Append(dictionary_copy.release());
+ InvokeCallback(return_arg_list);
}
void NetworkConfigMessageHandler::InvokeCallback(
« no previous file with comments | « no previous file | chromeos/network/onc/onc_signature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698