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 <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 // Get the hardware MAC address from the DeviceState. | 761 // Get the hardware MAC address from the DeviceState. |
762 if (!device_state->mac_address().empty()) { | 762 if (!device_state->mac_address().empty()) { |
763 properties->SetStringWithoutPathExpansion( | 763 properties->SetStringWithoutPathExpansion( |
764 shill::kAddressProperty, device_state->mac_address()); | 764 shill::kAddressProperty, device_state->mac_address()); |
765 } | 765 } |
766 | 766 |
767 // Convert IPConfig dictionary to a ListValue. | 767 // Convert IPConfig dictionary to a ListValue. |
768 base::ListValue* ip_configs = new base::ListValue; | 768 base::ListValue* ip_configs = new base::ListValue; |
769 for (base::DictionaryValue::Iterator iter(device_state->ip_configs()); | 769 for (base::DictionaryValue::Iterator iter(device_state->ip_configs()); |
770 !iter.IsAtEnd(); iter.Advance()) { | 770 !iter.IsAtEnd(); iter.Advance()) { |
771 ip_configs->Append(iter.value().DeepCopy()); | 771 ip_configs->Append(iter.value().CreateDeepCopy()); |
772 } | 772 } |
773 properties->SetWithoutPathExpansion(shill::kIPConfigsProperty, ip_configs); | 773 properties->SetWithoutPathExpansion(shill::kIPConfigsProperty, ip_configs); |
774 } | 774 } |
775 | 775 |
776 void ManagedNetworkConfigurationHandlerImpl::GetPropertiesCallback( | 776 void ManagedNetworkConfigurationHandlerImpl::GetPropertiesCallback( |
777 GetDevicePropertiesCallback send_callback, | 777 GetDevicePropertiesCallback send_callback, |
778 const std::string& service_path, | 778 const std::string& service_path, |
779 const base::DictionaryValue& shill_properties) { | 779 const base::DictionaryValue& shill_properties) { |
780 std::unique_ptr<base::DictionaryValue> shill_properties_copy( | 780 std::unique_ptr<base::DictionaryValue> shill_properties_copy( |
781 shill_properties.DeepCopy()); | 781 shill_properties.DeepCopy()); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 std::unique_ptr<base::DictionaryValue> network_properties, | 852 std::unique_ptr<base::DictionaryValue> network_properties, |
853 GetDevicePropertiesCallback send_callback, | 853 GetDevicePropertiesCallback send_callback, |
854 const std::string& error_name, | 854 const std::string& error_name, |
855 std::unique_ptr<base::DictionaryValue> error_data) { | 855 std::unique_ptr<base::DictionaryValue> error_data) { |
856 NET_LOG_ERROR("Error getting device properties", service_path); | 856 NET_LOG_ERROR("Error getting device properties", service_path); |
857 send_callback.Run(service_path, std::move(network_properties)); | 857 send_callback.Run(service_path, std::move(network_properties)); |
858 } | 858 } |
859 | 859 |
860 | 860 |
861 } // namespace chromeos | 861 } // namespace chromeos |
OLD | NEW |