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_service.h" | 5 #include "chrome/browser/net/pref_proxy_config_service.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
9 #include "chrome/browser/prefs/pref_set_observer.h" | 9 #include "chrome/browser/prefs/pref_set_observer.h" |
10 #include "chrome/browser/prefs/proxy_config_dictionary.h" | 10 #include "chrome/browser/prefs/proxy_config_dictionary.h" |
11 #include "chrome/common/chrome_notification_types.h" | 11 #include "chrome/common/chrome_notification_types.h" |
12 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
14 #include "content/public/browser/notification_details.h" | 14 #include "content/public/browser/notification_details.h" |
15 #include "content/public/browser/notification_source.h" | 15 #include "content/public/browser/notification_source.h" |
16 | 16 |
| 17 using content::BrowserThread; |
| 18 |
17 PrefProxyConfigTracker::PrefProxyConfigTracker(PrefService* pref_service) | 19 PrefProxyConfigTracker::PrefProxyConfigTracker(PrefService* pref_service) |
18 : pref_service_(pref_service) { | 20 : pref_service_(pref_service) { |
19 config_state_ = ReadPrefConfig(&pref_config_); | 21 config_state_ = ReadPrefConfig(&pref_config_); |
20 proxy_prefs_observer_.reset( | 22 proxy_prefs_observer_.reset( |
21 PrefSetObserver::CreateProxyPrefSetObserver(pref_service_, this)); | 23 PrefSetObserver::CreateProxyPrefSetObserver(pref_service_, this)); |
22 } | 24 } |
23 | 25 |
24 PrefProxyConfigTracker::~PrefProxyConfigTracker() { | 26 PrefProxyConfigTracker::~PrefProxyConfigTracker() { |
25 DCHECK(pref_service_ == NULL); | 27 DCHECK(pref_service_ == NULL); |
26 } | 28 } |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 } | 271 } |
270 } | 272 } |
271 | 273 |
272 // static | 274 // static |
273 void PrefProxyConfigService::RegisterPrefs(PrefService* pref_service) { | 275 void PrefProxyConfigService::RegisterPrefs(PrefService* pref_service) { |
274 DictionaryValue* default_settings = ProxyConfigDictionary::CreateSystem(); | 276 DictionaryValue* default_settings = ProxyConfigDictionary::CreateSystem(); |
275 pref_service->RegisterDictionaryPref(prefs::kProxy, | 277 pref_service->RegisterDictionaryPref(prefs::kProxy, |
276 default_settings, | 278 default_settings, |
277 PrefService::UNSYNCABLE_PREF); | 279 PrefService::UNSYNCABLE_PREF); |
278 } | 280 } |
OLD | NEW |