| OLD | NEW |
| 1 // Copyright (c) 2011 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/utf_string_conversions.h" | 7 #include "base/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" |
| 11 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 11 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 26 } // namespace browser | 26 } // namespace browser |
| 27 | 27 |
| 28 ////////////////////////////////////////////////////////////////////////////// | 28 ////////////////////////////////////////////////////////////////////////////// |
| 29 // TabModalConfirmDialogViews, constructor & destructor: | 29 // TabModalConfirmDialogViews, constructor & destructor: |
| 30 | 30 |
| 31 TabModalConfirmDialogViews::TabModalConfirmDialogViews( | 31 TabModalConfirmDialogViews::TabModalConfirmDialogViews( |
| 32 TabModalConfirmDialogDelegate* delegate, | 32 TabModalConfirmDialogDelegate* delegate, |
| 33 TabContentsWrapper* wrapper) | 33 TabContentsWrapper* wrapper) |
| 34 : delegate_(delegate), | 34 : delegate_(delegate), |
| 35 message_box_view_(new views::MessageBoxView( | 35 message_box_view_(new views::MessageBoxView( |
| 36 views::MessageBoxView::NO_OPTIONS, | 36 views::MessageBoxView::InitParams(delegate->GetMessage()))) { |
| 37 delegate->GetMessage(), | |
| 38 string16())) { | |
| 39 delegate_->set_window(new ConstrainedWindowViews(wrapper, this)); | 37 delegate_->set_window(new ConstrainedWindowViews(wrapper, this)); |
| 40 } | 38 } |
| 41 | 39 |
| 42 TabModalConfirmDialogViews::~TabModalConfirmDialogViews() { | 40 TabModalConfirmDialogViews::~TabModalConfirmDialogViews() { |
| 43 } | 41 } |
| 44 | 42 |
| 45 ////////////////////////////////////////////////////////////////////////////// | 43 ////////////////////////////////////////////////////////////////////////////// |
| 46 // TabModalConfirmDialogViews, views::DialogDelegate implementation: | 44 // TabModalConfirmDialogViews, views::DialogDelegate implementation: |
| 47 | 45 |
| 48 string16 TabModalConfirmDialogViews::GetWindowTitle() const { | 46 string16 TabModalConfirmDialogViews::GetWindowTitle() const { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 79 return message_box_view_->GetWidget(); | 77 return message_box_view_->GetWidget(); |
| 80 } | 78 } |
| 81 | 79 |
| 82 const views::Widget* TabModalConfirmDialogViews::GetWidget() const { | 80 const views::Widget* TabModalConfirmDialogViews::GetWidget() const { |
| 83 return message_box_view_->GetWidget(); | 81 return message_box_view_->GetWidget(); |
| 84 } | 82 } |
| 85 | 83 |
| 86 void TabModalConfirmDialogViews::DeleteDelegate() { | 84 void TabModalConfirmDialogViews::DeleteDelegate() { |
| 87 delete this; | 85 delete this; |
| 88 } | 86 } |
| OLD | NEW |