Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4710)

Unified Diff: chrome/browser/policy/configuration_policy_pref_store.cc

Issue 6021010: Fix setting a proxy configuration via policy that specifies a .pac file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address feedback and fix tests Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/configuration_policy_pref_store.cc
diff --git a/chrome/browser/policy/configuration_policy_pref_store.cc b/chrome/browser/policy/configuration_policy_pref_store.cc
index 23e65106c3adebf2a9f45feb3ca8c79b8789af5d..1dc917a88f1ab6993a265305850a3a2a0263ba38 100644
--- a/chrome/browser/policy/configuration_policy_pref_store.cc
+++ b/chrome/browser/policy/configuration_policy_pref_store.cc
@@ -527,24 +527,24 @@ bool ConfigurationPolicyPrefKeeper::CheckProxySettings() {
}
break;
case kPolicyAutoDetectProxyMode:
- if (server || bypass_list) {
+ if (server || bypass_list || pac_url) {
LOG(WARNING) << "A centrally-administered policy dictates that a proxy"
<< " shall be auto configured but specifies fixed proxy"
- << " servers or a by-pass list.";
+ << " servers, a by-pass list or a .pac script URL.";
return false;
}
break;
case kPolicyManuallyConfiguredProxyMode:
- if (!server) {
+ if (server && pac_url) {
LOG(WARNING) << "A centrally-administered policy dictates that the"
- << " system proxy settings should use fixed proxy servers"
- << " without specifying which ones.";
+ << " system proxy settings should use both a fixed"
+ << " proxy server and a .pac url.";
return false;
}
- if (pac_url) {
+ if (!server && !pac_url) {
LOG(WARNING) << "A centrally-administered policy dictates that the"
- << " system proxy settings should use fixed proxy servers"
- << " but also specifies a PAC script.";
+ << " system proxy settings should use either a fixed"
+ << " proxy server or a .pac url, but specifies neither.";
return false;
}
break;
@@ -576,11 +576,11 @@ void ConfigurationPolicyPrefKeeper::ApplyProxySettings() {
break;
case kPolicyAutoDetectProxyMode:
mode = ProxyPrefs::MODE_AUTO_DETECT;
- if (HasProxyPolicy(kPolicyProxyPacUrl))
- mode = ProxyPrefs::MODE_PAC_SCRIPT;
break;
case kPolicyManuallyConfiguredProxyMode:
mode = ProxyPrefs::MODE_FIXED_SERVERS;
+ if (HasProxyPolicy(kPolicyProxyPacUrl))
+ mode = ProxyPrefs::MODE_PAC_SCRIPT;
break;
case kPolicyUseSystemProxyMode:
mode = ProxyPrefs::MODE_SYSTEM;
« no previous file with comments | « chrome/app/policy/policy_templates.json ('k') | chrome/browser/policy/configuration_policy_pref_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698