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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::RegisterUserPrefs( |
207 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(prefs::kProxy, | 209 pref_service->RegisterDictionaryPref( |
210 default_settings, | 210 prefs::kProxy, |
211 PrefRegistrySyncable::UNSYNCABLE_PREF); | 211 default_settings, |
| 212 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
212 } | 213 } |
213 | 214 |
214 ProxyPrefs::ConfigState PrefProxyConfigTrackerImpl::GetProxyConfig( | 215 ProxyPrefs::ConfigState PrefProxyConfigTrackerImpl::GetProxyConfig( |
215 net::ProxyConfig* config) { | 216 net::ProxyConfig* config) { |
216 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 217 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
217 if (config_state_ != ProxyPrefs::CONFIG_UNSET) | 218 if (config_state_ != ProxyPrefs::CONFIG_UNSET) |
218 *config = pref_config_; | 219 *config = pref_config_; |
219 return config_state_; | 220 return config_state_; |
220 } | 221 } |
221 | 222 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 config_state = ProxyPrefs::CONFIG_EXTENSION; | 338 config_state = ProxyPrefs::CONFIG_EXTENSION; |
338 else | 339 else |
339 config_state = ProxyPrefs::CONFIG_OTHER_PRECEDE; | 340 config_state = ProxyPrefs::CONFIG_OTHER_PRECEDE; |
340 } else { | 341 } else { |
341 config_state = ProxyPrefs::CONFIG_FALLBACK; | 342 config_state = ProxyPrefs::CONFIG_FALLBACK; |
342 } | 343 } |
343 } | 344 } |
344 | 345 |
345 return config_state; | 346 return config_state; |
346 } | 347 } |
OLD | NEW |