diff options
author | kuan@chromium.org <kuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-11 15:35:55 +0000 |
---|---|---|
committer | kuan@chromium.org <kuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-11 15:35:55 +0000 |
commit | 2a7614c5e20ba8ef0e97761186651ae49831e5b3 (patch) | |
tree | 9fa83ade01b6646327d2f0e6878dc69249ea9bb1 /chrome/browser/chromeos/proxy_cros_settings_provider.cc | |
parent | 7cf745058a3ed22b59d3c1df5cf99b1f80562641 (diff) | |
download | chromium_src-2a7614c5e20ba8ef0e97761186651ae49831e5b3.zip chromium_src-2a7614c5e20ba8ef0e97761186651ae49831e5b3.tar.gz chromium_src-2a7614c5e20ba8ef0e97761186651ae49831e5b3.tar.bz2 |
chromeos: only enable pacurl input field when auto proxy is checked.
also fallback to auto-detect mode when pacurl is invalid/empty.
BUG=chromium-os:14388, chromium-os:15126
TEST=verify per both bug reports.
Review URL: http://codereview.chromium.org/6980003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84981 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/proxy_cros_settings_provider.cc')
-rw-r--r-- | chrome/browser/chromeos/proxy_cros_settings_provider.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/chrome/browser/chromeos/proxy_cros_settings_provider.cc b/chrome/browser/chromeos/proxy_cros_settings_provider.cc index 1b668263..2d35e49 100644 --- a/chrome/browser/chromeos/proxy_cros_settings_provider.cc +++ b/chrome/browser/chromeos/proxy_cros_settings_provider.cc @@ -49,7 +49,10 @@ void ProxyCrosSettingsProvider::DoSet(const std::string& path, std::string val; if (in_value->GetAsString(&val)) { GURL url(val); - config_service->UISetProxyConfigToPACScript(url); + if (url.is_valid()) + config_service->UISetProxyConfigToPACScript(url); + else + config_service->UISetProxyConfigToAutoDetect(); } } else if (path == kProxySingleHttp) { std::string val; @@ -203,7 +206,12 @@ bool ProxyCrosSettingsProvider::Get(const std::string& path, config_service->UIGetProxyConfig(&config); if (path == kProxyPacUrl) { - if (config.automatic_proxy.pac_url.is_valid()) { + // For auto-detect mode, there should be no pac url. + // For pac-script mode, there should be a pac url that is taking effect. + // For manual modes, the pac url, if previously cached, will be disabled. + if (config.mode != + chromeos::ProxyConfigServiceImpl::ProxyConfig::MODE_AUTO_DETECT && + config.automatic_proxy.pac_url.is_valid()) { data = Value::CreateStringValue(config.automatic_proxy.pac_url.spec()); found = true; } |