| OLD | NEW |
| 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 Loading... |
| 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(PrefServiceSimple* pref_service) { | 583 void ProxyConfigServiceImpl::RegisterPrefs(PrefRegistrarSimple* 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, true); | 586 pref_service->RegisterBooleanPref(prefs::kUseSharedProxies, true); |
| 587 } | 587 } |
| 588 | 588 |
| 589 // static | 589 // static |
| 590 void ProxyConfigServiceImpl::RegisterUserPrefs( | 590 void ProxyConfigServiceImpl::RegisterUserPrefs( |
| 591 PrefServiceSyncable* pref_service) { | 591 PrefServiceSyncable* pref_service) { |
| 592 pref_service->RegisterBooleanPref(prefs::kUseSharedProxies, | 592 pref_service->RegisterBooleanPref(prefs::kUseSharedProxies, |
| 593 true, | 593 true, |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 device_config_.clear(); | 846 device_config_.clear(); |
| 847 return; | 847 return; |
| 848 } | 848 } |
| 849 if (!active_network_.empty()) { | 849 if (!active_network_.empty()) { |
| 850 VLOG(1) << "Try migrating device config to " << active_network_; | 850 VLOG(1) << "Try migrating device config to " << active_network_; |
| 851 SetProxyConfigForNetwork(active_network_, device_config_, true); | 851 SetProxyConfigForNetwork(active_network_, device_config_, true); |
| 852 } | 852 } |
| 853 } | 853 } |
| 854 | 854 |
| 855 } // namespace chromeos | 855 } // namespace chromeos |
| OLD | NEW |