#ifndef CHROME_BROWSER_NET_FIREFOX_PROXY_SETTINGS_H_
#define CHROME_BROWSER_NET_FIREFOX_PROXY_SETTINGS_H_
#include <string>
#include <vector>
#include "base/basictypes.h"
namespace base {
class FilePath;
}
namespace net {
class ProxyConfig;
}
class FirefoxProxySettings {
public:
enum ProxyConfig {
NO_PROXY = 0,
AUTO_DETECT,
SYSTEM,
AUTO_FROM_URL,
MANUAL
};
enum SOCKSVersion {
UNKNONW = 0,
V4,
V5
};
FirefoxProxySettings();
~FirefoxProxySettings();
static bool GetSettings(FirefoxProxySettings* settings);
void Reset();
ProxyConfig config_type() const { return config_type_; }
std::string http_proxy() const { return http_proxy_; }
int http_proxy_port() const { return http_proxy_port_; }
std::string ssl_proxy() const { return ssl_proxy_; }
int ssl_proxy_port() const { return ssl_proxy_port_; }
std::string ftp_proxy() const { return ftp_proxy_; }
int ftp_proxy_port() const { return ftp_proxy_port_; }
std::string gopher_proxy() const { return gopher_proxy_; }
int gopher_proxy_port() const { return gopher_proxy_port_; }
std::string socks_host() const { return socks_host_; }
int socks_port() const { return socks_port_; }
SOCKSVersion socks_version() const { return socks_version_; }
std::vector<std::string> proxy_bypass_list() const {
return proxy_bypass_list_;
}
const std::string autoconfig_url() const {
return autoconfig_url_;
}
bool ToProxyConfig(net::ProxyConfig* config);
protected:
static bool GetSettingsFromFile(const base::FilePath& pref_file,
FirefoxProxySettings* settings);
private:
ProxyConfig config_type_;
std::string http_proxy_;
int http_proxy_port_;
std::string ssl_proxy_;
int ssl_proxy_port_;
std::string ftp_proxy_;
int ftp_proxy_port_;
std::string gopher_proxy_;
int gopher_proxy_port_;
std::string socks_host_;
int socks_port_;
SOCKSVersion socks_version_;
std::vector<std::string> proxy_bypass_list_;
std::string autoconfig_url_;
DISALLOW_COPY_AND_ASSIGN(FirefoxProxySettings);
};
#endif