| 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/ssl/ssl_client_certificate_selector.h" | 5 #include "chrome/browser/ssl/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> |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 } | 357 } |
| 358 | 358 |
| 359 void SSLClientCertificateSelector::OnOkClicked(GtkWidget* button) { | 359 void SSLClientCertificateSelector::OnOkClicked(GtkWidget* button) { |
| 360 net::X509Certificate* cert = GetSelectedCert(); | 360 net::X509Certificate* cert = GetSelectedCert(); |
| 361 | 361 |
| 362 // Remove the observer before we try unlocking, otherwise we might act on a | 362 // Remove the observer before we try unlocking, otherwise we might act on a |
| 363 // notification while waiting for the unlock dialog, causing us to delete | 363 // notification while waiting for the unlock dialog, causing us to delete |
| 364 // ourself before the Unlocked callback gets called. | 364 // ourself before the Unlocked callback gets called. |
| 365 StopObserving(); | 365 StopObserving(); |
| 366 | 366 |
| 367 browser::UnlockCertSlotIfNecessary( | 367 chrome::UnlockCertSlotIfNecessary( |
| 368 cert, | 368 cert, |
| 369 browser::kCryptoModulePasswordClientAuth, | 369 chrome::kCryptoModulePasswordClientAuth, |
| 370 cert_request_info()->host_and_port, | 370 cert_request_info()->host_and_port, |
| 371 base::Bind(&SSLClientCertificateSelector::Unlocked, | 371 base::Bind(&SSLClientCertificateSelector::Unlocked, |
| 372 base::Unretained(this))); | 372 base::Unretained(this))); |
| 373 } | 373 } |
| 374 | 374 |
| 375 void SSLClientCertificateSelector::OnPromptShown(GtkWidget* widget, | 375 void SSLClientCertificateSelector::OnPromptShown(GtkWidget* widget, |
| 376 GtkWidget* previous_toplevel) { | 376 GtkWidget* previous_toplevel) { |
| 377 if (!root_widget_.get() || | 377 if (!root_widget_.get() || |
| 378 !gtk_widget_is_toplevel(gtk_widget_get_toplevel(root_widget_.get()))) | 378 !gtk_widget_is_toplevel(gtk_widget_get_toplevel(root_widget_.get()))) |
| 379 return; | 379 return; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 390 const net::HttpNetworkSession* network_session, | 390 const net::HttpNetworkSession* network_session, |
| 391 net::SSLCertRequestInfo* cert_request_info, | 391 net::SSLCertRequestInfo* cert_request_info, |
| 392 const base::Callback<void(net::X509Certificate*)>& callback) { | 392 const base::Callback<void(net::X509Certificate*)>& callback) { |
| 393 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 393 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 394 TabContents* tab_contents = TabContents::FromWebContents(contents); | 394 TabContents* tab_contents = TabContents::FromWebContents(contents); |
| 395 (new SSLClientCertificateSelector( | 395 (new SSLClientCertificateSelector( |
| 396 tab_contents, network_session, cert_request_info, callback))->Show(); | 396 tab_contents, network_session, cert_request_info, callback))->Show(); |
| 397 } | 397 } |
| 398 | 398 |
| 399 } // namespace chrome | 399 } // namespace chrome |
| OLD | NEW |