OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/certificate_manager_model.h" | 5 #include "chrome/browser/certificate_manager_model.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 136 |
137 void CertificateManagerModel::RefreshSlotsUnlocked() { | 137 void CertificateManagerModel::RefreshSlotsUnlocked() { |
138 DVLOG(1) << "refresh listing certs..."; | 138 DVLOG(1) << "refresh listing certs..."; |
139 // TODO(tbarzic): Use async |ListCerts|. | 139 // TODO(tbarzic): Use async |ListCerts|. |
140 cert_db_->ListCertsSync(&cert_list_); | 140 cert_db_->ListCertsSync(&cert_list_); |
141 observer_->CertificatesRefreshed(); | 141 observer_->CertificatesRefreshed(); |
142 DVLOG(1) << "refresh finished for platform provided certificates"; | 142 DVLOG(1) << "refresh finished for platform provided certificates"; |
143 } | 143 } |
144 | 144 |
145 void CertificateManagerModel::RefreshExtensionCertificates( | 145 void CertificateManagerModel::RefreshExtensionCertificates( |
146 const net::CertificateList& new_certs) { | 146 net::ClientCertIdentityList new_cert_identities) { |
147 extension_cert_list_ = new_certs; | 147 extension_cert_list_.clear(); |
| 148 for (const auto& identity : new_cert_identities) |
| 149 extension_cert_list_.push_back(identity->certificate()); |
148 observer_->CertificatesRefreshed(); | 150 observer_->CertificatesRefreshed(); |
149 DVLOG(1) << "refresh finished for extension provided certificates"; | 151 DVLOG(1) << "refresh finished for extension provided certificates"; |
150 } | 152 } |
151 | 153 |
152 void CertificateManagerModel::FilterAndBuildOrgGroupingMap( | 154 void CertificateManagerModel::FilterAndBuildOrgGroupingMap( |
153 net::CertType filter_type, | 155 net::CertType filter_type, |
154 CertificateManagerModel::OrgGroupingMap* map) const { | 156 CertificateManagerModel::OrgGroupingMap* map) const { |
155 for (net::CertificateList::const_iterator i = cert_list_.begin(); | 157 for (net::CertificateList::const_iterator i = cert_list_.begin(); |
156 i != cert_list_.end(); ++i) { | 158 i != cert_list_.end(); ++i) { |
157 net::X509Certificate* cert = i->get(); | 159 net::X509Certificate* cert = i->get(); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 net::NSSCertDatabase* cert_db = GetNSSCertDatabaseForResourceContext( | 327 net::NSSCertDatabase* cert_db = GetNSSCertDatabaseForResourceContext( |
326 context, did_get_cert_db_callback); | 328 context, did_get_cert_db_callback); |
327 | 329 |
328 // The callback is run here instead of the actual function call because of | 330 // The callback is run here instead of the actual function call because of |
329 // extension_certificate_provider ownership semantics, ie. ownership can only | 331 // extension_certificate_provider ownership semantics, ie. ownership can only |
330 // be released once. The callback will only be run once (either inside the | 332 // be released once. The callback will only be run once (either inside the |
331 // function above or here). | 333 // function above or here). |
332 if (cert_db) | 334 if (cert_db) |
333 did_get_cert_db_callback.Run(cert_db); | 335 did_get_cert_db_callback.Run(cert_db); |
334 } | 336 } |
OLD | NEW |