diff options
-rw-r--r-- | chrome/app/generated_resources.grd | 17 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 29 |
2 files changed, 37 insertions, 9 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 81d38e4..02e753b 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -1605,13 +1605,22 @@ each locale. --> </message> <!-- Remove in-progress downloads confirmation dialog --> - <message name="IDS_DOWNLOAD_REMOVE_CONFIRM_TITLE" desc="Title of the dialog asking for user confirmation to close the browser when downloads are in-progress."> - You have <ph name="DOWNLOAD_COUNT">$1<ex>3</ex></ph> download(s) in progress. If you close Google Chrome now, these downloads will be canceled. + <message name="IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_TITLE" desc="Title of the dialog asking for user confirmation to close the browser when one download is in-progress."> + You have one download in progress. If you close Google Chrome now, this download will be canceled. </message> - <message name="IDS_DOWNLOAD_REMOVE_CONFIRM_OK_BUTTON_LABEL" desc="Button text for OKing to close the browser when downloads are in-progress."> + <message name="IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_TITLE" desc="Title of the dialog asking for user confirmation to close the browser when multiple downloads are in-progress."> + You have <ph name="DOWNLOAD_COUNT">$1<ex>3</ex></ph> downloads in progress. If you close Google Chrome now, these downloads will be canceled. + </message> + <message name="IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_OK_BUTTON_LABEL" desc="Button text for OKing to close the browser when a single download is in-progress."> + Close and cancel download + </message> + <message name="IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_OK_BUTTON_LABEL" desc="Button text for OKing to close the browser when multiple downloads are in-progress."> Close and cancel downloads </message> - <message name="IDS_DOWNLOAD_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL" desc="Button text for canceling the closing of the browser when downloads are in-progress."> + <message name="IDS_SINGLE_DOWNLOAD_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL" desc="Button text for canceling the closing of the browser when a single download is in-progress."> + Wait for download to finish + </message> + <message name="IDS_MULTIPLE_DOWNLOADS_REMOVE_CONFIRM_CANCEL_BUTTON_LABEL" desc="Button text for canceling the closing of the browser when downloads are in-progress."> Wait for downloads to finish </message> 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); }; |