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

Unified Diff: chrome/browser/chromeos/proxy_cros_settings_provider.cc

Issue 8496017: cros proxy: fix bug to use default port whenever its input field is empty. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « chrome/browser/chromeos/proxy_cros_settings_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/proxy_cros_settings_provider.cc
===================================================================
--- chrome/browser/chromeos/proxy_cros_settings_provider.cc (revision 108616)
+++ chrome/browser/chromeos/proxy_cros_settings_provider.cc (working copy)
@@ -351,12 +351,7 @@
uint16 port = 0;
if (proxy.server.is_valid())
port = proxy.server.host_port_pair().port();
- if (host.length() == 0 && port == 0)
- return net::ProxyServer();
- if (port == 0)
- port = net::ProxyServer::GetDefaultPortForScheme(scheme);
- net::HostPortPair host_port_pair(host, port);
- return net::ProxyServer(scheme, host_port_pair);
+ return CreateProxyServer(host, port, scheme);
}
net::ProxyServer ProxyCrosSettingsProvider::CreateProxyServerFromPort(
@@ -366,8 +361,17 @@
std::string host;
if (proxy.server.is_valid())
host = proxy.server.host_port_pair().host();
+ return CreateProxyServer(host, port, scheme);
+}
+
+net::ProxyServer ProxyCrosSettingsProvider::CreateProxyServer(
+ std::string host,
+ uint16 port,
+ net::ProxyServer::Scheme scheme) const {
if (host.length() == 0 && port == 0)
return net::ProxyServer();
+ if (port == 0)
+ port = net::ProxyServer::GetDefaultPortForScheme(scheme);
net::HostPortPair host_port_pair(host, port);
return net::ProxyServer(scheme, host_port_pair);
}
« no previous file with comments | « chrome/browser/chromeos/proxy_cros_settings_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698