| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/i18n/time_formatting.h" | 8 #include "base/i18n/time_formatting.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 modules, | 84 modules, |
| 85 chrome::kCryptoModulePasswordListCerts, | 85 chrome::kCryptoModulePasswordListCerts, |
| 86 net::HostPortPair(), // unused. | 86 net::HostPortPair(), // unused. |
| 87 NULL, // TODO(mattm): supply parent window. | 87 NULL, // TODO(mattm): supply parent window. |
| 88 base::Bind(&CertificateManagerModel::RefreshSlotsUnlocked, | 88 base::Bind(&CertificateManagerModel::RefreshSlotsUnlocked, |
| 89 base::Unretained(this))); | 89 base::Unretained(this))); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void CertificateManagerModel::RefreshSlotsUnlocked() { | 92 void CertificateManagerModel::RefreshSlotsUnlocked() { |
| 93 DVLOG(1) << "refresh listing certs..."; | 93 DVLOG(1) << "refresh listing certs..."; |
| 94 cert_db_->ListCerts(&cert_list_); | 94 cert_db_->ListCertsSync(&cert_list_); |
| 95 observer_->CertificatesRefreshed(); | 95 observer_->CertificatesRefreshed(); |
| 96 DVLOG(1) << "refresh finished"; | 96 DVLOG(1) << "refresh finished"; |
| 97 } | 97 } |
| 98 | 98 |
| 99 void CertificateManagerModel::FilterAndBuildOrgGroupingMap( | 99 void CertificateManagerModel::FilterAndBuildOrgGroupingMap( |
| 100 net::CertType filter_type, | 100 net::CertType filter_type, |
| 101 CertificateManagerModel::OrgGroupingMap* map) const { | 101 CertificateManagerModel::OrgGroupingMap* map) const { |
| 102 for (net::CertificateList::const_iterator i = cert_list_.begin(); | 102 for (net::CertificateList::const_iterator i = cert_list_.begin(); |
| 103 i != cert_list_.end(); ++i) { | 103 i != cert_list_.end(); ++i) { |
| 104 net::X509Certificate* cert = i->get(); | 104 net::X509Certificate* cert = i->get(); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 const CreationCallback& callback) { | 244 const CreationCallback& callback) { |
| 245 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 245 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 246 net::NSSCertDatabase* cert_db = GetNSSCertDatabaseForResourceContext( | 246 net::NSSCertDatabase* cert_db = GetNSSCertDatabaseForResourceContext( |
| 247 context, | 247 context, |
| 248 base::Bind(&CertificateManagerModel::DidGetCertDBOnIOThread, | 248 base::Bind(&CertificateManagerModel::DidGetCertDBOnIOThread, |
| 249 observer, | 249 observer, |
| 250 callback)); | 250 callback)); |
| 251 if (cert_db) | 251 if (cert_db) |
| 252 DidGetCertDBOnIOThread(observer, callback, cert_db); | 252 DidGetCertDBOnIOThread(observer, callback, cert_db); |
| 253 } | 253 } |
| OLD | NEW |