Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: chrome/browser/net/pref_proxy_config_tracker_impl.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: WIP, latest changes from kaiwang@ Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/prefs/proxy_config_dictionary.h" 10 #include "chrome/browser/prefs/proxy_config_dictionary.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 *effective_config = net::ProxyConfig::CreateDirect(); 189 *effective_config = net::ProxyConfig::CreateDirect();
190 return net::ProxyConfigService::CONFIG_VALID; 190 return net::ProxyConfigService::CONFIG_VALID;
191 } 191 }
192 192
193 *effective_config_state = ProxyPrefs::CONFIG_SYSTEM; 193 *effective_config_state = ProxyPrefs::CONFIG_SYSTEM;
194 *effective_config = system_config; 194 *effective_config = system_config;
195 return system_availability; 195 return system_availability;
196 } 196 }
197 197
198 // static 198 // static
199 void PrefProxyConfigTrackerImpl::RegisterPrefs(PrefService* pref_service) { 199 void PrefProxyConfigTrackerImpl::RegisterPrefs(
200 PrefServiceSyncable* pref_service) {
200 DictionaryValue* default_settings = ProxyConfigDictionary::CreateSystem(); 201 DictionaryValue* default_settings = ProxyConfigDictionary::CreateSystem();
201 pref_service->RegisterDictionaryPref(prefs::kProxy, 202 pref_service->RegisterDictionaryPref(prefs::kProxy,
202 default_settings, 203 default_settings,
203 PrefService::UNSYNCABLE_PREF); 204 PrefServiceSyncable::UNSYNCABLE_PREF);
204 } 205 }
205 206
206 ProxyPrefs::ConfigState PrefProxyConfigTrackerImpl::GetProxyConfig( 207 ProxyPrefs::ConfigState PrefProxyConfigTrackerImpl::GetProxyConfig(
207 net::ProxyConfig* config) { 208 net::ProxyConfig* config) {
208 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 209 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
209 if (config_state_ != ProxyPrefs::CONFIG_UNSET) 210 if (config_state_ != ProxyPrefs::CONFIG_UNSET)
210 *config = pref_config_; 211 *config = pref_config_;
211 return config_state_; 212 return config_state_;
212 } 213 }
213 214
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 config_state = ProxyPrefs::CONFIG_EXTENSION; 330 config_state = ProxyPrefs::CONFIG_EXTENSION;
330 else 331 else
331 config_state = ProxyPrefs::CONFIG_OTHER_PRECEDE; 332 config_state = ProxyPrefs::CONFIG_OTHER_PRECEDE;
332 } else { 333 } else {
333 config_state = ProxyPrefs::CONFIG_FALLBACK; 334 config_state = ProxyPrefs::CONFIG_FALLBACK;
334 } 335 }
335 } 336 }
336 337
337 return config_state; 338 return config_state;
338 } 339 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698