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

Side by Side Diff: chromeos/network/proxy/ui_proxy_config_service.cc

Issue 2785883003: Use unique_ptr<DictionaryValue> in ProxyConfigDictionary (Closed)
Patch Set: Fix compilation Created 3 years, 8 months 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chromeos/network/proxy/ui_proxy_config_service.h" 5 #include "chromeos/network/proxy/ui_proxy_config_service.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility>
8 9
9 #include "base/bind.h" 10 #include "base/bind.h"
10 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
11 #include "base/logging.h" 12 #include "base/logging.h"
12 #include "base/values.h" 13 #include "base/values.h"
13 #include "chromeos/network/network_state.h" 14 #include "chromeos/network/network_state.h"
14 #include "chromeos/network/network_state_handler.h" 15 #include "chromeos/network/network_state_handler.h"
15 #include "chromeos/network/proxy/proxy_config_handler.h" 16 #include "chromeos/network/proxy/proxy_config_handler.h"
16 #include "chromeos/network/proxy/proxy_config_service_impl.h" 17 #include "chromeos/network/proxy/proxy_config_service_impl.h"
17 #include "components/device_event_log/device_event_log.h" 18 #include "components/device_event_log/device_event_log.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 current_ui_network_guid_); 137 current_ui_network_guid_);
137 if (!network || !network->IsInProfile()) { 138 if (!network || !network->IsInProfile()) {
138 NET_LOG(ERROR) << "No configured NetworkState for guid: " 139 NET_LOG(ERROR) << "No configured NetworkState for guid: "
139 << current_ui_network_guid_; 140 << current_ui_network_guid_;
140 return; 141 return;
141 } 142 }
142 143
143 // Store config for this network. 144 // Store config for this network.
144 std::unique_ptr<base::DictionaryValue> proxy_config_value( 145 std::unique_ptr<base::DictionaryValue> proxy_config_value(
145 config.ToPrefProxyConfig()); 146 config.ToPrefProxyConfig());
146 ProxyConfigDictionary proxy_config_dict(proxy_config_value.get());
147 147
148 VLOG(1) << "Set proxy for " << current_ui_network_guid_ << " to " 148 VLOG(1) << "Set proxy for " << current_ui_network_guid_ << " to "
149 << *proxy_config_value; 149 << *proxy_config_value;
150 150
151 ProxyConfigDictionary proxy_config_dict(std::move(proxy_config_value));
151 proxy_config::SetProxyConfigForNetwork(proxy_config_dict, *network); 152 proxy_config::SetProxyConfigForNetwork(proxy_config_dict, *network);
152 current_ui_config_.state = ProxyPrefs::CONFIG_SYSTEM; 153 current_ui_config_.state = ProxyPrefs::CONFIG_SYSTEM;
153 } 154 }
154 155
155 void UIProxyConfigService::DetermineEffectiveConfig( 156 void UIProxyConfigService::DetermineEffectiveConfig(
156 const NetworkState& network) { 157 const NetworkState& network) {
157 DCHECK(local_state_prefs_); 158 DCHECK(local_state_prefs_);
158 159
159 // The pref service to read proxy settings that apply to all networks. 160 // The pref service to read proxy settings that apply to all networks.
160 // Settings from the profile overrule local state. 161 // Settings from the profile overrule local state.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 current_ui_network_guid_); 208 current_ui_network_guid_);
208 if (!network) 209 if (!network)
209 return; 210 return;
210 UpdateFromPrefs(current_ui_network_guid_); 211 UpdateFromPrefs(current_ui_network_guid_);
211 NetworkHandler::Get() 212 NetworkHandler::Get()
212 ->network_state_handler() 213 ->network_state_handler()
213 ->SendUpdateNotificationForNetwork(network->path()); 214 ->SendUpdateNotificationForNetwork(network->path());
214 } 215 }
215 216
216 } // namespace chromeos 217 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698