| 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 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::GetDefaultInsets())); |
| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 return message_box_view_->GetWidget(); | 138 return message_box_view_->GetWidget(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 const views::Widget* TabModalConfirmDialogViews::GetWidget() const { | 141 const views::Widget* TabModalConfirmDialogViews::GetWidget() const { |
| 142 return message_box_view_->GetWidget(); | 142 return message_box_view_->GetWidget(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void TabModalConfirmDialogViews::DeleteDelegate() { | 145 void TabModalConfirmDialogViews::DeleteDelegate() { |
| 146 delete this; | 146 delete this; |
| 147 } | 147 } |
| OLD | NEW |