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 "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 Loading... |
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 Loading... |
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 } |
OLD | NEW |