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" |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
732 properties->SetWithoutPathExpansion(shill::kIPConfigsProperty, ip_configs); | 732 properties->SetWithoutPathExpansion(shill::kIPConfigsProperty, ip_configs); |
733 } | 733 } |
734 | 734 |
735 void ManagedNetworkConfigurationHandlerImpl::GetPropertiesCallback( | 735 void ManagedNetworkConfigurationHandlerImpl::GetPropertiesCallback( |
736 GetDevicePropertiesCallback send_callback, | 736 GetDevicePropertiesCallback send_callback, |
737 const std::string& service_path, | 737 const std::string& service_path, |
738 const base::DictionaryValue& shill_properties) { | 738 const base::DictionaryValue& shill_properties) { |
739 scoped_ptr<base::DictionaryValue> shill_properties_copy( | 739 scoped_ptr<base::DictionaryValue> shill_properties_copy( |
740 shill_properties.DeepCopy()); | 740 shill_properties.DeepCopy()); |
741 | 741 |
742 std::string guid; | |
743 shill_properties.GetStringWithoutPathExpansion(shill::kGuidProperty, &guid); | |
744 if (guid.empty()) { | |
745 // Unmanaged networks are assigned a GUID in NetworkState. Provide this | |
746 // value in the ONC dictionary. | |
747 const NetworkState* state = | |
748 network_state_handler_->GetNetworkState(service_path); | |
749 if (state && !state->guid().empty()) { | |
750 guid = state->guid(); | |
pneubeck (no reviews)
2015/01/14 17:47:10
nit: inlining this is clearer as the original valu
stevenjb
2015/01/14 18:07:44
I'm not sure I agree. Currently guid is unused, bu
pneubeck (no reviews)
2015/01/15 09:45:12
sounds ok.
| |
751 shill_properties_copy->SetStringWithoutPathExpansion(shill::kGuidProperty, | |
752 guid); | |
753 } else { | |
754 LOG(ERROR) << "Network has no GUID specified: " << service_path; | |
755 } | |
756 } | |
757 | |
758 | |
742 std::string type; | 759 std::string type; |
743 shill_properties_copy->GetStringWithoutPathExpansion(shill::kTypeProperty, | 760 shill_properties_copy->GetStringWithoutPathExpansion(shill::kTypeProperty, |
744 &type); | 761 &type); |
745 // Add associated DeviceState properties for non-VPN networks. | 762 // Add associated DeviceState properties for non-VPN networks. |
746 if (type != shill::kTypeVPN) | 763 if (type != shill::kTypeVPN) |
747 GetDeviceStateProperties(service_path, shill_properties_copy.get()); | 764 GetDeviceStateProperties(service_path, shill_properties_copy.get()); |
748 | 765 |
749 // Only request additional Device properties for Cellular networks with a | 766 // Only request additional Device properties for Cellular networks with a |
750 // valid device. | 767 // valid device. |
751 std::string device_path; | 768 std::string device_path; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
795 scoped_ptr<base::DictionaryValue> network_properties, | 812 scoped_ptr<base::DictionaryValue> network_properties, |
796 GetDevicePropertiesCallback send_callback, | 813 GetDevicePropertiesCallback send_callback, |
797 const std::string& error_name, | 814 const std::string& error_name, |
798 scoped_ptr<base::DictionaryValue> error_data) { | 815 scoped_ptr<base::DictionaryValue> error_data) { |
799 NET_LOG_ERROR("Error getting device properties", service_path); | 816 NET_LOG_ERROR("Error getting device properties", service_path); |
800 send_callback.Run(service_path, network_properties.Pass()); | 817 send_callback.Run(service_path, network_properties.Pass()); |
801 } | 818 } |
802 | 819 |
803 | 820 |
804 } // namespace chromeos | 821 } // namespace chromeos |
OLD | NEW |