| 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 16 matching lines...) Expand all Loading... |
| 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 views::MessageBoxView::InitParams init_params(delegate->GetDialogMessage()); | 34 views::MessageBoxView::InitParams init_params(delegate->GetDialogMessage()); |
| 35 init_params.inter_row_vertical_spacing = | 35 init_params.inter_row_vertical_spacing = |
| 36 ChromeLayoutProvider::Get()->GetDistanceMetric( | 36 ChromeLayoutProvider::Get()->GetDistanceMetric( |
| 37 DISTANCE_UNRELATED_CONTROL_VERTICAL); | 37 views::DISTANCE_UNRELATED_CONTROL_VERTICAL); |
| 38 message_box_view_ = new views::MessageBoxView(init_params); | 38 message_box_view_ = new views::MessageBoxView(init_params); |
| 39 | 39 |
| 40 base::string16 link_text(delegate->GetLinkText()); | 40 base::string16 link_text(delegate->GetLinkText()); |
| 41 if (!link_text.empty()) | 41 if (!link_text.empty()) |
| 42 message_box_view_->SetLink(link_text, this); | 42 message_box_view_->SetLink(link_text, this); |
| 43 | 43 |
| 44 constrained_window::ShowWebModalDialogViews(this, web_contents); | 44 constrained_window::ShowWebModalDialogViews(this, web_contents); |
| 45 delegate_->set_close_delegate(this); | 45 delegate_->set_close_delegate(this); |
| 46 chrome::RecordDialogCreation(chrome::DialogIdentifier::TAB_MODAL_CONFIRM); | 46 chrome::RecordDialogCreation(chrome::DialogIdentifier::TAB_MODAL_CONFIRM); |
| 47 } | 47 } |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 return message_box_view_->GetWidget(); | 115 return message_box_view_->GetWidget(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 void TabModalConfirmDialogViews::DeleteDelegate() { | 118 void TabModalConfirmDialogViews::DeleteDelegate() { |
| 119 delete this; | 119 delete this; |
| 120 } | 120 } |
| 121 | 121 |
| 122 ui::ModalType TabModalConfirmDialogViews::GetModalType() const { | 122 ui::ModalType TabModalConfirmDialogViews::GetModalType() const { |
| 123 return ui::MODAL_TYPE_CHILD; | 123 return ui::MODAL_TYPE_CHILD; |
| 124 } | 124 } |
| OLD | NEW |