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

Side by Side Diff: chromeos/network/managed_network_configuration_handler_impl.cc

Issue 1085993002: Revert of Use networkingPrivate.startConnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_430115_internet_options_cellular
Patch Set: Created 5 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
« no previous file with comments | « chromeos/dbus/fake_shill_service_client.cc ('k') | chromeos/network/network_state.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/managed_network_configuration_handler_impl.h" 5 #include "chromeos/network/managed_network_configuration_handler_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/guid.h" 10 #include "base/guid.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 // TODO(pneubeck): add a conversion of user configured entries of old 157 // TODO(pneubeck): add a conversion of user configured entries of old
158 // ChromeOS versions. We will have to use a heuristic to determine which 158 // ChromeOS versions. We will have to use a heuristic to determine which
159 // properties _might_ be user configured. 159 // properties _might_ be user configured.
160 } 160 }
161 161
162 std::string guid; 162 std::string guid;
163 shill_properties->GetStringWithoutPathExpansion(shill::kGuidProperty, &guid); 163 shill_properties->GetStringWithoutPathExpansion(shill::kGuidProperty, &guid);
164 164
165 ::onc::ONCSource onc_source; 165 ::onc::ONCSource onc_source;
166 FindPolicyByGUID(userhash, guid, &onc_source); 166 FindPolicyByGUID(userhash, guid, &onc_source);
167 const NetworkState* network_state =
168 network_state_handler_->GetNetworkState(service_path);
169 scoped_ptr<base::DictionaryValue> active_settings( 167 scoped_ptr<base::DictionaryValue> active_settings(
170 onc::TranslateShillServiceToONCPart(*shill_properties, onc_source, 168 onc::TranslateShillServiceToONCPart(
171 &onc::kNetworkWithStateSignature, 169 *shill_properties, onc_source, &onc::kNetworkWithStateSignature));
172 network_state));
173 170
174 const base::DictionaryValue* network_policy = NULL; 171 const base::DictionaryValue* network_policy = NULL;
175 const base::DictionaryValue* global_policy = NULL; 172 const base::DictionaryValue* global_policy = NULL;
176 if (profile) { 173 if (profile) {
177 const Policies* policies = GetPoliciesForProfile(*profile); 174 const Policies* policies = GetPoliciesForProfile(*profile);
178 if (!policies) { 175 if (!policies) {
179 InvokeErrorCallback( 176 InvokeErrorCallback(
180 service_path, error_callback, kPoliciesNotInitialized); 177 service_path, error_callback, kPoliciesNotInitialized);
181 return; 178 return;
182 } 179 }
(...skipping 26 matching lines...) Expand all
209 base::Bind(&ManagedNetworkConfigurationHandlerImpl::SendProperties, 206 base::Bind(&ManagedNetworkConfigurationHandlerImpl::SendProperties,
210 weak_ptr_factory_.GetWeakPtr(), callback, error_callback)), 207 weak_ptr_factory_.GetWeakPtr(), callback, error_callback)),
211 error_callback); 208 error_callback);
212 } 209 }
213 210
214 void ManagedNetworkConfigurationHandlerImpl::SendProperties( 211 void ManagedNetworkConfigurationHandlerImpl::SendProperties(
215 const network_handler::DictionaryResultCallback& callback, 212 const network_handler::DictionaryResultCallback& callback,
216 const network_handler::ErrorCallback& error_callback, 213 const network_handler::ErrorCallback& error_callback,
217 const std::string& service_path, 214 const std::string& service_path,
218 scoped_ptr<base::DictionaryValue> shill_properties) { 215 scoped_ptr<base::DictionaryValue> shill_properties) {
219 const NetworkState* network_state =
220 network_state_handler_->GetNetworkState(service_path);
221 scoped_ptr<base::DictionaryValue> onc_network( 216 scoped_ptr<base::DictionaryValue> onc_network(
222 onc::TranslateShillServiceToONCPart( 217 onc::TranslateShillServiceToONCPart(
223 *shill_properties, ::onc::ONC_SOURCE_UNKNOWN, 218 *shill_properties, ::onc::ONC_SOURCE_UNKNOWN,
224 &onc::kNetworkWithStateSignature, network_state)); 219 &onc::kNetworkWithStateSignature));
225 callback.Run(service_path, *onc_network); 220 callback.Run(service_path, *onc_network);
226 } 221 }
227 222
228 // SetProperties 223 // SetProperties
229 224
230 void ManagedNetworkConfigurationHandlerImpl::SetProperties( 225 void ManagedNetworkConfigurationHandlerImpl::SetProperties(
231 const std::string& service_path, 226 const std::string& service_path,
232 const base::DictionaryValue& user_settings, 227 const base::DictionaryValue& user_settings,
233 const base::Closure& callback, 228 const base::Closure& callback,
234 const network_handler::ErrorCallback& error_callback) { 229 const network_handler::ErrorCallback& error_callback) {
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 scoped_ptr<base::DictionaryValue> network_properties, 828 scoped_ptr<base::DictionaryValue> network_properties,
834 GetDevicePropertiesCallback send_callback, 829 GetDevicePropertiesCallback send_callback,
835 const std::string& error_name, 830 const std::string& error_name,
836 scoped_ptr<base::DictionaryValue> error_data) { 831 scoped_ptr<base::DictionaryValue> error_data) {
837 NET_LOG_ERROR("Error getting device properties", service_path); 832 NET_LOG_ERROR("Error getting device properties", service_path);
838 send_callback.Run(service_path, network_properties.Pass()); 833 send_callback.Run(service_path, network_properties.Pass());
839 } 834 }
840 835
841 836
842 } // namespace chromeos 837 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_shill_service_client.cc ('k') | chromeos/network/network_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698