summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordanno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-29 11:20:57 +0000
committerdanno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-29 11:20:57 +0000
commit7edbfe40420637bf5cde9e6b20a96dcd28d0dd94 (patch)
tree1f62e408931b6e1d5fc3b798a3b8e0525a928d59
parent8d04c19736f5c4b324675777721d439a46974290 (diff)
downloadchromium_src-7edbfe40420637bf5cde9e6b20a96dcd28d0dd94.zip
chromium_src-7edbfe40420637bf5cde9e6b20a96dcd28d0dd94.tar.gz
chromium_src-7edbfe40420637bf5cde9e6b20a96dcd28d0dd94.tar.bz2
Fix setting a proxy configuration via policy that specifies a .pac file.
BUG=68099 TEST=manual testing of proxy policy Review URL: http://codereview.chromium.org/6021010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70259 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/policy/policy_templates.grd6
-rw-r--r--chrome/app/policy/policy_templates.json3
-rw-r--r--chrome/browser/policy/configuration_policy_pref_store.cc20
-rw-r--r--chrome/browser/policy/configuration_policy_pref_store_unittest.cc5
4 files changed, 13 insertions, 21 deletions
diff --git a/chrome/app/policy/policy_templates.grd b/chrome/app/policy/policy_templates.grd
index 341c57d..ab256d5 100644
--- a/chrome/app/policy/policy_templates.grd
+++ b/chrome/app/policy/policy_templates.grd
@@ -857,12 +857,6 @@ templates and will be translated for each locale. -->
It starts with <ph name="CHROMIUM_KEY">Software\Policies\Chromium</ph> for Chromium policies and with <ph name="GOOGLE_CHROME_KEY">Software\Policies\Google\Chrome</ph> for Google Chrome policies.
</message>
- <message name="IDS_POLICY_DOC_NOTE"
- desc="Warning notice for policies in the generated policy documentation">
- NOTE: there are some issues about this policy, visit
- <ph name="POLICY_TEMPLATE_DOWNLOAD_URL">$6<ex>
- http://www.chromium.org/administrators/policy-list-3/serious-problem</ex></ph> for more details.
- </message>
<message name="IDS_POLICY_DOC_BACK_TO_TOP"
desc="Text of a link in the generated policy documentation, that takes the user to the top of the page">
Back to top
diff --git a/chrome/app/policy/policy_templates.json b/chrome/app/policy/policy_templates.json
index 7b352aa..e7a4463 100644
--- a/chrome/app/policy/policy_templates.json
+++ b/chrome/app/policy/policy_templates.json
@@ -194,9 +194,6 @@
'annotations': {
'features': {'dynamic_refresh': 0},
'example_value': True,
- 'problem_href':
- 'http://www.chromium.org/administrators/'
- 'policy-list-3/metrics-reporting-enabled',
}
},
{
diff --git a/chrome/browser/policy/configuration_policy_pref_store.cc b/chrome/browser/policy/configuration_policy_pref_store.cc
index 23e6510..1dc917a 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;
diff --git a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
index 1896aaa..100c774 100644
--- a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
+++ b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc
@@ -318,8 +318,9 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, AutoDetectPac) {
MockConfigurationPolicyProvider provider;
provider.AddPolicy(kPolicyProxyPacUrl,
Value::CreateStringValue("http://short.org/proxy.pac"));
- provider.AddPolicy(kPolicyProxyMode,
- Value::CreateIntegerValue(kPolicyAutoDetectProxyMode));
+ provider.AddPolicy(
+ kPolicyProxyMode,
+ Value::CreateIntegerValue(kPolicyManuallyConfiguredProxyMode));
ConfigurationPolicyPrefStore store(&provider);
VerifyProxyPrefs(