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

Unified Diff: ui/views/window/dialog_delegate.cc

Issue 18179004: Dismiss action in tab modal dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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
« ui/views/window/dialog_client_view.cc ('K') | « ui/views/window/dialog_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_delegate.cc
diff --git a/ui/views/window/dialog_delegate.cc b/ui/views/window/dialog_delegate.cc
index f99a3dd8135c7efb87c6dfb4fdde2bbbf52b096f..c23cd6cb9a0af689195e536201be5a9a4386a2ce 100644
--- a/ui/views/window/dialog_delegate.cc
+++ b/ui/views/window/dialog_delegate.cc
@@ -83,6 +83,15 @@ bool DialogDelegate::Accept() {
return true;
}
+bool DialogDelegate::Dismiss() {
+ int buttons = GetDialogButtons();
+ if ((buttons & ui::DIALOG_BUTTON_CANCEL) ||
+ (buttons == ui::DIALOG_BUTTON_NONE)) {
+ return Cancel();
+ }
+ return Accept(true);
+}
+
base::string16 DialogDelegate::GetDialogLabel() const {
return base::string16();
}
« ui/views/window/dialog_client_view.cc ('K') | « ui/views/window/dialog_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698