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 "chrome/browser/net/pref_proxy_config_tracker_impl.h" | 5 #include "chrome/browser/net/pref_proxy_config_tracker_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/prefs/pref_registry_simple.h" | 8 #include "base/prefs/pref_registry_simple.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 base::DictionaryValue* default_settings = | 205 base::DictionaryValue* default_settings = |
206 ProxyConfigDictionary::CreateSystem(); | 206 ProxyConfigDictionary::CreateSystem(); |
207 registry->RegisterDictionaryPref(prefs::kProxy, default_settings); | 207 registry->RegisterDictionaryPref(prefs::kProxy, default_settings); |
208 } | 208 } |
209 | 209 |
210 // static | 210 // static |
211 void PrefProxyConfigTrackerImpl::RegisterProfilePrefs( | 211 void PrefProxyConfigTrackerImpl::RegisterProfilePrefs( |
212 user_prefs::PrefRegistrySyncable* pref_service) { | 212 user_prefs::PrefRegistrySyncable* pref_service) { |
213 base::DictionaryValue* default_settings = | 213 base::DictionaryValue* default_settings = |
214 ProxyConfigDictionary::CreateSystem(); | 214 ProxyConfigDictionary::CreateSystem(); |
215 pref_service->RegisterDictionaryPref( | 215 pref_service->RegisterDictionaryPref(prefs::kProxy, default_settings); |
216 prefs::kProxy, | |
217 default_settings, | |
218 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
219 } | 216 } |
220 | 217 |
221 // static | 218 // static |
222 ProxyPrefs::ConfigState PrefProxyConfigTrackerImpl::ReadPrefConfig( | 219 ProxyPrefs::ConfigState PrefProxyConfigTrackerImpl::ReadPrefConfig( |
223 const PrefService* pref_service, | 220 const PrefService* pref_service, |
224 net::ProxyConfig* config) { | 221 net::ProxyConfig* config) { |
225 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 222 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
226 | 223 |
227 // Clear the configuration and source. | 224 // Clear the configuration and source. |
228 *config = net::ProxyConfig(); | 225 *config = net::ProxyConfig(); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 (config_state_ != ProxyPrefs::CONFIG_UNSET && | 345 (config_state_ != ProxyPrefs::CONFIG_UNSET && |
349 !pref_config_.Equals(new_config))) { | 346 !pref_config_.Equals(new_config))) { |
350 config_state_ = config_state; | 347 config_state_ = config_state; |
351 if (config_state_ != ProxyPrefs::CONFIG_UNSET) | 348 if (config_state_ != ProxyPrefs::CONFIG_UNSET) |
352 pref_config_ = new_config; | 349 pref_config_ = new_config; |
353 update_pending_ = true; | 350 update_pending_ = true; |
354 } | 351 } |
355 if (update_pending_) | 352 if (update_pending_) |
356 OnProxyConfigChanged(config_state, new_config); | 353 OnProxyConfigChanged(config_state, new_config); |
357 } | 354 } |
OLD | NEW |