summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/frame
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-02 06:09:27 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-02 06:09:27 +0000
commit1997ef8f2173f1382acd68ff5521e3c0ffb9d45d (patch)
tree6f11b10b8d80911869a6b8bce5796adf0e4d4495 /chrome/browser/views/frame
parentf6f60dd8dfc356f4a4029a7e2f2e7550a15ecebd (diff)
downloadchromium_src-1997ef8f2173f1382acd68ff5521e3c0ffb9d45d.zip
chromium_src-1997ef8f2173f1382acd68ff5521e3c0ffb9d45d.tar.gz
chromium_src-1997ef8f2173f1382acd68ff5521e3c0ffb9d45d.tar.bz2
Makes the text of the in-progress download dialog better by special-casing the single download case.
BUG=11278 TEST=Start a big download, close Chrome. A dialog warning that a download is in progress should be shown. Check that the main text and button text use singular when referring to the download. Start several big downloads. Close Chrome, check the text now uses plural. Review URL: http://codereview.chromium.org/119009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17387 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/frame')
-rw-r--r--chrome/browser/views/frame/browser_view.cc29
1 files changed, 24 insertions, 5 deletions
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index e7ffef4..f8f5532 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -206,8 +206,25 @@ class DownloadInProgressConfirmDialogDelegate : public views::DialogDelegate,
: browser_(browser) {
int download_count = browser->profile()->GetDownloadManager()->
in_progress_count();
- label_ = new views::Label(l10n_util::GetStringF(
- IDS_DOWNLOAD_REMOVE_CONFIRM_TITLE, download_count));
+
+ std::wstring label_text;
+ if (download_count == 1) {
+ label_text =
+ l10n_util::GetString(IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_TITLE);
+ ok_button_text_ = l10n_util::GetString(
+ IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_OK_BUTTON_LABEL);
+ cancel_button_text_ = l10n_util::GetString(
+ IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL);
+ } else {
+ label_text =
+ l10n_util::GetStringF(IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_TITLE,
+ download_count);
+ ok_button_text_ = l10n_util::GetString(
+ IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_OK_BUTTON_LABEL);
+ cancel_button_text_ = l10n_util::GetString(
+ IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL);
+ }
+ label_ = new views::Label(label_text);
label_->SetMultiLine(true);
label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
label_->set_border(views::Border::CreateEmptyBorder(10, 10, 10, 10));
@@ -232,11 +249,10 @@ class DownloadInProgressConfirmDialogDelegate : public views::DialogDelegate,
virtual std::wstring GetDialogButtonLabel(
MessageBoxFlags::DialogButton button) const {
if (button == MessageBoxFlags::DIALOGBUTTON_OK)
- return l10n_util::GetString(IDS_DOWNLOAD_REMOVE_CONFIRM_OK_BUTTON_LABEL);
+ return ok_button_text_;
DCHECK_EQ(MessageBoxFlags::DIALOGBUTTON_CANCEL, button);
- return l10n_util::GetString(
- IDS_DOWNLOAD_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL);
+ return cancel_button_text_;
}
virtual bool Accept() {
@@ -264,6 +280,9 @@ class DownloadInProgressConfirmDialogDelegate : public views::DialogDelegate,
Browser* browser_;
views::Label* label_;
+ std::wstring ok_button_text_;
+ std::wstring cancel_button_text_;
+
DISALLOW_COPY_AND_ASSIGN(DownloadInProgressConfirmDialogDelegate);
};