| 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 <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 const network_handler::ErrorCallback& error_callback) { | 351 const network_handler::ErrorCallback& error_callback) { |
| 352 network_configuration_handler_->SetShillProperties( | 352 network_configuration_handler_->SetShillProperties( |
| 353 service_path, *shill_dictionary, | 353 service_path, *shill_dictionary, |
| 354 NetworkConfigurationObserver::SOURCE_USER_ACTION, callback, | 354 NetworkConfigurationObserver::SOURCE_USER_ACTION, callback, |
| 355 error_callback); | 355 error_callback); |
| 356 } | 356 } |
| 357 | 357 |
| 358 void ManagedNetworkConfigurationHandlerImpl::CreateConfiguration( | 358 void ManagedNetworkConfigurationHandlerImpl::CreateConfiguration( |
| 359 const std::string& userhash, | 359 const std::string& userhash, |
| 360 const base::DictionaryValue& properties, | 360 const base::DictionaryValue& properties, |
| 361 const network_handler::StringResultCallback& callback, | 361 const network_handler::ServiceResultCallback& callback, |
| 362 const network_handler::ErrorCallback& error_callback) const { | 362 const network_handler::ErrorCallback& error_callback) const { |
| 363 const Policies* policies = GetPoliciesForUser(userhash); | 363 const Policies* policies = GetPoliciesForUser(userhash); |
| 364 if (!policies) { | 364 if (!policies) { |
| 365 InvokeErrorCallback("", error_callback, kPoliciesNotInitialized); | 365 InvokeErrorCallback("", error_callback, kPoliciesNotInitialized); |
| 366 return; | 366 return; |
| 367 } | 367 } |
| 368 | 368 |
| 369 if (policy_util::FindMatchingPolicy(policies->per_network_config, | 369 if (policy_util::FindMatchingPolicy(policies->per_network_config, |
| 370 properties)) { | 370 properties)) { |
| 371 InvokeErrorCallback("", error_callback, kNetworkAlreadyConfigured); | 371 InvokeErrorCallback("", error_callback, kNetworkAlreadyConfigured); |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 ProhibitedTechnologiesHandler* prohibited_technologies_handler) { | 728 ProhibitedTechnologiesHandler* prohibited_technologies_handler) { |
| 729 network_state_handler_ = network_state_handler; | 729 network_state_handler_ = network_state_handler; |
| 730 network_profile_handler_ = network_profile_handler; | 730 network_profile_handler_ = network_profile_handler; |
| 731 network_configuration_handler_ = network_configuration_handler; | 731 network_configuration_handler_ = network_configuration_handler; |
| 732 network_device_handler_ = network_device_handler; | 732 network_device_handler_ = network_device_handler; |
| 733 network_profile_handler_->AddObserver(this); | 733 network_profile_handler_->AddObserver(this); |
| 734 prohibited_technologies_handler_ = prohibited_technologies_handler; | 734 prohibited_technologies_handler_ = prohibited_technologies_handler; |
| 735 } | 735 } |
| 736 | 736 |
| 737 void ManagedNetworkConfigurationHandlerImpl::OnPolicyAppliedToNetwork( | 737 void ManagedNetworkConfigurationHandlerImpl::OnPolicyAppliedToNetwork( |
| 738 const std::string& service_path) { | 738 const std::string& service_path, |
| 739 const std::string& guid) { |
| 739 if (service_path.empty()) | 740 if (service_path.empty()) |
| 740 return; | 741 return; |
| 741 FOR_EACH_OBSERVER( | 742 FOR_EACH_OBSERVER( |
| 742 NetworkPolicyObserver, observers_, PolicyAppliedToNetwork(service_path)); | 743 NetworkPolicyObserver, observers_, PolicyAppliedToNetwork(service_path)); |
| 743 } | 744 } |
| 744 | 745 |
| 745 // Get{Managed}Properties helpers | 746 // Get{Managed}Properties helpers |
| 746 | 747 |
| 747 void ManagedNetworkConfigurationHandlerImpl::GetDeviceStateProperties( | 748 void ManagedNetworkConfigurationHandlerImpl::GetDeviceStateProperties( |
| 748 const std::string& service_path, | 749 const std::string& service_path, |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 scoped_ptr<base::DictionaryValue> network_properties, | 861 scoped_ptr<base::DictionaryValue> network_properties, |
| 861 GetDevicePropertiesCallback send_callback, | 862 GetDevicePropertiesCallback send_callback, |
| 862 const std::string& error_name, | 863 const std::string& error_name, |
| 863 scoped_ptr<base::DictionaryValue> error_data) { | 864 scoped_ptr<base::DictionaryValue> error_data) { |
| 864 NET_LOG_ERROR("Error getting device properties", service_path); | 865 NET_LOG_ERROR("Error getting device properties", service_path); |
| 865 send_callback.Run(service_path, std::move(network_properties)); | 866 send_callback.Run(service_path, std::move(network_properties)); |
| 866 } | 867 } |
| 867 | 868 |
| 868 | 869 |
| 869 } // namespace chromeos | 870 } // namespace chromeos |
| OLD | NEW |