| 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 #ifndef CHROME_BROWSER_IMPORTER_FIREFOX_PROXY_SETTINGS_H_ | 5 #ifndef CHROME_BROWSER_IMPORTER_FIREFOX_PROXY_SETTINGS_H_ |
| 6 #define CHROME_BROWSER_IMPORTER_FIREFOX_PROXY_SETTINGS_H_ | 6 #define CHROME_BROWSER_IMPORTER_FIREFOX_PROXY_SETTINGS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 | 12 |
| 13 namespace base { |
| 13 class FilePath; | 14 class FilePath; |
| 15 } |
| 14 | 16 |
| 15 namespace net { | 17 namespace net { |
| 16 class ProxyConfig; | 18 class ProxyConfig; |
| 17 } | 19 } |
| 18 | 20 |
| 19 class FirefoxProxySettings { | 21 class FirefoxProxySettings { |
| 20 public: | 22 public: |
| 21 enum ProxyConfig { | 23 enum ProxyConfig { |
| 22 NO_PROXY = 0, // No proxy are used. | 24 NO_PROXY = 0, // No proxy are used. |
| 23 AUTO_DETECT, // Automatically detected. | 25 AUTO_DETECT, // Automatically detected. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } | 73 } |
| 72 | 74 |
| 73 // Converts a FirefoxProxySettings object to a net::ProxyConfig. | 75 // Converts a FirefoxProxySettings object to a net::ProxyConfig. |
| 74 // On success returns true and fills |config| with the result. | 76 // On success returns true and fills |config| with the result. |
| 75 bool ToProxyConfig(net::ProxyConfig* config); | 77 bool ToProxyConfig(net::ProxyConfig* config); |
| 76 | 78 |
| 77 protected: | 79 protected: |
| 78 // Gets the settings from the passed prefs.js file and returns true if | 80 // Gets the settings from the passed prefs.js file and returns true if |
| 79 // successful. | 81 // successful. |
| 80 // Protected for tests. | 82 // Protected for tests. |
| 81 static bool GetSettingsFromFile(const FilePath& pref_file, | 83 static bool GetSettingsFromFile(const base::FilePath& pref_file, |
| 82 FirefoxProxySettings* settings); | 84 FirefoxProxySettings* settings); |
| 83 | 85 |
| 84 private: | 86 private: |
| 85 ProxyConfig config_type_; | 87 ProxyConfig config_type_; |
| 86 | 88 |
| 87 std::string http_proxy_; | 89 std::string http_proxy_; |
| 88 int http_proxy_port_; | 90 int http_proxy_port_; |
| 89 | 91 |
| 90 std::string ssl_proxy_; | 92 std::string ssl_proxy_; |
| 91 int ssl_proxy_port_; | 93 int ssl_proxy_port_; |
| 92 | 94 |
| 93 std::string ftp_proxy_; | 95 std::string ftp_proxy_; |
| 94 int ftp_proxy_port_; | 96 int ftp_proxy_port_; |
| 95 | 97 |
| 96 std::string gopher_proxy_; | 98 std::string gopher_proxy_; |
| 97 int gopher_proxy_port_; | 99 int gopher_proxy_port_; |
| 98 | 100 |
| 99 std::string socks_host_; | 101 std::string socks_host_; |
| 100 int socks_port_; | 102 int socks_port_; |
| 101 SOCKSVersion socks_version_; | 103 SOCKSVersion socks_version_; |
| 102 | 104 |
| 103 std::vector<std::string> proxy_bypass_list_; | 105 std::vector<std::string> proxy_bypass_list_; |
| 104 | 106 |
| 105 std::string autoconfig_url_; | 107 std::string autoconfig_url_; |
| 106 | 108 |
| 107 DISALLOW_COPY_AND_ASSIGN(FirefoxProxySettings); | 109 DISALLOW_COPY_AND_ASSIGN(FirefoxProxySettings); |
| 108 }; | 110 }; |
| 109 | 111 |
| 110 #endif // CHROME_BROWSER_IMPORTER_FIREFOX_PROXY_SETTINGS_H_ | 112 #endif // CHROME_BROWSER_IMPORTER_FIREFOX_PROXY_SETTINGS_H_ |
| OLD | NEW |