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

Side by Side Diff: ui/views/window/dialog_client_view.cc

Issue 1752623004: Remove DialogDelegate::Accept() variant (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 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
« no previous file with comments | « chrome/browser/ui/views/hung_renderer_view.cc ('k') | ui/views/window/dialog_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 ok_button_(NULL), 61 ok_button_(NULL),
62 cancel_button_(NULL), 62 cancel_button_(NULL),
63 extra_view_(NULL), 63 extra_view_(NULL),
64 delegate_allowed_close_(false) {} 64 delegate_allowed_close_(false) {}
65 65
66 DialogClientView::~DialogClientView() { 66 DialogClientView::~DialogClientView() {
67 } 67 }
68 68
69 void DialogClientView::AcceptWindow() { 69 void DialogClientView::AcceptWindow() {
70 // Only notify the delegate once. See |delegate_allowed_close_|'s comment. 70 // Only notify the delegate once. See |delegate_allowed_close_|'s comment.
71 if (!delegate_allowed_close_ && GetDialogDelegate()->Accept(false)) { 71 if (!delegate_allowed_close_ && GetDialogDelegate()->Accept()) {
72 delegate_allowed_close_ = true; 72 delegate_allowed_close_ = true;
73 GetWidget()->Close(); 73 GetWidget()->Close();
74 } 74 }
75 } 75 }
76 76
77 void DialogClientView::CancelWindow() { 77 void DialogClientView::CancelWindow() {
78 // Only notify the delegate once. See |delegate_allowed_close_|'s comment. 78 // Only notify the delegate once. See |delegate_allowed_close_|'s comment.
79 if (!delegate_allowed_close_ && GetDialogDelegate()->Cancel()) { 79 if (!delegate_allowed_close_ && GetDialogDelegate()->Cancel()) {
80 delegate_allowed_close_ = true; 80 delegate_allowed_close_ = true;
81 GetWidget()->Close(); 81 GetWidget()->Close();
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 child_views.end()); 360 child_views.end());
361 361
362 // Setup focus. 362 // Setup focus.
363 for (size_t i = 0; i < child_views.size(); i++) { 363 for (size_t i = 0; i < child_views.size(); i++) {
364 child_views[i]->SetNextFocusableView( 364 child_views[i]->SetNextFocusableView(
365 i + 1 != child_views.size() ? child_views[i + 1] : nullptr); 365 i + 1 != child_views.size() ? child_views[i + 1] : nullptr);
366 } 366 }
367 } 367 }
368 368
369 } // namespace views 369 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/hung_renderer_view.cc ('k') | ui/views/window/dialog_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698