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

Side by Side Diff: chrome/browser/chromeos/proxy_config_service_impl.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for review. 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromeos/proxy_config_service_impl.h" 5 #include "chrome/browser/chromeos/proxy_config_service_impl.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/json/json_string_value_serializer.h" 10 #include "base/json/json_string_value_serializer.h"
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 JSONStringValueSerializer serializer(network->proxy_config()); 573 JSONStringValueSerializer serializer(network->proxy_config());
574 scoped_ptr<Value> value(serializer.Deserialize(NULL, NULL)); 574 scoped_ptr<Value> value(serializer.Deserialize(NULL, NULL));
575 if (!value.get() || value->GetType() != Value::TYPE_DICTIONARY) 575 if (!value.get() || value->GetType() != Value::TYPE_DICTIONARY)
576 return false; 576 return false;
577 ProxyConfigDictionary proxy_dict(static_cast<DictionaryValue*>(value.get())); 577 ProxyConfigDictionary proxy_dict(static_cast<DictionaryValue*>(value.get()));
578 return PrefProxyConfigTrackerImpl::PrefConfigToNetConfig(proxy_dict, 578 return PrefProxyConfigTrackerImpl::PrefConfigToNetConfig(proxy_dict,
579 proxy_config); 579 proxy_config);
580 } 580 }
581 581
582 // static 582 // static
583 void ProxyConfigServiceImpl::RegisterPrefs(PrefService* pref_service) { 583 void ProxyConfigServiceImpl::RegisterPrefs(PrefServiceSimple* pref_service) {
584 // Use shared proxies default to off. GetUseSharedProxies will return the 584 // Use shared proxies default to off. GetUseSharedProxies will return the
585 // correct value based on pre-login and login. 585 // correct value based on pre-login and login.
586 pref_service->RegisterBooleanPref(prefs::kUseSharedProxies, 586 pref_service->RegisterBooleanPref(prefs::kUseSharedProxies, true);
587 true,
588 PrefService::UNSYNCABLE_PREF);
589 } 587 }
590 588
591 //------------------ ProxyConfigServiceImpl: private methods ------------------- 589 //------------------ ProxyConfigServiceImpl: private methods -------------------
592 590
593 void ProxyConfigServiceImpl::OnUseSharedProxiesChanged() { 591 void ProxyConfigServiceImpl::OnUseSharedProxiesChanged() {
594 VLOG(1) << "New use-shared-proxies = " << GetUseSharedProxies(); 592 VLOG(1) << "New use-shared-proxies = " << GetUseSharedProxies();
595 593
596 // Determine new proxy config which may have changed because of new 594 // Determine new proxy config which may have changed because of new
597 // use-shared-proxies. If necessary, activate it. 595 // use-shared-proxies. If necessary, activate it.
598 Network* network = NULL; 596 Network* network = NULL;
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 device_config_.clear(); 838 device_config_.clear();
841 return; 839 return;
842 } 840 }
843 if (!active_network_.empty()) { 841 if (!active_network_.empty()) {
844 VLOG(1) << "Try migrating device config to " << active_network_; 842 VLOG(1) << "Try migrating device config to " << active_network_;
845 SetProxyConfigForNetwork(active_network_, device_config_, true); 843 SetProxyConfigForNetwork(active_network_, device_config_, true);
846 } 844 }
847 } 845 }
848 846
849 } // namespace chromeos 847 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698