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

Unified Diff: chromeos/network/onc/onc_translator_shill_to_onc.cc

Issue 552113002: Add ONC 'Source' configuration property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_279351_internet_options_9a
Patch Set: Rebase 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
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).

Powered by Google App Engine
This is Rietveld 408576698