| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ssl_client_certificate_selector.h" | 5 #include "chrome/browser/ssl_client_certificate_selector.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "app/gtk_signal.h" | 12 #include "app/gtk_signal.h" |
| 13 #include "app/l10n_util.h" | 13 #include "app/l10n_util.h" |
| 14 #include "base/i18n/time_formatting.h" | 14 #include "base/i18n/time_formatting.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/nss_util.h" | 16 #include "base/nss_util.h" |
| 17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
| 18 #include "chrome/browser/certificate_viewer.h" | 18 #include "chrome/browser/certificate_viewer.h" |
| 19 #include "chrome/browser/gtk/constrained_window_gtk.h" | 19 #include "chrome/browser/gtk/constrained_window_gtk.h" |
| 20 #include "chrome/browser/gtk/gtk_util.h" | 20 #include "chrome/browser/gtk/gtk_util.h" |
| 21 #include "chrome/browser/gtk/owned_widget_gtk.h" | 21 #include "chrome/browser/gtk/owned_widget_gtk.h" |
| 22 #include "chrome/browser/ssl/ssl_client_auth_handler.h" | 22 #include "chrome/browser/ssl/ssl_client_auth_handler.h" |
| 23 #include "chrome/browser/tab_contents/tab_contents.h" | 23 #include "chrome/browser/tab_contents/tab_contents.h" |
| 24 #include "chrome/browser/ui/pk11_password_dialog.h" | 24 #include "chrome/browser/ui/crypto_module_password_dialog.h" |
| 25 #include "chrome/common/net/x509_certificate_model.h" | 25 #include "chrome/common/net/x509_certificate_model.h" |
| 26 #include "gfx/native_widget_types.h" | 26 #include "gfx/native_widget_types.h" |
| 27 #include "grit/generated_resources.h" | 27 #include "grit/generated_resources.h" |
| 28 #include "net/base/x509_certificate.h" | 28 #include "net/base/x509_certificate.h" |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 enum { | 32 enum { |
| 33 RESPONSE_SHOW_CERT_INFO = 1, | 33 RESPONSE_SHOW_CERT_INFO = 1, |
| 34 }; | 34 }; |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 delegate_ = NULL; | 337 delegate_ = NULL; |
| 338 DCHECK(window_); | 338 DCHECK(window_); |
| 339 window_->CloseConstrainedWindow(); | 339 window_->CloseConstrainedWindow(); |
| 340 } | 340 } |
| 341 | 341 |
| 342 void SSLClientCertificateSelector::OnOkClicked(GtkWidget* button) { | 342 void SSLClientCertificateSelector::OnOkClicked(GtkWidget* button) { |
| 343 net::X509Certificate* cert = GetSelectedCert(); | 343 net::X509Certificate* cert = GetSelectedCert(); |
| 344 | 344 |
| 345 browser::UnlockCertSlotIfNecessary( | 345 browser::UnlockCertSlotIfNecessary( |
| 346 cert, | 346 cert, |
| 347 browser::kPK11PasswordClientAuth, | 347 browser::kCryptoModulePasswordClientAuth, |
| 348 cert_request_info_->host_and_port, | 348 cert_request_info_->host_and_port, |
| 349 NewCallback(this, &SSLClientCertificateSelector::Unlocked)); | 349 NewCallback(this, &SSLClientCertificateSelector::Unlocked)); |
| 350 } | 350 } |
| 351 | 351 |
| 352 void SSLClientCertificateSelector::OnPromptShown(GtkWidget* widget, | 352 void SSLClientCertificateSelector::OnPromptShown(GtkWidget* widget, |
| 353 GtkWidget* previous_toplevel) { | 353 GtkWidget* previous_toplevel) { |
| 354 if (!root_widget_.get() || | 354 if (!root_widget_.get() || |
| 355 !GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel(root_widget_.get()))) | 355 !GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel(root_widget_.get()))) |
| 356 return; | 356 return; |
| 357 GTK_WIDGET_SET_FLAGS(select_button_, GTK_CAN_DEFAULT); | 357 GTK_WIDGET_SET_FLAGS(select_button_, GTK_CAN_DEFAULT); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 369 void ShowSSLClientCertificateSelector( | 369 void ShowSSLClientCertificateSelector( |
| 370 TabContents* parent, | 370 TabContents* parent, |
| 371 net::SSLCertRequestInfo* cert_request_info, | 371 net::SSLCertRequestInfo* cert_request_info, |
| 372 SSLClientAuthHandler* delegate) { | 372 SSLClientAuthHandler* delegate) { |
| 373 (new SSLClientCertificateSelector(parent, | 373 (new SSLClientCertificateSelector(parent, |
| 374 cert_request_info, | 374 cert_request_info, |
| 375 delegate))->Show(); | 375 delegate))->Show(); |
| 376 } | 376 } |
| 377 | 377 |
| 378 } // namespace browser | 378 } // namespace browser |
| OLD | NEW |