| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/net/firefox_proxy_settings.h" | 5 #include "chrome/browser/net/firefox_proxy_settings.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 net::ProxyServer::Scheme proxy_scheme = V5 == socks_version() ? | 229 net::ProxyServer::Scheme proxy_scheme = V5 == socks_version() ? |
| 230 net::ProxyServer::SCHEME_SOCKS5 : net::ProxyServer::SCHEME_SOCKS4; | 230 net::ProxyServer::SCHEME_SOCKS5 : net::ProxyServer::SCHEME_SOCKS4; |
| 231 | 231 |
| 232 config->proxy_rules().fallback_proxies.SetSingleProxyServer( | 232 config->proxy_rules().fallback_proxies.SetSingleProxyServer( |
| 233 net::ProxyServer( | 233 net::ProxyServer( |
| 234 proxy_scheme, | 234 proxy_scheme, |
| 235 net::HostPortPair(socks_host(), socks_port()))); | 235 net::HostPortPair(socks_host(), socks_port()))); |
| 236 } | 236 } |
| 237 | 237 |
| 238 config->proxy_rules().bypass_rules.ParseFromStringUsingSuffixMatching( | 238 config->proxy_rules().bypass_rules.ParseFromStringUsingSuffixMatching( |
| 239 base::JoinString(proxy_bypass_list_, ";")); | 239 JoinString(proxy_bypass_list_, ';')); |
| 240 | 240 |
| 241 return true; | 241 return true; |
| 242 } | 242 } |
| 243 | 243 |
| 244 // static | 244 // static |
| 245 bool FirefoxProxySettings::GetSettingsFromFile(const base::FilePath& pref_file, | 245 bool FirefoxProxySettings::GetSettingsFromFile(const base::FilePath& pref_file, |
| 246 FirefoxProxySettings* settings) { | 246 FirefoxProxySettings* settings) { |
| 247 base::DictionaryValue dictionary; | 247 base::DictionaryValue dictionary; |
| 248 if (!ParsePrefFile(pref_file, &dictionary)) | 248 if (!ParsePrefFile(pref_file, &dictionary)) |
| 249 return false; | 249 return false; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 while (string_tok.GetNext()) { | 297 while (string_tok.GetNext()) { |
| 298 std::string token = string_tok.token(); | 298 std::string token = string_tok.token(); |
| 299 base::TrimWhitespaceASCII(token, base::TRIM_ALL, &token); | 299 base::TrimWhitespaceASCII(token, base::TRIM_ALL, &token); |
| 300 if (!token.empty()) | 300 if (!token.empty()) |
| 301 settings->proxy_bypass_list_.push_back(token); | 301 settings->proxy_bypass_list_.push_back(token); |
| 302 } | 302 } |
| 303 } | 303 } |
| 304 } | 304 } |
| 305 return true; | 305 return true; |
| 306 } | 306 } |
| OLD | NEW |