Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Unified Diff: content/browser/certificate_manager_model.cc

Issue 6580058: NSS: Unlock crypto devices when populating cert manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review changes Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/certificate_manager_model.cc
diff --git a/content/browser/certificate_manager_model.cc b/content/browser/certificate_manager_model.cc
index c1660b63ed5e7a39ec37e0dbd03ac59d617ec602..e7b1daf73cb5fb30038479b5dee5a83bc5bf3d89 100644
--- a/content/browser/certificate_manager_model.cc
+++ b/content/browser/certificate_manager_model.cc
@@ -7,7 +7,9 @@
#include "base/i18n/time_formatting.h"
#include "base/logging.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/ui/crypto_module_password_dialog.h"
#include "chrome/common/net/x509_certificate_model.h"
+#include "net/base/crypto_module.h"
#include "net/base/net_errors.h"
#include "net/base/x509_certificate.h"
@@ -20,6 +22,19 @@ CertificateManagerModel::~CertificateManagerModel() {
void CertificateManagerModel::Refresh() {
VLOG(1) << "refresh started";
+ net::CryptoModuleList modules;
+ cert_db_.ListModules(&modules, false);
+ VLOG(1) << "refresh waiting for unlocking...";
+ browser::UnlockSlotsIfNecessary(
+ modules,
+ browser::kCryptoModulePasswordListCerts,
+ "", // unused.
+ NewCallback(this,
+ &CertificateManagerModel::RefreshSlotsUnlocked));
+}
+
+void CertificateManagerModel::RefreshSlotsUnlocked() {
+ VLOG(1) << "refresh listing certs...";
cert_db_.ListCerts(&cert_list_);
observer_->CertificatesRefreshed();
VLOG(1) << "refresh finished";

Powered by Google App Engine
This is Rietveld 408576698