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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 namespace { | 31 namespace { |
32 | 32 |
33 // Writes the proxy config of |network| to |proxy_config|. Set |onc_source| to | 33 // Writes the proxy config of |network| to |proxy_config|. Set |onc_source| to |
34 // the source of this configuration. Returns false if no | 34 // the source of this configuration. Returns false if no |
35 // proxy was configured for this network. | 35 // proxy was configured for this network. |
36 bool GetProxyConfig(const PrefService* profile_prefs, | 36 bool GetProxyConfig(const PrefService* profile_prefs, |
37 const PrefService* local_state_prefs, | 37 const PrefService* local_state_prefs, |
38 const NetworkState& network, | 38 const NetworkState& network, |
39 net::ProxyConfig* proxy_config, | 39 net::ProxyConfig* proxy_config, |
40 ::onc::ONCSource* onc_source) { | 40 ::onc::ONCSource* onc_source) { |
41 scoped_ptr<ProxyConfigDictionary> proxy_dict = | 41 std::unique_ptr<ProxyConfigDictionary> proxy_dict = |
42 proxy_config::GetProxyConfigForNetwork( | 42 proxy_config::GetProxyConfigForNetwork(profile_prefs, local_state_prefs, |
43 profile_prefs, local_state_prefs, network, onc_source); | 43 network, onc_source); |
44 if (!proxy_dict) | 44 if (!proxy_dict) |
45 return false; | 45 return false; |
46 return PrefProxyConfigTrackerImpl::PrefConfigToNetConfig(*proxy_dict, | 46 return PrefProxyConfigTrackerImpl::PrefConfigToNetConfig(*proxy_dict, |
47 proxy_config); | 47 proxy_config); |
48 } | 48 } |
49 | 49 |
50 } // namespace | 50 } // namespace |
51 | 51 |
52 ProxyConfigServiceImpl::ProxyConfigServiceImpl(PrefService* profile_prefs, | 52 ProxyConfigServiceImpl::ProxyConfigServiceImpl(PrefService* profile_prefs, |
53 PrefService* local_state_prefs) | 53 PrefService* local_state_prefs) |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 if (effective_config_state == ProxyPrefs::CONFIG_SYSTEM) | 233 if (effective_config_state == ProxyPrefs::CONFIG_SYSTEM) |
234 effective_config_state = ProxyPrefs::CONFIG_OTHER_PRECEDE; | 234 effective_config_state = ProxyPrefs::CONFIG_OTHER_PRECEDE; |
235 // If config is manual, add rule to bypass local host. | 235 // If config is manual, add rule to bypass local host. |
236 if (effective_config.proxy_rules().type != | 236 if (effective_config.proxy_rules().type != |
237 net::ProxyConfig::ProxyRules::TYPE_NO_RULES) { | 237 net::ProxyConfig::ProxyRules::TYPE_NO_RULES) { |
238 effective_config.proxy_rules().bypass_rules.AddRuleToBypassLocal(); | 238 effective_config.proxy_rules().bypass_rules.AddRuleToBypassLocal(); |
239 } | 239 } |
240 PrefProxyConfigTrackerImpl::OnProxyConfigChanged(effective_config_state, | 240 PrefProxyConfigTrackerImpl::OnProxyConfigChanged(effective_config_state, |
241 effective_config); | 241 effective_config); |
242 if (VLOG_IS_ON(1) && !update_pending()) { // Update was successful. | 242 if (VLOG_IS_ON(1) && !update_pending()) { // Update was successful. |
243 scoped_ptr<base::DictionaryValue> config_dict(effective_config.ToValue()); | 243 std::unique_ptr<base::DictionaryValue> config_dict( |
| 244 effective_config.ToValue()); |
244 VLOG(1) << this << ": Proxy changed: " | 245 VLOG(1) << this << ": Proxy changed: " |
245 << ProxyPrefs::ConfigStateToDebugString(active_config_state_) | 246 << ProxyPrefs::ConfigStateToDebugString(active_config_state_) |
246 << ", " << *config_dict; | 247 << ", " << *config_dict; |
247 } | 248 } |
248 } | 249 } |
249 } | 250 } |
250 | 251 |
251 } // namespace chromeos | 252 } // namespace chromeos |
OLD | NEW |