OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/importer/firefox_proxy_settings.h" | 5 #include "chrome/browser/importer/firefox_proxy_settings.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/string_tokenizer.h" | |
9 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/strings/string_tokenizer.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/browser/importer/firefox_importer_utils.h" | 11 #include "chrome/browser/importer/firefox_importer_utils.h" |
12 #include "net/proxy/proxy_config.h" | 12 #include "net/proxy/proxy_config.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 const char* const kNetworkProxyTypeKey = "network.proxy.type"; | 16 const char* const kNetworkProxyTypeKey = "network.proxy.type"; |
17 const char* const kHTTPProxyKey = "network.proxy.http"; | 17 const char* const kHTTPProxyKey = "network.proxy.http"; |
18 const char* const kHTTPProxyPortKey = "network.proxy.http_port"; | 18 const char* const kHTTPProxyPortKey = "network.proxy.http_port"; |
19 const char* const kSSLProxyKey = "network.proxy.ssl"; | 19 const char* const kSSLProxyKey = "network.proxy.ssl"; |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 LOG(ERROR) << "Failed to retrieve Firefox SOCKS host"; | 203 LOG(ERROR) << "Failed to retrieve Firefox SOCKS host"; |
204 if (!dictionary.GetInteger(kSOCKSHostPortKey, &(settings->socks_port_))) | 204 if (!dictionary.GetInteger(kSOCKSHostPortKey, &(settings->socks_port_))) |
205 LOG(ERROR) << "Failed to retrieve Firefox SOCKS port"; | 205 LOG(ERROR) << "Failed to retrieve Firefox SOCKS port"; |
206 int socks_version; | 206 int socks_version; |
207 if (dictionary.GetInteger(kSOCKSVersionKey, &socks_version)) | 207 if (dictionary.GetInteger(kSOCKSVersionKey, &socks_version)) |
208 settings->socks_version_ = IntToSOCKSVersion(socks_version); | 208 settings->socks_version_ = IntToSOCKSVersion(socks_version); |
209 | 209 |
210 std::string proxy_bypass; | 210 std::string proxy_bypass; |
211 if (dictionary.GetStringASCII(kNoProxyListKey, &proxy_bypass) && | 211 if (dictionary.GetStringASCII(kNoProxyListKey, &proxy_bypass) && |
212 !proxy_bypass.empty()) { | 212 !proxy_bypass.empty()) { |
213 StringTokenizer string_tok(proxy_bypass, ","); | 213 base::StringTokenizer string_tok(proxy_bypass, ","); |
214 while (string_tok.GetNext()) { | 214 while (string_tok.GetNext()) { |
215 std::string token = string_tok.token(); | 215 std::string token = string_tok.token(); |
216 TrimWhitespaceASCII(token, TRIM_ALL, &token); | 216 TrimWhitespaceASCII(token, TRIM_ALL, &token); |
217 if (!token.empty()) | 217 if (!token.empty()) |
218 settings->proxy_bypass_list_.push_back(token); | 218 settings->proxy_bypass_list_.push_back(token); |
219 } | 219 } |
220 } | 220 } |
221 } | 221 } |
222 return true; | 222 return true; |
223 } | 223 } |
OLD | NEW |