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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 return system_availability; | 196 return system_availability; |
197 } | 197 } |
198 | 198 |
199 // static | 199 // static |
200 void PrefProxyConfigTrackerImpl::RegisterPrefs(PrefRegistrySimple* registry) { | 200 void PrefProxyConfigTrackerImpl::RegisterPrefs(PrefRegistrySimple* registry) { |
201 DictionaryValue* default_settings = ProxyConfigDictionary::CreateSystem(); | 201 DictionaryValue* default_settings = ProxyConfigDictionary::CreateSystem(); |
202 registry->RegisterDictionaryPref(prefs::kProxy, default_settings); | 202 registry->RegisterDictionaryPref(prefs::kProxy, default_settings); |
203 } | 203 } |
204 | 204 |
205 // static | 205 // static |
206 void PrefProxyConfigTrackerImpl::RegisterUserPrefs( | 206 void PrefProxyConfigTrackerImpl::RegisterProfilePrefs( |
207 user_prefs::PrefRegistrySyncable* pref_service) { | 207 user_prefs::PrefRegistrySyncable* pref_service) { |
208 DictionaryValue* default_settings = ProxyConfigDictionary::CreateSystem(); | 208 DictionaryValue* default_settings = ProxyConfigDictionary::CreateSystem(); |
209 pref_service->RegisterDictionaryPref( | 209 pref_service->RegisterDictionaryPref( |
210 prefs::kProxy, | 210 prefs::kProxy, |
211 default_settings, | 211 default_settings, |
212 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 212 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
213 } | 213 } |
214 | 214 |
215 // static | 215 // static |
216 ProxyPrefs::ConfigState PrefProxyConfigTrackerImpl::ReadPrefConfig( | 216 ProxyPrefs::ConfigState PrefProxyConfigTrackerImpl::ReadPrefConfig( |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 (config_state_ != ProxyPrefs::CONFIG_UNSET && | 341 (config_state_ != ProxyPrefs::CONFIG_UNSET && |
342 !pref_config_.Equals(new_config))) { | 342 !pref_config_.Equals(new_config))) { |
343 config_state_ = config_state; | 343 config_state_ = config_state; |
344 if (config_state_ != ProxyPrefs::CONFIG_UNSET) | 344 if (config_state_ != ProxyPrefs::CONFIG_UNSET) |
345 pref_config_ = new_config; | 345 pref_config_ = new_config; |
346 update_pending_ = true; | 346 update_pending_ = true; |
347 } | 347 } |
348 if (update_pending_) | 348 if (update_pending_) |
349 OnProxyConfigChanged(config_state, new_config); | 349 OnProxyConfigChanged(config_state, new_config); |
350 } | 350 } |
OLD | NEW |