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

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

Issue 1228543002: Translate ONC ProxySettings <-> Shill ProxyConfig (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add SchemeToString Created 5 years, 5 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_onc_to_shill.cc
diff --git a/chromeos/network/onc/onc_translator_onc_to_shill.cc b/chromeos/network/onc/onc_translator_onc_to_shill.cc
index 33b9e8d5becb17e629462f34bcb16a6604de0159..f399d8b48f755fdc182de0b14a2199cbf1de537d 100644
--- a/chromeos/network/onc/onc_translator_onc_to_shill.cc
+++ b/chromeos/network/onc/onc_translator_onc_to_shill.cc
@@ -19,6 +19,7 @@
#include "base/values.h"
#include "chromeos/network/onc/onc_signature.h"
#include "chromeos/network/onc/onc_translation_tables.h"
+#include "chromeos/network/onc/onc_utils.h"
#include "chromeos/network/shill_property_util.h"
#include "components/onc/onc_constants.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
@@ -284,6 +285,18 @@ void LocalTranslator::TranslateNetworkConfiguration() {
shill_dictionary_->SetWithoutPathExpansion(shill::kStaticIPConfigProperty,
new base::DictionaryValue);
}
+
+ const base::DictionaryValue* proxy_settings = nullptr;
+ if (onc_object_->GetDictionaryWithoutPathExpansion(
+ ::onc::network_config::kProxySettings, &proxy_settings)) {
+ scoped_ptr<base::DictionaryValue> proxy_config =
+ ConvertOncProxySettingsToProxyConfig(*proxy_settings);
+ std::string proxy_config_str;
+ base::JSONWriter::Write(*proxy_config.get(), &proxy_config_str);
+ shill_dictionary_->SetStringWithoutPathExpansion(
+ shill::kProxyConfigProperty, proxy_config_str);
+ }
+
CopyFieldsAccordingToSignature();
}

Powered by Google App Engine
This is Rietveld 408576698