Chromium Code Reviews| Index: chromeos/network/onc/onc_translator_shill_to_onc.cc |
| diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc |
| index 168f0b14597c546d847a2d6b4000dc03efde43b1..b326d7fd829840e04d14fa533e1411ed7dc77fc8 100644 |
| --- a/chromeos/network/onc/onc_translator_shill_to_onc.cc |
| +++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc |
| @@ -12,6 +12,7 @@ |
| #include "base/logging.h" |
| #include "base/strings/string_util.h" |
| #include "base/values.h" |
| +#include "chromeos/network/network_profile_handler.h" |
| #include "chromeos/network/network_state.h" |
| #include "chromeos/network/network_util.h" |
| #include "chromeos/network/onc/onc_signature.h" |
| @@ -415,6 +416,20 @@ void ShillToONCTranslator::TranslateNetworkWithState() { |
| } |
| } |
| + std::string profile_path; |
| + if (shill_dictionary_->GetStringWithoutPathExpansion(shill::kProfileProperty, |
|
pneubeck (no reviews)
2014/09/09 19:35:32
If we use the same field for 'policy sources', thi
stevenjb
2014/09/10 00:00:55
I think the right thing to do is to pass ONCSource
|
| + &profile_path)) { |
| + std::string source; |
| + if (profile_path == NetworkProfileHandler::GetSharedProfilePath()) |
| + source = ::onc::network_config::kSourceDevice; |
| + else if (!profile_path.empty()) |
| + source = ::onc::network_config::kSourceUser; |
| + else |
| + source = ::onc::network_config::kSourceNone; |
| + onc_object_->SetStringWithoutPathExpansion( |
| + ::onc::network_config::kSource, source); |
| + } |
| + |
| // Use a human-readable aa:bb format for any hardware MAC address. Note: |
| // this property is provided by the caller but is not part of the Shill |
| // Service properties (it is copied from the Device properties). |