| 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 14 matching lines...) Expand all Loading... |
| 25 #include "chromeos/network/network_policy_observer.h" | 25 #include "chromeos/network/network_policy_observer.h" |
| 26 #include "chromeos/network/network_profile.h" | 26 #include "chromeos/network/network_profile.h" |
| 27 #include "chromeos/network/network_profile_handler.h" | 27 #include "chromeos/network/network_profile_handler.h" |
| 28 #include "chromeos/network/network_state.h" | 28 #include "chromeos/network/network_state.h" |
| 29 #include "chromeos/network/network_state_handler.h" | 29 #include "chromeos/network/network_state_handler.h" |
| 30 #include "chromeos/network/network_ui_data.h" | 30 #include "chromeos/network/network_ui_data.h" |
| 31 #include "chromeos/network/network_util.h" | 31 #include "chromeos/network/network_util.h" |
| 32 #include "chromeos/network/onc/onc_merger.h" | 32 #include "chromeos/network/onc/onc_merger.h" |
| 33 #include "chromeos/network/onc/onc_signature.h" | 33 #include "chromeos/network/onc/onc_signature.h" |
| 34 #include "chromeos/network/onc/onc_translator.h" | 34 #include "chromeos/network/onc/onc_translator.h" |
| 35 #include "chromeos/network/onc/onc_utils.h" |
| 35 #include "chromeos/network/onc/onc_validator.h" | 36 #include "chromeos/network/onc/onc_validator.h" |
| 36 #include "chromeos/network/policy_util.h" | 37 #include "chromeos/network/policy_util.h" |
| 37 #include "chromeos/network/shill_property_util.h" | 38 #include "chromeos/network/shill_property_util.h" |
| 38 #include "components/onc/onc_constants.h" | 39 #include "components/onc/onc_constants.h" |
| 39 #include "third_party/cros_system_api/dbus/service_constants.h" | 40 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 40 | 41 |
| 41 namespace chromeos { | 42 namespace chromeos { |
| 42 | 43 |
| 43 namespace { | 44 namespace { |
| 44 | 45 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 false, // Ignore missing fields. | 283 false, // Ignore missing fields. |
| 283 false); // This ONC does not come from policy. | 284 false); // This ONC does not come from policy. |
| 284 | 285 |
| 285 onc::Validator::Result validation_result; | 286 onc::Validator::Result validation_result; |
| 286 scoped_ptr<base::DictionaryValue> validated_user_settings = | 287 scoped_ptr<base::DictionaryValue> validated_user_settings = |
| 287 validator.ValidateAndRepairObject( | 288 validator.ValidateAndRepairObject( |
| 288 &onc::kNetworkConfigurationSignature, | 289 &onc::kNetworkConfigurationSignature, |
| 289 *user_settings_copy, | 290 *user_settings_copy, |
| 290 &validation_result); | 291 &validation_result); |
| 291 | 292 |
| 293 // Fill in HexSSID field from contents of SSID field if not set already. |
| 294 if (user_settings_copy) { |
| 295 onc::FillInHexSSIDFieldsInOncObject( |
| 296 onc::kNetworkConfigurationSignature, validated_user_settings.get()); |
| 297 } |
| 298 |
| 299 |
| 292 if (validation_result == onc::Validator::INVALID) { | 300 if (validation_result == onc::Validator::INVALID) { |
| 293 InvokeErrorCallback(service_path, error_callback, kInvalidUserSettings); | 301 InvokeErrorCallback(service_path, error_callback, kInvalidUserSettings); |
| 294 return; | 302 return; |
| 295 } | 303 } |
| 296 if (validation_result == onc::Validator::VALID_WITH_WARNINGS) | 304 if (validation_result == onc::Validator::VALID_WITH_WARNINGS) |
| 297 LOG(WARNING) << "Validation of ONC user settings produced warnings."; | 305 LOG(WARNING) << "Validation of ONC user settings produced warnings."; |
| 298 | 306 |
| 299 const base::DictionaryValue* network_policy = | 307 const base::DictionaryValue* network_policy = |
| 300 GetByGUID(policies->per_network_config, guid); | 308 GetByGUID(policies->per_network_config, guid); |
| 301 VLOG(2) << "This configuration is " << (network_policy ? "" : "not ") | 309 VLOG(2) << "This configuration is " << (network_policy ? "" : "not ") |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 scoped_ptr<base::DictionaryValue> network_properties, | 796 scoped_ptr<base::DictionaryValue> network_properties, |
| 789 GetDevicePropertiesCallback send_callback, | 797 GetDevicePropertiesCallback send_callback, |
| 790 const std::string& error_name, | 798 const std::string& error_name, |
| 791 scoped_ptr<base::DictionaryValue> error_data) { | 799 scoped_ptr<base::DictionaryValue> error_data) { |
| 792 NET_LOG_ERROR("Error getting device properties", service_path); | 800 NET_LOG_ERROR("Error getting device properties", service_path); |
| 793 send_callback.Run(service_path, network_properties.Pass()); | 801 send_callback.Run(service_path, network_properties.Pass()); |
| 794 } | 802 } |
| 795 | 803 |
| 796 | 804 |
| 797 } // namespace chromeos | 805 } // namespace chromeos |
| OLD | NEW |