summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net
diff options
context:
space:
mode:
authormnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 13:14:55 +0000
committermnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 13:14:55 +0000
commit645df4b33db17b6e64ad379df6091aed2a2a5898 (patch)
treea10ba82eb41d4ae3dcfa1fcdd46c5d564b8dd755 /chrome/browser/net
parentb864ab5d7726905ae918b0eae49052afbf8d4582 (diff)
downloadchromium_src-645df4b33db17b6e64ad379df6091aed2a2a5898.zip
chromium_src-645df4b33db17b6e64ad379df6091aed2a2a5898.tar.gz
chromium_src-645df4b33db17b6e64ad379df6091aed2a2a5898.tar.bz2
Properly default proxy settings to system settings.
Only apply preference-set values if the values are set in the user preferences or forced by some higher-priority source. This is so we use the system settings as a default instead of stuff defined in recommended policy (which we should just ignore). BUG=49540 TEST=Configure recommended proxy policy and observe that the system defaults are in effect. Review URL: http://codereview.chromium.org/4439003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65196 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r--chrome/browser/net/chrome_url_request_context.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc
index 2360905..e73e375 100644
--- a/chrome/browser/net/chrome_url_request_context.cc
+++ b/chrome/browser/net/chrome_url_request_context.cc
@@ -930,9 +930,17 @@ net::ProxyConfig* CreateProxyConfig(const PrefService* pref_service) {
prefs::kProxyAutoDetect
};
+ // Check whether the preference system holds a valid proxy configuration. Note
+ // that preferences coming from a lower-priority source than the user settings
+ // are ignored. That's because chrome treats the system settings as the
+ // default values, which should apply if there's no explicit value forced by
+ // policy or the user.
bool found_enable_proxy_pref = false;
for (size_t i = 0; i < arraysize(proxy_prefs); i++) {
- if (pref_service->HasPrefPath(proxy_prefs[i])) {
+ const PrefService::Preference* pref =
+ pref_service->FindPreference(proxy_prefs[i]);
+ DCHECK(pref);
+ if (pref && (!pref->IsUserModifiable() || pref->HasUserSetting())) {
found_enable_proxy_pref = true;
break;
}