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

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

Issue 2559783003: Don't treat Esc like Cancel in the external protocol dialog on Views. (Closed)
Patch Set: Add comment Created 4 years 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
« no previous file with comments | « chrome/browser/ui/views/external_protocol_dialog.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/external_protocol_dialog.cc
diff --git a/chrome/browser/ui/views/external_protocol_dialog.cc b/chrome/browser/ui/views/external_protocol_dialog.cc
index 60b15cfe11a6d74359538c3ba7d8d6f4818a6058..1cfc6c81bc2e221940b17399f9486d9d55ab15a2 100644
--- a/chrome/browser/ui/views/external_protocol_dialog.cc
+++ b/chrome/browser/ui/views/external_protocol_dialog.cc
@@ -74,10 +74,6 @@ void ExternalProtocolDialog::DeleteDelegate() {
}
bool ExternalProtocolDialog::Cancel() {
- // We also get called back here if the user closes the dialog or presses
- // escape. In these cases it would be preferable to ignore the state of the
- // check box but MessageBox doesn't distinguish this from pressing the cancel
- // button.
delegate_->DoCancel(delegate_->url(),
message_box_view_->IsCheckBoxSelected());
@@ -105,6 +101,15 @@ bool ExternalProtocolDialog::Accept() {
return true;
}
+bool ExternalProtocolDialog::Close() {
+ // If the user dismisses the dialog without interacting with the buttons (e.g.
+ // via pressing Esc or the X), act as though they cancelled the request, but
+ // ignore the checkbox state. This ensures that if they check the checkbox but
+ // dismiss the dialog, we don't stop prompting them forever.
+ delegate_->DoCancel(delegate_->url(), false);
+ return true;
+}
+
views::View* ExternalProtocolDialog::GetContentsView() {
return message_box_view_;
}
« no previous file with comments | « chrome/browser/ui/views/external_protocol_dialog.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698