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

Unified Diff: chromeos/network/managed_network_configuration_handler_impl.cc

Issue 285233008: Add MacAddress to ONC and networkingPrivate (Closed) Base URL: https://chromium.googlesource.com/chromium/src
Patch Set: Rebase Created 6 years, 7 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
Index: chromeos/network/managed_network_configuration_handler_impl.cc
diff --git a/chromeos/network/managed_network_configuration_handler_impl.cc b/chromeos/network/managed_network_configuration_handler_impl.cc
index e4bbf77f27cf4b32a0f26ca04883dfc849e15374..61741213141e154d9b763573ae549ad81c859a6c 100644
--- a/chromeos/network/managed_network_configuration_handler_impl.cc
+++ b/chromeos/network/managed_network_configuration_handler_impl.cc
@@ -162,8 +162,8 @@ void ManagedNetworkConfigurationHandlerImpl::GetManagedPropertiesCallback(
scoped_ptr<base::DictionaryValue> properties_copy(
shill_properties.DeepCopy());
- // Add the IPConfigs to the dictionary before the ONC translation.
- GetIPConfigs(service_path, properties_copy.get());
+ // Add associated Device properties before the ONC translation.
+ GetDeviceProperties(service_path, properties_copy.get());
scoped_ptr<base::DictionaryValue> active_settings(
onc::TranslateShillServiceToONCPart(
@@ -223,8 +223,8 @@ void ManagedNetworkConfigurationHandlerImpl::GetPropertiesCallback(
const base::DictionaryValue& shill_properties) {
scoped_ptr<base::DictionaryValue> properties_copy(
shill_properties.DeepCopy());
- // Add the IPConfigs to the dictionary before the ONC translation.
- GetIPConfigs(service_path, properties_copy.get());
+ // Add associated Device properties before the ONC translation.
+ GetDeviceProperties(service_path, properties_copy.get());
scoped_ptr<base::DictionaryValue> onc_network(
onc::TranslateShillServiceToONCPart(
@@ -613,7 +613,7 @@ void ManagedNetworkConfigurationHandlerImpl::OnPolicyAppliedToNetwork(
NetworkPolicyObserver, observers_, PolicyApplied(service_path));
}
-void ManagedNetworkConfigurationHandlerImpl::GetIPConfigs(
+void ManagedNetworkConfigurationHandlerImpl::GetDeviceProperties(
const std::string& service_path,
base::DictionaryValue* properties) {
std::string connection_state;
@@ -631,9 +631,16 @@ void ManagedNetworkConfigurationHandlerImpl::GetIPConfigs(
const DeviceState* device_state =
network_state_handler_->GetDeviceState(device);
if (!device_state) {
- NET_LOG_ERROR("GetIPConfigs: no device: " + device, service_path);
+ NET_LOG_ERROR("GetDeviceProperties: no device: " + device, service_path);
return;
}
+
+ // Get the hardware MAC address from the DeviceState.
+ if (!device_state->mac_address().empty()) {
+ properties->SetStringWithoutPathExpansion(
+ shill::kAddressProperty, device_state->mac_address());
+ }
+
// Convert IPConfig dictionary to a ListValue.
base::ListValue* ip_configs = new base::ListValue;
for (base::DictionaryValue::Iterator iter(device_state->ip_configs());
« no previous file with comments | « chromeos/network/managed_network_configuration_handler_impl.h ('k') | chromeos/network/network_state_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698