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

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

Issue 1686433002: Remove DialogDelegate::OnClosed() which is redundant with (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 4 years, 10 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_client_view.cc
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc
index 569944542f94a7623b6c4c9f96f84cc393728a72..473ebc6dda7cb58eed067bbb81d5a2bee5b125dd 100644
--- a/ui/views/window/dialog_client_view.cc
+++ b/ui/views/window/dialog_client_view.cc
@@ -57,27 +57,19 @@ DialogClientView::DialogClientView(Widget* owner, View* contents_view)
ok_button_(NULL),
cancel_button_(NULL),
extra_view_(NULL),
- footnote_view_(NULL),
- notified_delegate_(false) {
-}
+ footnote_view_(NULL) {}
DialogClientView::~DialogClientView() {
}
void DialogClientView::AcceptWindow() {
- // Only notify the delegate once. See |notified_delegate_|'s comment.
- if (!notified_delegate_ && GetDialogDelegate()->Accept(false)) {
- notified_delegate_ = true;
+ if (GetDialogDelegate()->Accept(false))
Close();
- }
}
void DialogClientView::CancelWindow() {
- // Only notify the delegate once. See |notified_delegate_|'s comment.
- if (!notified_delegate_ && GetDialogDelegate()->Cancel()) {
- notified_delegate_ = true;
+ if (GetDialogDelegate()->Cancel())
Close();
- }
}
void DialogClientView::UpdateDialogButtons() {
@@ -122,17 +114,9 @@ void DialogClientView::UpdateDialogButtons() {
// DialogClientView, ClientView overrides:
bool DialogClientView::CanClose() {
- if (notified_delegate_)
- return true;
-
// The dialog is closing but no Accept or Cancel action has been performed
// before: it's a Close action.
- if (GetDialogDelegate()->Close()) {
- notified_delegate_ = true;
- GetDialogDelegate()->OnClosed();
- return true;
- }
- return false;
+ return GetDialogDelegate()->Close();
}
DialogClientView* DialogClientView::AsDialogClientView() {
@@ -293,8 +277,7 @@ DialogClientView::DialogClientView(View* contents_view)
ok_button_(NULL),
cancel_button_(NULL),
extra_view_(NULL),
- footnote_view_(NULL),
- notified_delegate_(false) {}
+ footnote_view_(NULL) {}
DialogDelegate* DialogClientView::GetDialogDelegate() const {
return GetWidget()->widget_delegate()->AsDialogDelegate();
@@ -377,7 +360,6 @@ gfx::Insets DialogClientView::GetButtonRowInsets() const {
void DialogClientView::Close() {
GetWidget()->Close();
- GetDialogDelegate()->OnClosed();
}
} // namespace views

Powered by Google App Engine
This is Rietveld 408576698