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

Unified Diff: chrome/browser/gtk/ssl_client_certificate_selector.cc

Issue 5686002: NSS: PKCS 11 password prompt. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing review comments Created 9 years, 11 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
« no previous file with comments | « chrome/browser/gtk/pk11_password_dialog.cc ('k') | chrome/browser/renderer_host/render_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/ssl_client_certificate_selector.cc
diff --git a/chrome/browser/gtk/ssl_client_certificate_selector.cc b/chrome/browser/gtk/ssl_client_certificate_selector.cc
index edf560a5fe7004f82195f8c51c9d32959ebcac48..1be694b005bce25309334f92298baa552ef2f589 100644
--- a/chrome/browser/gtk/ssl_client_certificate_selector.cc
+++ b/chrome/browser/gtk/ssl_client_certificate_selector.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/gtk/owned_widget_gtk.h"
#include "chrome/browser/ssl/ssl_client_auth_handler.h"
#include "chrome/browser/tab_contents/tab_contents.h"
+#include "chrome/browser/ui/pk11_password_dialog.h"
#include "chrome/common/net/x509_certificate_model.h"
#include "gfx/native_widget_types.h"
#include "grit/generated_resources.h"
@@ -60,6 +61,9 @@ class SSLClientCertificateSelector : public ConstrainedDialogDelegate {
static std::string FormatDetailsText(
net::X509Certificate::OSCertHandle cert);
+ // Callback after unlocking certificate slot.
+ void Unlocked();
+
CHROMEGTK_CALLBACK_0(SSLClientCertificateSelector, void, OnComboBoxChanged);
CHROMEGTK_CALLBACK_0(SSLClientCertificateSelector, void, OnViewClicked);
CHROMEGTK_CALLBACK_0(SSLClientCertificateSelector, void, OnCancelClicked);
@@ -301,6 +305,15 @@ std::string SSLClientCertificateSelector::FormatDetailsText(
return rv;
}
+void SSLClientCertificateSelector::Unlocked() {
+ // TODO(mattm): refactor so we don't need to call GetSelectedCert again.
+ net::X509Certificate* cert = GetSelectedCert();
+ delegate_->CertificateSelected(cert);
+ delegate_ = NULL;
+ DCHECK(window_);
+ window_->CloseConstrainedWindow();
+}
+
void SSLClientCertificateSelector::OnComboBoxChanged(GtkWidget* combo_box) {
int selected = gtk_combo_box_get_active(
GTK_COMBO_BOX(cert_combo_box_));
@@ -328,10 +341,12 @@ void SSLClientCertificateSelector::OnCancelClicked(GtkWidget* button) {
void SSLClientCertificateSelector::OnOkClicked(GtkWidget* button) {
net::X509Certificate* cert = GetSelectedCert();
- delegate_->CertificateSelected(cert);
- delegate_ = NULL;
- DCHECK(window_);
- window_->CloseConstrainedWindow();
+
+ browser::UnlockCertSlotIfNecessary(
+ cert,
+ browser::kPK11PasswordClientAuth,
+ cert_request_info_->host_and_port,
+ NewCallback(this, &SSLClientCertificateSelector::Unlocked));
}
void SSLClientCertificateSelector::OnPromptShown(GtkWidget* widget,
« no previous file with comments | « chrome/browser/gtk/pk11_password_dialog.cc ('k') | chrome/browser/renderer_host/render_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698