| 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/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/prefs/pref_registry_simple.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/browser/prefs/proxy_config_dictionary.h" | 11 #include "chrome/browser/prefs/proxy_config_dictionary.h" |
| 11 #include "chrome/common/chrome_notification_types.h" | 12 #include "chrome/common/chrome_notification_types.h" |
| 12 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
| 13 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 14 #include "content/public/browser/notification_details.h" | 15 #include "content/public/browser/notification_details.h" |
| 15 #include "content/public/browser/notification_source.h" | 16 #include "content/public/browser/notification_source.h" |
| 16 | 17 |
| 17 using content::BrowserThread; | 18 using content::BrowserThread; |
| 18 | 19 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 return net::ProxyConfigService::CONFIG_VALID; | 190 return net::ProxyConfigService::CONFIG_VALID; |
| 190 } | 191 } |
| 191 | 192 |
| 192 *effective_config_state = ProxyPrefs::CONFIG_SYSTEM; | 193 *effective_config_state = ProxyPrefs::CONFIG_SYSTEM; |
| 193 *effective_config = system_config; | 194 *effective_config = system_config; |
| 194 return system_availability; | 195 return system_availability; |
| 195 } | 196 } |
| 196 | 197 |
| 197 // static | 198 // static |
| 198 void PrefProxyConfigTrackerImpl::RegisterPrefs( | 199 void PrefProxyConfigTrackerImpl::RegisterPrefs( |
| 199 PrefServiceSimple* local_state) { | 200 PrefRegistrySimple* local_state) { |
| 200 DictionaryValue* default_settings = ProxyConfigDictionary::CreateSystem(); | 201 DictionaryValue* default_settings = ProxyConfigDictionary::CreateSystem(); |
| 201 local_state->RegisterDictionaryPref(prefs::kProxy, default_settings); | 202 local_state->RegisterDictionaryPref(prefs::kProxy, default_settings); |
| 202 } | 203 } |
| 203 | 204 |
| 204 // static | 205 // static |
| 205 void PrefProxyConfigTrackerImpl::RegisterUserPrefs( | 206 void PrefProxyConfigTrackerImpl::RegisterUserPrefs( |
| 206 PrefServiceSyncable* pref_service) { | 207 PrefServiceSyncable* pref_service) { |
| 207 DictionaryValue* default_settings = ProxyConfigDictionary::CreateSystem(); | 208 DictionaryValue* default_settings = ProxyConfigDictionary::CreateSystem(); |
| 208 pref_service->RegisterDictionaryPref(prefs::kProxy, | 209 pref_service->RegisterDictionaryPref(prefs::kProxy, |
| 209 default_settings, | 210 default_settings, |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 config_state = ProxyPrefs::CONFIG_EXTENSION; | 337 config_state = ProxyPrefs::CONFIG_EXTENSION; |
| 337 else | 338 else |
| 338 config_state = ProxyPrefs::CONFIG_OTHER_PRECEDE; | 339 config_state = ProxyPrefs::CONFIG_OTHER_PRECEDE; |
| 339 } else { | 340 } else { |
| 340 config_state = ProxyPrefs::CONFIG_FALLBACK; | 341 config_state = ProxyPrefs::CONFIG_FALLBACK; |
| 341 } | 342 } |
| 342 } | 343 } |
| 343 | 344 |
| 344 return config_state; | 345 return config_state; |
| 345 } | 346 } |
| OLD | NEW |