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

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: Make the tests pass with GTK and Cocoa Created 7 years, 5 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: ui/views/window/dialog_delegate.cc
diff --git a/ui/views/window/dialog_delegate.cc b/ui/views/window/dialog_delegate.cc
index 265dbbd021291f1002b0cae41a465d52b83c1a4d..de0b13954e86dc6254ad25aefede57aef276473e 100644
--- a/ui/views/window/dialog_delegate.cc
+++ b/ui/views/window/dialog_delegate.cc
@@ -85,6 +85,15 @@ bool DialogDelegate::Accept() {
return true;
}
+bool DialogDelegate::Close() {
+ 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();
}
« chrome/browser/ui/tab_modal_confirm_dialog_delegate.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