| 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/download/download_in_progress_dialog_view.h" | 5 #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "chrome/browser/ui/browser_dialogs.h" |
| 10 #include "chrome/grit/chromium_strings.h" | 11 #include "chrome/grit/chromium_strings.h" |
| 11 #include "chrome/grit/generated_resources.h" | 12 #include "chrome/grit/generated_resources.h" |
| 12 #include "components/constrained_window/constrained_window_views.h" | 13 #include "components/constrained_window/constrained_window_views.h" |
| 13 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
| 14 #include "ui/gfx/geometry/size.h" | 15 #include "ui/gfx/geometry/size.h" |
| 15 #include "ui/views/border.h" | 16 #include "ui/views/border.h" |
| 16 #include "ui/views/controls/message_box_view.h" | 17 #include "ui/views/controls/message_box_view.h" |
| 17 #include "ui/views/layout/grid_layout.h" | 18 #include "ui/views/layout/grid_layout.h" |
| 18 #include "ui/views/widget/widget.h" | 19 #include "ui/views/widget/widget.h" |
| 19 | 20 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 47 download_count)); | 48 download_count)); |
| 48 title_text_ = l10n_util::GetPluralStringFUTF16( | 49 title_text_ = l10n_util::GetPluralStringFUTF16( |
| 49 IDS_DOWNLOAD_REMOVE_CONFIRM_TITLE, download_count); | 50 IDS_DOWNLOAD_REMOVE_CONFIRM_TITLE, download_count); |
| 50 ok_button_text_ = l10n_util::GetPluralStringFUTF16( | 51 ok_button_text_ = l10n_util::GetPluralStringFUTF16( |
| 51 IDS_DOWNLOAD_REMOVE_CONFIRM_OK_BUTTON_LABEL, download_count); | 52 IDS_DOWNLOAD_REMOVE_CONFIRM_OK_BUTTON_LABEL, download_count); |
| 52 cancel_button_text_ = l10n_util::GetPluralStringFUTF16( | 53 cancel_button_text_ = l10n_util::GetPluralStringFUTF16( |
| 53 IDS_DOWNLOAD_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL, download_count); | 54 IDS_DOWNLOAD_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL, download_count); |
| 54 | 55 |
| 55 message_box_view_ = new views::MessageBoxView( | 56 message_box_view_ = new views::MessageBoxView( |
| 56 views::MessageBoxView::InitParams(explanation_text)); | 57 views::MessageBoxView::InitParams(explanation_text)); |
| 58 chrome::RecordDialogCreation(chrome::DialogIdentifier::DOWNLOAD_IN_PROGRESS); |
| 57 } | 59 } |
| 58 | 60 |
| 59 DownloadInProgressDialogView::~DownloadInProgressDialogView() {} | 61 DownloadInProgressDialogView::~DownloadInProgressDialogView() {} |
| 60 | 62 |
| 61 int DownloadInProgressDialogView::GetDefaultDialogButton() const { | 63 int DownloadInProgressDialogView::GetDefaultDialogButton() const { |
| 62 return ui::DIALOG_BUTTON_CANCEL; | 64 return ui::DIALOG_BUTTON_CANCEL; |
| 63 } | 65 } |
| 64 | 66 |
| 65 base::string16 DownloadInProgressDialogView::GetDialogButtonLabel( | 67 base::string16 DownloadInProgressDialogView::GetDialogButtonLabel( |
| 66 ui::DialogButton button) const { | 68 ui::DialogButton button) const { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 94 return message_box_view_->GetWidget(); | 96 return message_box_view_->GetWidget(); |
| 95 } | 97 } |
| 96 | 98 |
| 97 const views::Widget* DownloadInProgressDialogView::GetWidget() const { | 99 const views::Widget* DownloadInProgressDialogView::GetWidget() const { |
| 98 return message_box_view_->GetWidget(); | 100 return message_box_view_->GetWidget(); |
| 99 } | 101 } |
| 100 | 102 |
| 101 views::View* DownloadInProgressDialogView::GetContentsView() { | 103 views::View* DownloadInProgressDialogView::GetContentsView() { |
| 102 return message_box_view_; | 104 return message_box_view_; |
| 103 } | 105 } |
| OLD | NEW |