| 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 24 matching lines...) Expand all Loading... |
| 35 init_params.inter_row_vertical_spacing = | 35 init_params.inter_row_vertical_spacing = |
| 36 views::kUnrelatedControlVerticalSpacing; | 36 views::kUnrelatedControlVerticalSpacing; |
| 37 message_box_view_ = new views::MessageBoxView(init_params); | 37 message_box_view_ = new views::MessageBoxView(init_params); |
| 38 | 38 |
| 39 base::string16 link_text(delegate->GetLinkText()); | 39 base::string16 link_text(delegate->GetLinkText()); |
| 40 if (!link_text.empty()) | 40 if (!link_text.empty()) |
| 41 message_box_view_->SetLink(link_text, this); | 41 message_box_view_->SetLink(link_text, this); |
| 42 | 42 |
| 43 constrained_window::ShowWebModalDialogViews(this, web_contents); | 43 constrained_window::ShowWebModalDialogViews(this, web_contents); |
| 44 delegate_->set_close_delegate(this); | 44 delegate_->set_close_delegate(this); |
| 45 chrome::RecordDialogCreation(chrome::DialogIdentifier::TAB_MODAL_CONFIRM); |
| 45 } | 46 } |
| 46 | 47 |
| 47 TabModalConfirmDialogViews::~TabModalConfirmDialogViews() { | 48 TabModalConfirmDialogViews::~TabModalConfirmDialogViews() { |
| 48 } | 49 } |
| 49 | 50 |
| 50 void TabModalConfirmDialogViews::AcceptTabModalDialog() { | 51 void TabModalConfirmDialogViews::AcceptTabModalDialog() { |
| 51 GetDialogClientView()->AcceptWindow(); | 52 GetDialogClientView()->AcceptWindow(); |
| 52 } | 53 } |
| 53 | 54 |
| 54 void TabModalConfirmDialogViews::CancelTabModalDialog() { | 55 void TabModalConfirmDialogViews::CancelTabModalDialog() { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 return message_box_view_->GetWidget(); | 114 return message_box_view_->GetWidget(); |
| 114 } | 115 } |
| 115 | 116 |
| 116 void TabModalConfirmDialogViews::DeleteDelegate() { | 117 void TabModalConfirmDialogViews::DeleteDelegate() { |
| 117 delete this; | 118 delete this; |
| 118 } | 119 } |
| 119 | 120 |
| 120 ui::ModalType TabModalConfirmDialogViews::GetModalType() const { | 121 ui::ModalType TabModalConfirmDialogViews::GetModalType() const { |
| 121 return ui::MODAL_TYPE_CHILD; | 122 return ui::MODAL_TYPE_CHILD; |
| 122 } | 123 } |
| OLD | NEW |