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

Side by Side 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: rebase 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/window/dialog_client_view.h" 5 #include "ui/views/window/dialog_client_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "ui/events/keycodes/keyboard_codes.h" 10 #include "ui/events/keycodes/keyboard_codes.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 /////////////////////////////////////////////////////////////////////////////// 121 ///////////////////////////////////////////////////////////////////////////////
122 // DialogClientView, ClientView overrides: 122 // DialogClientView, ClientView overrides:
123 123
124 bool DialogClientView::CanClose() { 124 bool DialogClientView::CanClose() {
125 if (notified_delegate_) 125 if (notified_delegate_)
126 return true; 126 return true;
127 127
128 // The dialog is closing but no Accept or Cancel action has been performed 128 // The dialog is closing but no Accept or Cancel action has been performed
129 // before: it's a Close action. 129 // before: it's a Close action.
130 if (GetDialogDelegate()->Close()) { 130 if (GetDialogDelegate()->Close()) {
131 notified_delegate_ = true; 131 notified_delegate_ = true;
vasilii 2016/02/11 10:37:48 I suspect that you can drop |notified_delegate_|
Evan Stade 2016/02/11 20:02:11 done. I can't repro the original bug on linux beca
132 GetDialogDelegate()->OnClosed();
133 return true; 132 return true;
134 } 133 }
135 return false; 134 return false;
136 } 135 }
137 136
138 DialogClientView* DialogClientView::AsDialogClientView() { 137 DialogClientView* DialogClientView::AsDialogClientView() {
139 return this; 138 return this;
140 } 139 }
141 140
142 const DialogClientView* DialogClientView::AsDialogClientView() const { 141 const DialogClientView* DialogClientView::AsDialogClientView() const {
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 369
371 gfx::Insets DialogClientView::GetButtonRowInsets() const { 370 gfx::Insets DialogClientView::GetButtonRowInsets() const {
372 // NOTE: The insets only apply to the buttons, extra view, and footnote view. 371 // NOTE: The insets only apply to the buttons, extra view, and footnote view.
373 return GetButtonsAndExtraViewRowHeight() == 0 ? gfx::Insets() : 372 return GetButtonsAndExtraViewRowHeight() == 0 ? gfx::Insets() :
374 gfx::Insets(0, kButtonHEdgeMarginNew, 373 gfx::Insets(0, kButtonHEdgeMarginNew,
375 kButtonVEdgeMarginNew, kButtonHEdgeMarginNew); 374 kButtonVEdgeMarginNew, kButtonHEdgeMarginNew);
376 } 375 }
377 376
378 void DialogClientView::Close() { 377 void DialogClientView::Close() {
379 GetWidget()->Close(); 378 GetWidget()->Close();
380 GetDialogDelegate()->OnClosed();
381 } 379 }
382 380
383 } // namespace views 381 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698