| 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( |
| 32 browser->profile())->GetDownloadManager()->in_progress_count(); |
| 30 | 33 |
| 31 string16 warning_text; | 34 string16 warning_text; |
| 32 string16 explanation_text; | 35 string16 explanation_text; |
| 33 if (download_count == 1) { | 36 if (download_count == 1) { |
| 34 warning_text = l10n_util::GetStringFUTF16( | 37 warning_text = l10n_util::GetStringFUTF16( |
| 35 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_WARNING, | 38 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_WARNING, |
| 36 product_name_); | 39 product_name_); |
| 37 explanation_text = l10n_util::GetStringFUTF16( | 40 explanation_text = l10n_util::GetStringFUTF16( |
| 38 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_EXPLANATION, | 41 IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_EXPLANATION, |
| 39 product_name_); | 42 product_name_); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 return true; | 127 return true; |
| 125 } | 128 } |
| 126 | 129 |
| 127 string16 DownloadInProgressDialogView::GetWindowTitle() const { | 130 string16 DownloadInProgressDialogView::GetWindowTitle() const { |
| 128 return product_name_; | 131 return product_name_; |
| 129 } | 132 } |
| 130 | 133 |
| 131 views::View* DownloadInProgressDialogView::GetContentsView() { | 134 views::View* DownloadInProgressDialogView::GetContentsView() { |
| 132 return this; | 135 return this; |
| 133 } | 136 } |
| OLD | NEW |