OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/proxy/proxy_config.h" | 5 #include "net/proxy/proxy_config.h" |
6 | 6 |
7 #include "base/string_tokenizer.h" | 7 #include "base/string_tokenizer.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // this is a regular proxy server configuration, i.e. proxies | 49 // this is a regular proxy server configuration, i.e. proxies |
50 // are not configured per protocol. | 50 // are not configured per protocol. |
51 if (!proxy_server_for_scheme.GetNext()) { | 51 if (!proxy_server_for_scheme.GetNext()) { |
52 if (type == TYPE_PROXY_PER_SCHEME) | 52 if (type == TYPE_PROXY_PER_SCHEME) |
53 continue; // Unexpected. | 53 continue; // Unexpected. |
54 single_proxy = ProxyServer::FromURI(url_scheme); | 54 single_proxy = ProxyServer::FromURI(url_scheme); |
55 type = TYPE_SINGLE_PROXY; | 55 type = TYPE_SINGLE_PROXY; |
56 return; | 56 return; |
57 } | 57 } |
58 | 58 |
| 59 // If the proxy settings has only socks and others blank, |
| 60 // make that the default for all the proxies |
| 61 // This gets hit only on windows when using IE settings. |
| 62 if (url_scheme == "socks") { |
| 63 std::string proxy_server_string = "socks://"; |
| 64 proxy_server_string.append(proxy_server_for_scheme.token()); |
| 65 single_proxy = ProxyServer::FromURI(proxy_server_string); |
| 66 type = TYPE_SINGLE_PROXY; |
| 67 return; |
| 68 } |
| 69 |
59 // Trim whitespace off the url scheme. | 70 // Trim whitespace off the url scheme. |
60 TrimWhitespaceASCII(url_scheme, TRIM_ALL, &url_scheme); | 71 TrimWhitespaceASCII(url_scheme, TRIM_ALL, &url_scheme); |
61 | 72 |
62 // Add it to the per-scheme mappings (if supported scheme). | 73 // Add it to the per-scheme mappings (if supported scheme). |
63 type = TYPE_PROXY_PER_SCHEME; | 74 type = TYPE_PROXY_PER_SCHEME; |
64 if (const ProxyServer* entry = MapSchemeToProxy(url_scheme)) | 75 if (const ProxyServer* entry = MapSchemeToProxy(url_scheme)) |
65 *const_cast<ProxyServer*>(entry) = | 76 *const_cast<ProxyServer*>(entry) = |
66 ProxyServer::FromURI(proxy_server_for_scheme.token()); | 77 ProxyServer::FromURI(proxy_server_for_scheme.token()); |
67 } | 78 } |
68 } | 79 } |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 it != config.proxy_bypass.end(); ++it) { | 214 it != config.proxy_bypass.end(); ++it) { |
204 out << " " << *it << "\n"; | 215 out << " " << *it << "\n"; |
205 } | 216 } |
206 out << " }\n"; | 217 out << " }\n"; |
207 } | 218 } |
208 | 219 |
209 out << " id: " << config.id() << "\n" | 220 out << " id: " << config.id() << "\n" |
210 << "}"; | 221 << "}"; |
211 return out; | 222 return out; |
212 } | 223 } |
OLD | NEW |