Chromium Code Reviews| Index: chrome/browser/ui/views/ssl_client_certificate_selector.cc |
| diff --git a/chrome/browser/ui/views/ssl_client_certificate_selector.cc b/chrome/browser/ui/views/ssl_client_certificate_selector.cc |
| index 2b429149b46f0efb64d3d8f3a43cd50f53c20d31..50e273706268c0f61ac044666e54e015b5b620b9 100644 |
| --- a/chrome/browser/ui/views/ssl_client_certificate_selector.cc |
| +++ b/chrome/browser/ui/views/ssl_client_certificate_selector.cc |
| @@ -31,10 +31,10 @@ SSLClientCertificateSelector::SSLClientCertificateSelector( |
| : CertificateSelector(cert_request_info->client_certs, web_contents), |
| SSLClientAuthObserver(web_contents->GetBrowserContext(), |
| cert_request_info, |
| - std::move(delegate)) {} |
| + std::move(delegate)), |
| + WebContentsObserver(web_contents) {} |
| -SSLClientCertificateSelector::~SSLClientCertificateSelector() { |
| -} |
| +SSLClientCertificateSelector::~SSLClientCertificateSelector() {} |
| void SSLClientCertificateSelector::Init() { |
| StartObserving(); |
| @@ -53,9 +53,11 @@ void SSLClientCertificateSelector::OnCertSelectedByNotification() { |
| GetWidget()->Close(); |
| } |
| -bool SSLClientCertificateSelector::Cancel() { |
| +void SSLClientCertificateSelector::DeleteDelegate() { |
| + // This is here and not in Cancel() to give WebContentsDestroyed a chance |
| + // to abort instead of proceeding with a null certificate. |
| CertificateSelected(nullptr); |
|
msw
2016/05/10 18:23:32
nit: maybe note that this should have no effect if
Evan Stade
2016/05/10 19:27:35
Done.
|
| - return true; |
| + chrome::CertificateSelector::DeleteDelegate(); |
| } |
| bool SSLClientCertificateSelector::Accept() { |
| @@ -80,13 +82,10 @@ bool SSLClientCertificateSelector::Accept() { |
| return false; |
| } |
| -bool SSLClientCertificateSelector::Close() { |
| - // By default, closing the dialog calls the Cancel method. However, selecting |
| - // cancel in the UI currently continues the request with no certificate, |
| - // remembering the selection. If the dialog is closed by closing the |
| - // containing tab, the request should abort. |
| +void SSLClientCertificateSelector::WebContentsDestroyed() { |
| + // If the dialog is closed by closing the containing tab, the request should |
|
msw
2016/05/10 18:23:32
nit: s/the request should abort/abort the request/
Evan Stade
2016/05/10 19:27:35
Done.
|
| + // abort. |
| CancelCertificateSelection(); |
| - return true; |
| } |
| void SSLClientCertificateSelector::Unlocked(net::X509Certificate* cert) { |