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

Unified Diff: components/proxy_config/proxy_config_dictionary.cc

Issue 1228543002: Translate ONC ProxySettings <-> Shill ProxyConfig (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use net/ parsing, update OWNERS 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: components/proxy_config/proxy_config_dictionary.cc
diff --git a/components/proxy_config/proxy_config_dictionary.cc b/components/proxy_config/proxy_config_dictionary.cc
index e493bda910cd104d798f36497222ebd06c518ba9..326dd137766812eace6a3a7a4a254a08a2d56f91 100644
--- a/components/proxy_config/proxy_config_dictionary.cc
+++ b/components/proxy_config/proxy_config_dictionary.cc
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/values.h"
+#include "net/proxy/proxy_config.h"
namespace {
@@ -141,3 +142,21 @@ base::DictionaryValue* ProxyConfigDictionary::CreateDictionary(
dict->SetString(kProxyBypassList, bypass_list);
return dict;
}
+
+// static
+void ProxyConfigDictionary::EncodeAndAppendProxyServer(
+ const std::string& url_scheme,
+ const net::ProxyServer& server,
+ std::string* spec) {
jochen (gone - plz use gerrit) 2015/07/08 13:20:15 why not return a string?
stevenjb 2015/07/08 16:26:15 I just moved this so that it could be used outside
+ if (!server.is_valid())
+ return;
+
+ if (!spec->empty())
+ *spec += ';';
+
+ if (!url_scheme.empty()) {
+ *spec += url_scheme;
+ *spec += "=";
+ }
+ *spec += server.ToURI();
+}
« chromeos/network/onc/onc_utils.cc ('K') | « components/proxy_config/proxy_config_dictionary.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698