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

Unified Diff: chrome/browser/chromeos/ui_proxy_config.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: chrome/browser/chromeos/ui_proxy_config.cc
diff --git a/chrome/browser/chromeos/ui_proxy_config.cc b/chrome/browser/chromeos/ui_proxy_config.cc
index 9b246c6dd2946d133e871407030575fb457bc14c..b391625fdbff636ab505c06da651bb4013683dd5 100644
--- a/chrome/browser/chromeos/ui_proxy_config.cc
+++ b/chrome/browser/chromeos/ui_proxy_config.cc
@@ -120,10 +120,14 @@ base::DictionaryValue* UIProxyConfig::ToPrefProxyConfig() const {
}
case MODE_PROXY_PER_SCHEME: {
std::string spec;
- EncodeAndAppendProxyServer("http", http_proxy.server, &spec);
- EncodeAndAppendProxyServer("https", https_proxy.server, &spec);
- EncodeAndAppendProxyServer("ftp", ftp_proxy.server, &spec);
- EncodeAndAppendProxyServer("socks", socks_proxy.server, &spec);
+ ProxyConfigDictionary::EncodeAndAppendProxyServer(
+ "http", http_proxy.server, &spec);
jochen (gone - plz use gerrit) 2015/07/08 13:20:15 please don't use 'http' as a string but the kHttpS
stevenjb 2015/07/08 16:26:14 I just moved the function call, but I will go ahea
+ ProxyConfigDictionary::EncodeAndAppendProxyServer(
+ "https", https_proxy.server, &spec);
+ ProxyConfigDictionary::EncodeAndAppendProxyServer("ftp", ftp_proxy.server,
+ &spec);
+ ProxyConfigDictionary::EncodeAndAppendProxyServer(
+ "socks", socks_proxy.server, &spec);
return ProxyConfigDictionary::CreateFixedServers(
spec, bypass_rules.ToString());
}
@@ -148,21 +152,4 @@ UIProxyConfig::ManualProxy* UIProxyConfig::MapSchemeToProxy(
return NULL;
}
-// static
-void UIProxyConfig::EncodeAndAppendProxyServer(const std::string& url_scheme,
- const net::ProxyServer& server,
- std::string* spec) {
- if (!server.is_valid())
- return;
-
- if (!spec->empty())
- *spec += ';';
-
- if (!url_scheme.empty()) {
- *spec += url_scheme;
- *spec += "=";
- }
- *spec += server.ToURI();
-}
-
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698