| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 string16 TabModalConfirmDialogViews::GetDialogButtonLabel( | 95 string16 TabModalConfirmDialogViews::GetDialogButtonLabel( |
| 96 ui::DialogButton button) const { | 96 ui::DialogButton button) const { |
| 97 if (button == ui::DIALOG_BUTTON_OK) | 97 if (button == ui::DIALOG_BUTTON_OK) |
| 98 return delegate_->GetAcceptButtonTitle(); | 98 return delegate_->GetAcceptButtonTitle(); |
| 99 if (button == ui::DIALOG_BUTTON_CANCEL) | 99 if (button == ui::DIALOG_BUTTON_CANCEL) |
| 100 return delegate_->GetCancelButtonTitle(); | 100 return delegate_->GetCancelButtonTitle(); |
| 101 return string16(); | 101 return string16(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 bool TabModalConfirmDialogViews::Cancel() { | 104 bool TabModalConfirmDialogViews::Cancel() { |
| 105 delegate_->Cancel(); | 105 return delegate_->Cancel(); |
| 106 return true; | 106 } |
| 107 |
| 108 bool TabModalConfirmDialogViews::Dismiss() { |
| 109 return delegate_->Dismissed(); |
| 107 } | 110 } |
| 108 | 111 |
| 109 bool TabModalConfirmDialogViews::Accept() { | 112 bool TabModalConfirmDialogViews::Accept() { |
| 110 delegate_->Accept(); | 113 return delegate_->Accept(); |
| 111 return true; | |
| 112 } | 114 } |
| 113 | 115 |
| 114 /////////////////////////////////////////////////////////////////////////////// | 116 /////////////////////////////////////////////////////////////////////////////// |
| 115 // TabModalConfirmDialogViews, views::WidgetDelegate implementation: | 117 // TabModalConfirmDialogViews, views::WidgetDelegate implementation: |
| 116 | 118 |
| 117 views::View* TabModalConfirmDialogViews::GetContentsView() { | 119 views::View* TabModalConfirmDialogViews::GetContentsView() { |
| 118 return message_box_view_; | 120 return message_box_view_; |
| 119 } | 121 } |
| 120 | 122 |
| 121 // TODO(wittman): Remove this override once we move to the new style frame view | 123 // TODO(wittman): Remove this override once we move to the new style frame view |
| (...skipping 15 matching lines...) Expand all Loading... |
| 137 delete this; | 139 delete this; |
| 138 } | 140 } |
| 139 | 141 |
| 140 ui::ModalType TabModalConfirmDialogViews::GetModalType() const { | 142 ui::ModalType TabModalConfirmDialogViews::GetModalType() const { |
| 141 #if defined(USE_ASH) | 143 #if defined(USE_ASH) |
| 142 return ui::MODAL_TYPE_CHILD; | 144 return ui::MODAL_TYPE_CHILD; |
| 143 #else | 145 #else |
| 144 return views::WidgetDelegate::GetModalType(); | 146 return views::WidgetDelegate::GetModalType(); |
| 145 #endif | 147 #endif |
| 146 } | 148 } |
| OLD | NEW |