| OLD | NEW |
| 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 <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/guid.h" | 11 #include "base/guid.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "chromeos/dbus/shill_manager_client.h" | 18 #include "chromeos/dbus/shill_manager_client.h" |
| 19 #include "chromeos/dbus/shill_profile_client.h" | 19 #include "chromeos/dbus/shill_profile_client.h" |
| 20 #include "chromeos/dbus/shill_service_client.h" | 20 #include "chromeos/dbus/shill_service_client.h" |
| 21 #include "chromeos/network/device_state.h" | 21 #include "chromeos/network/device_state.h" |
| 22 #include "chromeos/network/favorite_state.h" | |
| 23 #include "chromeos/network/network_configuration_handler.h" | 22 #include "chromeos/network/network_configuration_handler.h" |
| 24 #include "chromeos/network/network_device_handler.h" | 23 #include "chromeos/network/network_device_handler.h" |
| 25 #include "chromeos/network/network_event_log.h" | 24 #include "chromeos/network/network_event_log.h" |
| 26 #include "chromeos/network/network_policy_observer.h" | 25 #include "chromeos/network/network_policy_observer.h" |
| 27 #include "chromeos/network/network_profile.h" | 26 #include "chromeos/network/network_profile.h" |
| 28 #include "chromeos/network/network_profile_handler.h" | 27 #include "chromeos/network/network_profile_handler.h" |
| 29 #include "chromeos/network/network_state.h" | 28 #include "chromeos/network/network_state.h" |
| 30 #include "chromeos/network/network_state_handler.h" | 29 #include "chromeos/network/network_state_handler.h" |
| 31 #include "chromeos/network/network_ui_data.h" | 30 #include "chromeos/network/network_ui_data.h" |
| 32 #include "chromeos/network/onc/onc_merger.h" | 31 #include "chromeos/network/onc/onc_merger.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 callback.Run(service_path, *onc_network); | 234 callback.Run(service_path, *onc_network); |
| 236 } | 235 } |
| 237 | 236 |
| 238 // SetProperties | 237 // SetProperties |
| 239 | 238 |
| 240 void ManagedNetworkConfigurationHandlerImpl::SetProperties( | 239 void ManagedNetworkConfigurationHandlerImpl::SetProperties( |
| 241 const std::string& service_path, | 240 const std::string& service_path, |
| 242 const base::DictionaryValue& user_settings, | 241 const base::DictionaryValue& user_settings, |
| 243 const base::Closure& callback, | 242 const base::Closure& callback, |
| 244 const network_handler::ErrorCallback& error_callback) const { | 243 const network_handler::ErrorCallback& error_callback) const { |
| 245 const FavoriteState* state = | 244 const NetworkState* state = |
| 246 network_state_handler_->GetFavoriteStateFromServicePath( | 245 network_state_handler_->GetNetworkStateFromServicePath( |
| 247 service_path, true /* configured_only */); | 246 service_path, true /* configured_only */); |
| 248 if (!state) { | 247 if (!state) { |
| 249 InvokeErrorCallback(service_path, error_callback, kUnknownNetwork); | 248 InvokeErrorCallback(service_path, error_callback, kUnknownNetwork); |
| 250 return; | 249 return; |
| 251 } | 250 } |
| 252 | 251 |
| 253 std::string guid = state->guid(); | 252 std::string guid = state->guid(); |
| 254 if (guid.empty()) { | 253 if (guid.empty()) { |
| 255 // TODO(pneubeck): create an initial configuration in this case. As for | 254 // TODO(pneubeck): create an initial configuration in this case. As for |
| 256 // CreateConfiguration, user settings from older ChromeOS versions have to | 255 // CreateConfiguration, user settings from older ChromeOS versions have to |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 scoped_ptr<base::DictionaryValue> network_properties, | 718 scoped_ptr<base::DictionaryValue> network_properties, |
| 720 GetDevicePropertiesCallback send_callback, | 719 GetDevicePropertiesCallback send_callback, |
| 721 const std::string& error_name, | 720 const std::string& error_name, |
| 722 scoped_ptr<base::DictionaryValue> error_data) { | 721 scoped_ptr<base::DictionaryValue> error_data) { |
| 723 NET_LOG_ERROR("Error getting device properties", service_path); | 722 NET_LOG_ERROR("Error getting device properties", service_path); |
| 724 send_callback.Run(service_path, network_properties.Pass()); | 723 send_callback.Run(service_path, network_properties.Pass()); |
| 725 } | 724 } |
| 726 | 725 |
| 727 | 726 |
| 728 } // namespace chromeos | 727 } // namespace chromeos |
| OLD | NEW |