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

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

Issue 1978883002: In dialogs & dialog-like bubbles, make the escape button just close the prompt. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: 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..0830efb9e2c4ab2d371cb65f83c816c87997bf43 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,13 @@ 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. (This will be
+ // ignored if there was a previous call to CertificateSelected or
+ // CancelCertificateSelection.)
CertificateSelected(nullptr);
- return true;
+ chrome::CertificateSelector::DeleteDelegate();
}
bool SSLClientCertificateSelector::Accept() {
@@ -80,13 +84,9 @@ 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, abort the request.
CancelCertificateSelection();
- return true;
}
void SSLClientCertificateSelector::Unlocked(net::X509Certificate* cert) {

Powered by Google App Engine
This is Rietveld 408576698