| Index: chromeos/network/network_util.cc
|
| diff --git a/chromeos/network/network_util.cc b/chromeos/network/network_util.cc
|
| index b5d50b3219ec14904f9e0eb70fedf4e92e348ded..829aae3f61942f4d545b60de6e0aecac9462ecb8 100644
|
| --- a/chromeos/network/network_util.cc
|
| +++ b/chromeos/network/network_util.cc
|
| @@ -210,6 +210,26 @@ scoped_ptr<base::ListValue> TranslateNetworkListToONC(
|
| return network_properties_list.Pass();
|
| }
|
|
|
| +scoped_ptr<base::DictionaryValue> TranslateShillPropertiesToONC(
|
| + const std::string& service_path,
|
| + const base::DictionaryValue& shill_properties,
|
| + ::onc::ONCSource onc_source) {
|
| + scoped_ptr<base::DictionaryValue> shill_dictionary(
|
| + shill_properties.DeepCopy());
|
| + // Shill's 'Error' property is transient. Use NetworkState::GetErrorState()
|
| + // instead.
|
| + const NetworkState* network_state =
|
| + NetworkHandler::Get()->network_state_handler()->GetNetworkState(
|
| + service_path);
|
| + if (network_state) {
|
| + std::string error_state = network_state->GetErrorState();
|
| + shill_dictionary->SetStringWithoutPathExpansion(shill::kErrorProperty,
|
| + error_state);
|
| + }
|
| + return TranslateShillServiceToONCPart(*shill_dictionary, onc_source,
|
| + &onc::kNetworkWithStateSignature);
|
| +}
|
| +
|
| std::string TranslateONCTypeToShill(const std::string& onc_type) {
|
| if (onc_type == ::onc::network_type::kEthernet)
|
| return shill::kTypeEthernet;
|
|
|