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

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

Issue 1228543002: Translate ONC ProxySettings <-> Shill ProxyConfig (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add Proxy PAC tests 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_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 aca2df0c3e5cefb7933b4f834eb0851e0fbe8a6e..40471750f258bd79627cd2f1f96951efc0345fd9 100644
--- a/chromeos/network/onc/onc_translator_shill_to_onc.cc
+++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc
@@ -17,6 +17,7 @@
#include "chromeos/network/network_util.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"
@@ -562,6 +563,18 @@ void ShillToONCTranslator::TranslateNetworkWithState() {
*static_ipconfig);
}
}
+
+ std::string proxy_config_str;
+ if (shill_dictionary_->GetStringWithoutPathExpansion(
+ shill::kProxyConfigProperty, &proxy_config_str) &&
+ !proxy_config_str.empty()) {
+ scoped_ptr<base::DictionaryValue> proxy_config_value(
+ ReadDictionaryFromJson(proxy_config_str));
eroman 2015/07/08 21:26:37 This can return NULL.
stevenjb 2015/07/08 22:13:07 Good catch, added test.
+ scoped_ptr<base::DictionaryValue> proxy_settings =
+ ConvertProxyConfigToOncProxySettings(*proxy_config_value);
eroman 2015/07/08 21:26:37 Note that proxy_config_value could be NULL here.
stevenjb 2015/07/08 22:13:08 ConvertProxyConfigToOncProxySettings can also retu
+ onc_object_->SetWithoutPathExpansion(::onc::network_config::kProxySettings,
+ proxy_settings.release());
+ }
}
void ShillToONCTranslator::TranslateIPConfig() {

Powered by Google App Engine
This is Rietveld 408576698