| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/ui/browser_dialogs.h" | 9 #include "chrome/browser/ui/browser_dialogs.h" |
| 10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // TabModalConfirmDialogViews, constructor & destructor: | 61 // TabModalConfirmDialogViews, constructor & destructor: |
| 62 | 62 |
| 63 TabModalConfirmDialogViews::TabModalConfirmDialogViews( | 63 TabModalConfirmDialogViews::TabModalConfirmDialogViews( |
| 64 TabModalConfirmDialogDelegate* delegate, | 64 TabModalConfirmDialogDelegate* delegate, |
| 65 TabContents* tab_contents, | 65 TabContents* tab_contents, |
| 66 bool enable_chrome_style) | 66 bool enable_chrome_style) |
| 67 : delegate_(delegate), | 67 : delegate_(delegate), |
| 68 message_box_view_(new views::MessageBoxView( | 68 message_box_view_(new views::MessageBoxView( |
| 69 CreateMessageBoxViewInitParams(delegate->GetMessage(), | 69 CreateMessageBoxViewInitParams(delegate->GetMessage(), |
| 70 enable_chrome_style))) { | 70 enable_chrome_style))) { |
| 71 delegate_->set_window(new ConstrainedWindowViews(tab_contents->web_contents(), | 71 delegate_->set_window(new ConstrainedWindowViews( |
| 72 this, | 72 tab_contents->web_contents(), this, enable_chrome_style, |
| 73 enable_chrome_style)); | 73 ConstrainedWindowViews::DEFAULT_INSETS)); |
| 74 } | 74 } |
| 75 | 75 |
| 76 TabModalConfirmDialogViews::~TabModalConfirmDialogViews() { | 76 TabModalConfirmDialogViews::~TabModalConfirmDialogViews() { |
| 77 } | 77 } |
| 78 | 78 |
| 79 void TabModalConfirmDialogViews::AcceptTabModalDialog() { | 79 void TabModalConfirmDialogViews::AcceptTabModalDialog() { |
| 80 GetDialogClientView()->AcceptWindow(); | 80 GetDialogClientView()->AcceptWindow(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void TabModalConfirmDialogViews::CancelTabModalDialog() { | 83 void TabModalConfirmDialogViews::CancelTabModalDialog() { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 return message_box_view_->GetWidget(); | 140 return message_box_view_->GetWidget(); |
| 141 } | 141 } |
| 142 | 142 |
| 143 const views::Widget* TabModalConfirmDialogViews::GetWidget() const { | 143 const views::Widget* TabModalConfirmDialogViews::GetWidget() const { |
| 144 return message_box_view_->GetWidget(); | 144 return message_box_view_->GetWidget(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void TabModalConfirmDialogViews::DeleteDelegate() { | 147 void TabModalConfirmDialogViews::DeleteDelegate() { |
| 148 delete this; | 148 delete this; |
| 149 } | 149 } |
| OLD | NEW |