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

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

Issue 18179004: Dismiss action in tab modal dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test for Mac Created 7 years, 4 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 | « ui/views/window/dialog_delegate.h ('k') | no next file » | 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_delegate.h" 5 #include "ui/views/window/dialog_delegate.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "grit/ui_strings.h" 8 #include "grit/ui_strings.h"
9 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
10 #include "ui/base/ui_base_switches_util.h" 10 #include "ui/base/ui_base_switches_util.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 79
80 bool DialogDelegate::Accept(bool window_closing) { 80 bool DialogDelegate::Accept(bool window_closing) {
81 return Accept(); 81 return Accept();
82 } 82 }
83 83
84 bool DialogDelegate::Accept() { 84 bool DialogDelegate::Accept() {
85 return true; 85 return true;
86 } 86 }
87 87
88 bool DialogDelegate::Close() {
89 int buttons = GetDialogButtons();
90 if ((buttons & ui::DIALOG_BUTTON_CANCEL) ||
91 (buttons == ui::DIALOG_BUTTON_NONE)) {
92 return Cancel();
93 }
94 return Accept(true);
95 }
96
88 base::string16 DialogDelegate::GetDialogLabel() const { 97 base::string16 DialogDelegate::GetDialogLabel() const {
89 return base::string16(); 98 return base::string16();
90 } 99 }
91 100
92 base::string16 DialogDelegate::GetDialogTitle() const { 101 base::string16 DialogDelegate::GetDialogTitle() const {
93 return GetWindowTitle(); 102 return GetWindowTitle();
94 } 103 }
95 104
96 int DialogDelegate::GetDialogButtons() const { 105 int DialogDelegate::GetDialogButtons() const {
97 return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL; 106 return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 238
230 const Widget* DialogDelegateView::GetWidget() const { 239 const Widget* DialogDelegateView::GetWidget() const {
231 return View::GetWidget(); 240 return View::GetWidget();
232 } 241 }
233 242
234 View* DialogDelegateView::GetContentsView() { 243 View* DialogDelegateView::GetContentsView() {
235 return this; 244 return this;
236 } 245 }
237 246
238 } // namespace views 247 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/window/dialog_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698