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 "chrome/browser/chromeos/policy/user_network_configuration_updater.h" | 5 #include "chrome/browser/chromeos/policy/user_network_configuration_updater.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 base::Bind( | 134 base::Bind( |
135 &UserNetworkConfigurationUpdater::CreateAndSetCertificateImporter, | 135 &UserNetworkConfigurationUpdater::CreateAndSetCertificateImporter, |
136 weak_factory_.GetWeakPtr())); | 136 weak_factory_.GetWeakPtr())); |
137 } | 137 } |
138 | 138 |
139 void UserNetworkConfigurationUpdater::CreateAndSetCertificateImporter( | 139 void UserNetworkConfigurationUpdater::CreateAndSetCertificateImporter( |
140 net::NSSCertDatabase* database) { | 140 net::NSSCertDatabase* database) { |
141 DCHECK(database); | 141 DCHECK(database); |
142 SetCertificateImporter(std::unique_ptr<chromeos::onc::CertificateImporter>( | 142 SetCertificateImporter(std::unique_ptr<chromeos::onc::CertificateImporter>( |
143 new chromeos::onc::CertificateImporterImpl( | 143 new chromeos::onc::CertificateImporterImpl( |
144 content::BrowserThread::GetMessageLoopProxyForThread( | 144 content::BrowserThread::GetTaskRunnerForThread( |
145 content::BrowserThread::IO), | 145 content::BrowserThread::IO), |
146 database))); | 146 database))); |
147 } | 147 } |
148 | 148 |
149 void UserNetworkConfigurationUpdater::SetCertificateImporter( | 149 void UserNetworkConfigurationUpdater::SetCertificateImporter( |
150 std::unique_ptr<chromeos::onc::CertificateImporter> certificate_importer) { | 150 std::unique_ptr<chromeos::onc::CertificateImporter> certificate_importer) { |
151 certificate_importer_ = std::move(certificate_importer); | 151 certificate_importer_ = std::move(certificate_importer); |
152 | 152 |
153 if (pending_certificates_onc_) | 153 if (pending_certificates_onc_) |
154 ImportCertificates(*pending_certificates_onc_); | 154 ImportCertificates(*pending_certificates_onc_); |
155 pending_certificates_onc_.reset(); | 155 pending_certificates_onc_.reset(); |
156 } | 156 } |
157 | 157 |
158 void UserNetworkConfigurationUpdater::NotifyTrustAnchorsChanged() { | 158 void UserNetworkConfigurationUpdater::NotifyTrustAnchorsChanged() { |
159 FOR_EACH_OBSERVER(WebTrustedCertsObserver, | 159 FOR_EACH_OBSERVER(WebTrustedCertsObserver, |
160 observer_list_, | 160 observer_list_, |
161 OnTrustAnchorsChanged(web_trust_certs_)); | 161 OnTrustAnchorsChanged(web_trust_certs_)); |
162 } | 162 } |
163 | 163 |
164 } // namespace policy | 164 } // namespace policy |
OLD | NEW |