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/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" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 ////////////////////////////////////////////////////////////////////////////// | 27 ////////////////////////////////////////////////////////////////////////////// |
28 // TabModalConfirmDialogViews, constructor & destructor: | 28 // TabModalConfirmDialogViews, constructor & destructor: |
29 | 29 |
30 TabModalConfirmDialogViews::TabModalConfirmDialogViews( | 30 TabModalConfirmDialogViews::TabModalConfirmDialogViews( |
31 TabModalConfirmDialogDelegate* delegate, | 31 TabModalConfirmDialogDelegate* delegate, |
32 content::WebContents* web_contents) | 32 content::WebContents* web_contents) |
33 : delegate_(delegate), | 33 : delegate_(delegate), |
34 message_box_view_(new views::MessageBoxView( | 34 message_box_view_(new views::MessageBoxView( |
35 views::MessageBoxView::InitParams(delegate->GetMessage()))) { | 35 views::MessageBoxView::InitParams(delegate->GetMessage()))) { |
36 delegate_->set_window(new ConstrainedWindowViews(web_contents, this)); | 36 delegate_->set_window(ConstrainedWindowViews::Create(web_contents, this)); |
37 } | 37 } |
38 | 38 |
39 TabModalConfirmDialogViews::~TabModalConfirmDialogViews() { | 39 TabModalConfirmDialogViews::~TabModalConfirmDialogViews() { |
40 } | 40 } |
41 | 41 |
42 void TabModalConfirmDialogViews::AcceptTabModalDialog() { | 42 void TabModalConfirmDialogViews::AcceptTabModalDialog() { |
43 GetDialogClientView()->AcceptWindow(); | 43 GetDialogClientView()->AcceptWindow(); |
44 } | 44 } |
45 | 45 |
46 void TabModalConfirmDialogViews::CancelTabModalDialog() { | 46 void TabModalConfirmDialogViews::CancelTabModalDialog() { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 delete this; | 92 delete this; |
93 } | 93 } |
94 | 94 |
95 ui::ModalType TabModalConfirmDialogViews::GetModalType() const { | 95 ui::ModalType TabModalConfirmDialogViews::GetModalType() const { |
96 #if defined(USE_ASH) | 96 #if defined(USE_ASH) |
97 return ui::MODAL_TYPE_CHILD; | 97 return ui::MODAL_TYPE_CHILD; |
98 #else | 98 #else |
99 return views::WidgetDelegate::GetModalType(); | 99 return views::WidgetDelegate::GetModalType(); |
100 #endif | 100 #endif |
101 } | 101 } |
OLD | NEW |