| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/proxy_config/pref_proxy_config_tracker_impl.h" | 5 #include "components/proxy_config/pref_proxy_config_tracker_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 default_settings); | 211 default_settings); |
| 212 } | 212 } |
| 213 | 213 |
| 214 // static | 214 // static |
| 215 void PrefProxyConfigTrackerImpl::RegisterProfilePrefs( | 215 void PrefProxyConfigTrackerImpl::RegisterProfilePrefs( |
| 216 user_prefs::PrefRegistrySyncable* pref_service) { | 216 user_prefs::PrefRegistrySyncable* pref_service) { |
| 217 base::DictionaryValue* default_settings = | 217 base::DictionaryValue* default_settings = |
| 218 ProxyConfigDictionary::CreateSystem(); | 218 ProxyConfigDictionary::CreateSystem(); |
| 219 pref_service->RegisterDictionaryPref(proxy_config::prefs::kProxy, | 219 pref_service->RegisterDictionaryPref(proxy_config::prefs::kProxy, |
| 220 default_settings); | 220 default_settings); |
| 221 pref_service->RegisterBooleanPref(proxy_config::prefs::kUseSharedProxies, |
| 222 false); |
| 221 } | 223 } |
| 222 | 224 |
| 223 // static | 225 // static |
| 224 ProxyPrefs::ConfigState PrefProxyConfigTrackerImpl::ReadPrefConfig( | 226 ProxyPrefs::ConfigState PrefProxyConfigTrackerImpl::ReadPrefConfig( |
| 225 const PrefService* pref_service, | 227 const PrefService* pref_service, |
| 226 net::ProxyConfig* config) { | 228 net::ProxyConfig* config) { |
| 227 // Clear the configuration and source. | 229 // Clear the configuration and source. |
| 228 *config = net::ProxyConfig(); | 230 *config = net::ProxyConfig(); |
| 229 ProxyPrefs::ConfigState config_state = ProxyPrefs::CONFIG_UNSET; | 231 ProxyPrefs::ConfigState config_state = ProxyPrefs::CONFIG_UNSET; |
| 230 | 232 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 (config_state_ != ProxyPrefs::CONFIG_UNSET && | 349 (config_state_ != ProxyPrefs::CONFIG_UNSET && |
| 348 !pref_config_.Equals(new_config))) { | 350 !pref_config_.Equals(new_config))) { |
| 349 config_state_ = config_state; | 351 config_state_ = config_state; |
| 350 if (config_state_ != ProxyPrefs::CONFIG_UNSET) | 352 if (config_state_ != ProxyPrefs::CONFIG_UNSET) |
| 351 pref_config_ = new_config; | 353 pref_config_ = new_config; |
| 352 update_pending_ = true; | 354 update_pending_ = true; |
| 353 } | 355 } |
| 354 if (update_pending_) | 356 if (update_pending_) |
| 355 OnProxyConfigChanged(config_state, new_config); | 357 OnProxyConfigChanged(config_state, new_config); |
| 356 } | 358 } |
| OLD | NEW |