Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6957)

Unified Diff: chrome/browser/views/frame/browser_view.cc

Issue 119009: Improving the text of the cancel download dialog (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/frame/browser_view.cc
===================================================================
--- chrome/browser/views/frame/browser_view.cc (revision 17319)
+++ chrome/browser/views/frame/browser_view.cc (working copy)
@@ -206,8 +206,25 @@
: 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 @@
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 @@
Browser* browser_;
views::Label* label_;
+ std::wstring ok_button_text_;
+ std::wstring cancel_button_text_;
+
DISALLOW_COPY_AND_ASSIGN(DownloadInProgressConfirmDialogDelegate);
};
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698