OLD | NEW |
---|---|
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 "ui/events/keycodes/keyboard_codes.h" | 9 #include "ui/events/keycodes/keyboard_codes.h" |
10 #include "ui/views/background.h" | 10 #include "ui/views/background.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
132 // The dialog is closing but no Accept or Cancel action has been performed | 132 // The dialog is closing but no Accept or Cancel action has been performed |
133 // before: it's a Close action. | 133 // before: it's a Close action. |
134 if (GetDialogDelegate()->Close()) { | 134 if (GetDialogDelegate()->Close()) { |
135 notified_delegate_ = true; | 135 notified_delegate_ = true; |
136 GetDialogDelegate()->OnClosed(); | 136 GetDialogDelegate()->OnClosed(); |
137 return true; | 137 return true; |
138 } | 138 } |
139 return false; | 139 return false; |
140 } | 140 } |
141 | 141 |
142 void DialogClientView::WidgetClosing() { | |
143 if (!notified_delegate_) | |
tapted
2014/09/08 07:42:21
do you need `notified_delegate_ = true` here, and
tmdiep
2014/09/08 08:26:08
DialogClientView::Close() is called by AcceptWindo
tapted
2014/09/08 09:28:56
sg - so long as Close() is private/non-virtual I t
| |
144 GetDialogDelegate()->OnClosed(); | |
145 } | |
146 | |
142 DialogClientView* DialogClientView::AsDialogClientView() { | 147 DialogClientView* DialogClientView::AsDialogClientView() { |
143 return this; | 148 return this; |
144 } | 149 } |
145 | 150 |
146 const DialogClientView* DialogClientView::AsDialogClientView() const { | 151 const DialogClientView* DialogClientView::AsDialogClientView() const { |
147 return this; | 152 return this; |
148 } | 153 } |
149 | 154 |
150 void DialogClientView::OnWillChangeFocus(View* focused_before, | 155 void DialogClientView::OnWillChangeFocus(View* focused_before, |
151 View* focused_now) { | 156 View* focused_now) { |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
419 gfx::Insets(0, kButtonHEdgeMarginNew, | 424 gfx::Insets(0, kButtonHEdgeMarginNew, |
420 kButtonVEdgeMarginNew, kButtonHEdgeMarginNew); | 425 kButtonVEdgeMarginNew, kButtonHEdgeMarginNew); |
421 } | 426 } |
422 | 427 |
423 void DialogClientView::Close() { | 428 void DialogClientView::Close() { |
424 GetWidget()->Close(); | 429 GetWidget()->Close(); |
425 GetDialogDelegate()->OnClosed(); | 430 GetDialogDelegate()->OnClosed(); |
426 } | 431 } |
427 | 432 |
428 } // namespace views | 433 } // namespace views |
OLD | NEW |