| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/chromeos/policy/network_configuration_updater_impl.h" | 5 #include "chrome/browser/chromeos/policy/network_configuration_updater_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 if (policy_value) { | 87 if (policy_value) { |
| 88 if (!policy_value->GetAsString(&onc_blob)) | 88 if (!policy_value->GetAsString(&onc_blob)) |
| 89 LOG(ERROR) << "ONC policy " << policy_key << " is not a string value."; | 89 LOG(ERROR) << "ONC policy " << policy_key << " is not a string value."; |
| 90 } else { | 90 } else { |
| 91 VLOG(2) << "The policy is not set."; | 91 VLOG(2) << "The policy is not set."; |
| 92 } | 92 } |
| 93 VLOG(2) << "The policy contains this ONC: " << onc_blob; | 93 VLOG(2) << "The policy contains this ONC: " << onc_blob; |
| 94 | 94 |
| 95 base::ListValue network_configs; | 95 base::ListValue network_configs; |
| 96 base::ListValue certificates; | 96 base::ListValue certificates; |
| 97 ParseAndValidateOncForImport( | 97 chromeos::onc::ParseAndValidateOncForImport( |
| 98 onc_blob, onc_source, "", &network_configs, &certificates); | 98 onc_blob, onc_source, "", &network_configs, &certificates); |
| 99 | 99 |
| 100 std::string userhash = onc_source == chromeos::onc::ONC_SOURCE_USER_POLICY ? | 100 std::string userhash = onc_source == chromeos::onc::ONC_SOURCE_USER_POLICY ? |
| 101 hashed_username_ : std::string(); | 101 hashed_username_ : std::string(); |
| 102 chromeos::NetworkHandler::Get()->managed_network_configuration_handler()-> | 102 chromeos::NetworkHandler::Get()->managed_network_configuration_handler()-> |
| 103 SetPolicy(onc_source, userhash, network_configs); | 103 SetPolicy(onc_source, userhash, network_configs); |
| 104 | 104 |
| 105 scoped_ptr<net::CertificateList> web_trust_certs(new net::CertificateList); | 105 scoped_ptr<net::CertificateList> web_trust_certs(new net::CertificateList); |
| 106 certificate_handler_->ImportCertificates( | 106 certificate_handler_->ImportCertificates( |
| 107 certificates, onc_source, web_trust_certs.get()); | 107 certificates, onc_source, web_trust_certs.get()); |
| 108 | 108 |
| 109 if (onc_source == chromeos::onc::ONC_SOURCE_USER_POLICY) | 109 if (onc_source == chromeos::onc::ONC_SOURCE_USER_POLICY) |
| 110 SetTrustAnchors(web_trust_certs.Pass()); | 110 SetTrustAnchors(web_trust_certs.Pass()); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace policy | 113 } // namespace policy |
| OLD | NEW |