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

Side by Side Diff: chrome/browser/ui/views/tab_modal_confirm_dialog_views.cc

Issue 18179004: Dismiss action in tab modal dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make the tests pass with GTK and Cocoa Created 7 years, 5 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 "chrome/browser/ui/views/tab_modal_confirm_dialog_views.h" 5 #include "chrome/browser/ui/views/tab_modal_confirm_dialog_views.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/ui/browser_dialogs.h" 8 #include "chrome/browser/ui/browser_dialogs.h"
9 #include "chrome/browser/ui/browser_list.h" 9 #include "chrome/browser/ui/browser_list.h"
10 #include "chrome/browser/ui/browser_window.h" 10 #include "chrome/browser/ui/browser_window.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 string16 TabModalConfirmDialogViews::GetDialogButtonLabel( 103 string16 TabModalConfirmDialogViews::GetDialogButtonLabel(
104 ui::DialogButton button) const { 104 ui::DialogButton button) const {
105 if (button == ui::DIALOG_BUTTON_OK) 105 if (button == ui::DIALOG_BUTTON_OK)
106 return delegate_->GetAcceptButtonTitle(); 106 return delegate_->GetAcceptButtonTitle();
107 if (button == ui::DIALOG_BUTTON_CANCEL) 107 if (button == ui::DIALOG_BUTTON_CANCEL)
108 return delegate_->GetCancelButtonTitle(); 108 return delegate_->GetCancelButtonTitle();
109 return string16(); 109 return string16();
110 } 110 }
111 111
112 bool TabModalConfirmDialogViews::Cancel() { 112 bool TabModalConfirmDialogViews::Cancel() {
113 delegate_->Cancel(); 113 return delegate_->Cancel();
114 return true;
115 } 114 }
116 115
117 bool TabModalConfirmDialogViews::Accept() { 116 bool TabModalConfirmDialogViews::Accept() {
118 delegate_->Accept(); 117 return delegate_->Accept();
119 return true; 118 }
119
120 bool TabModalConfirmDialogViews::Close() {
121 return delegate_->Close();
120 } 122 }
121 123
122 /////////////////////////////////////////////////////////////////////////////// 124 ///////////////////////////////////////////////////////////////////////////////
123 // TabModalConfirmDialogViews, views::WidgetDelegate implementation: 125 // TabModalConfirmDialogViews, views::WidgetDelegate implementation:
124 126
125 views::View* TabModalConfirmDialogViews::GetContentsView() { 127 views::View* TabModalConfirmDialogViews::GetContentsView() {
126 return message_box_view_; 128 return message_box_view_;
127 } 129 }
128 130
129 // TODO(wittman): Remove this override once we move to the new style frame view 131 // TODO(wittman): Remove this override once we move to the new style frame view
(...skipping 15 matching lines...) Expand all
145 delete this; 147 delete this;
146 } 148 }
147 149
148 ui::ModalType TabModalConfirmDialogViews::GetModalType() const { 150 ui::ModalType TabModalConfirmDialogViews::GetModalType() const {
149 #if defined(USE_ASH) 151 #if defined(USE_ASH)
150 return ui::MODAL_TYPE_CHILD; 152 return ui::MODAL_TYPE_CHILD;
151 #else 153 #else
152 return views::WidgetDelegate::GetModalType(); 154 return views::WidgetDelegate::GetModalType();
153 #endif 155 #endif
154 } 156 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698