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

Unified Diff: chrome/browser/ui/tab_modal_confirm_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: chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
diff --git a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
index d2711dcdaeb19f080e298bd4718923096bcd0e7b..2d865ba6a20b7e77c9261af0543982e3a087bc0a 100644
--- a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
+++ b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
@@ -22,34 +22,45 @@ TabModalConfirmDialogDelegate::~TabModalConfirmDialogDelegate() {
Cancel();
}
-void TabModalConfirmDialogDelegate::Cancel() {
+bool TabModalConfirmDialogDelegate::Cancel() {
if (closing_)
- return;
- // Make sure we won't do anything when |Cancel()| or |Accept()| is called
- // again.
+ return false;
+ // Make sure we won't do anything when another action occurs.
closing_ = true;
OnCanceled();
CloseDialog();
+ return true;
}
-void TabModalConfirmDialogDelegate::Accept() {
+bool TabModalConfirmDialogDelegate::Accept() {
if (closing_)
- return;
- // Make sure we won't do anything when |Cancel()| or |Accept()| is called
- // again.
+ return false;
+ // Make sure we won't do anything when another action occurs.
closing_ = true;
OnAccepted();
CloseDialog();
+ return true;
}
-void TabModalConfirmDialogDelegate::LinkClicked(
+bool TabModalConfirmDialogDelegate::LinkClicked(
WindowOpenDisposition disposition) {
if (closing_)
- return;
+ return false;
// Make sure we won't do anything when another action occurs.
closing_ = true;
OnLinkClicked(disposition);
CloseDialog();
+ return true;
+}
+
+bool TabModalConfirmDialogDelegate::Close() {
+ if (closing_)
+ return false;
+ // Make sure we won't do anything when another action occurs.
+ closing_ = true;
+ OnClosed();
+ CloseDialog();
fdoray 2013/07/24 20:21:07 For Views, calling CloseDialog() in Cancel(), Acce
+ return true;
}
gfx::Image* TabModalConfirmDialogDelegate::GetIcon() {
@@ -86,6 +97,9 @@ void TabModalConfirmDialogDelegate::OnLinkClicked(
WindowOpenDisposition disposition) {
}
+void TabModalConfirmDialogDelegate::OnClosed() {
+}
+
void TabModalConfirmDialogDelegate::CloseDialog() {
if (operations_delegate_)
operations_delegate_->CloseDialog();

Powered by Google App Engine
This is Rietveld 408576698