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 e750dda3d4c77ddd62db079f4bc85212dd896d9b..cec49c779551acad4d6cd1bb9300544a9d8518a6 100644 |
--- a/chromeos/network/managed_network_configuration_handler_impl.cc |
+++ b/chromeos/network/managed_network_configuration_handler_impl.cc |
@@ -739,6 +739,22 @@ void ManagedNetworkConfigurationHandlerImpl::GetPropertiesCallback( |
scoped_ptr<base::DictionaryValue> shill_properties_copy( |
shill_properties.DeepCopy()); |
+ std::string guid; |
+ shill_properties.GetStringWithoutPathExpansion(shill::kGuidProperty, &guid); |
+ if (guid.empty()) { |
+ // Unmanaged networks are assigned a GUID in NetworkState. Provide this |
+ // value in the ONC dictionary. |
+ const NetworkState* state = |
+ network_state_handler_->GetNetworkState(service_path); |
+ if (state && !state->guid().empty()) { |
+ guid = state->guid(); |
+ shill_properties_copy->SetStringWithoutPathExpansion(shill::kGuidProperty, |
+ guid); |
+ } else { |
+ LOG(ERROR) << "Network has no GUID specified: " << service_path; |
+ } |
+ } |
+ |
std::string type; |
shill_properties_copy->GetStringWithoutPathExpansion(shill::kTypeProperty, |
&type); |