| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/download/download_service.h" |
| 12 #include "chrome/browser/download/download_service_factory.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 13 #include "content/browser/download/download_manager.h" | 15 #include "content/browser/download/download_manager.h" |
| 14 #include "grit/chromium_strings.h" | 16 #include "grit/chromium_strings.h" |
| 15 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
| 16 #include "grit/locale_settings.h" | 18 #include "grit/locale_settings.h" |
| 17 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
| 18 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
| 19 #include "ui/gfx/size.h" | 21 #include "ui/gfx/size.h" |
| 20 #include "views/border.h" | 22 #include "views/border.h" |
| 21 #include "views/controls/label.h" | 23 #include "views/controls/label.h" |
| 22 #include "views/layout/grid_layout.h" | 24 #include "views/layout/grid_layout.h" |
| 23 #include "views/widget/widget.h" | 25 #include "views/widget/widget.h" |
| 24 | 26 |
| 25 DownloadInProgressDialogView::DownloadInProgressDialogView(Browser* browser) | 27 DownloadInProgressDialogView::DownloadInProgressDialogView(Browser* browser) |
| 26 : browser_(browser), | 28 : browser_(browser), |
| 27 product_name_(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)) { | 29 product_name_(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)) { |
| 28 int download_count = browser->profile()->GetDownloadManager()-> | 30 int download_count = |
| 29 in_progress_count(); | 31 DownloadServiceFactory::GetForProfile(browser->profile())-> |
| 32 GetDownloadManager()-> |
| 33 in_progress_count(); |
| 30 | 34 |
| 31 std::wstring warning_text; | 35 std::wstring warning_text; |
| 32 std::wstring explanation_text; | 36 std::wstring explanation_text; |
| 33 if (download_count == 1) { | 37 if (download_count == 1) { |
| 34 warning_text = UTF16ToWide(l10n_util::GetStringFUTF16( | 38 warning_text = UTF16ToWide(l10n_util::GetStringFUTF16( |
| 35 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_WARNING, | 39 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_WARNING, |
| 36 product_name_)); | 40 product_name_)); |
| 37 explanation_text = UTF16ToWide(l10n_util::GetStringFUTF16( | 41 explanation_text = UTF16ToWide(l10n_util::GetStringFUTF16( |
| 38 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_EXPLANATION, | 42 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_EXPLANATION, |
| 39 product_name_)); | 43 product_name_)); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 return true; | 128 return true; |
| 125 } | 129 } |
| 126 | 130 |
| 127 string16 DownloadInProgressDialogView::GetWindowTitle() const { | 131 string16 DownloadInProgressDialogView::GetWindowTitle() const { |
| 128 return product_name_; | 132 return product_name_; |
| 129 } | 133 } |
| 130 | 134 |
| 131 views::View* DownloadInProgressDialogView::GetContentsView() { | 135 views::View* DownloadInProgressDialogView::GetContentsView() { |
| 132 return this; | 136 return this; |
| 133 } | 137 } |
| OLD | NEW |