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

Unified Diff: chrome/browser/ui/views/ssl_client_certificate_selector.cc

Issue 1953943003: In dialogs & dialog-like bubbles, make the escape button just close (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self review Created 4 years, 7 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: 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) {

Powered by Google App Engine
This is Rietveld 408576698