diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-09 21:59:04 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-09 21:59:04 +0000 |
commit | 4b917eb1d25ac97513749d5120bb4d405da60a1c (patch) | |
tree | 8a732cf756566f0a0b450268f916e4a07f1c547e /chrome | |
parent | a1278b327e9e7bea3191b2a1744c7f6713737c6c (diff) | |
download | chromium_src-4b917eb1d25ac97513749d5120bb4d405da60a1c.zip chromium_src-4b917eb1d25ac97513749d5120bb4d405da60a1c.tar.gz chromium_src-4b917eb1d25ac97513749d5120bb4d405da60a1c.tar.bz2 |
Change the download UI not to report xx bytes of 0 bytes. Just report "xx bytes" instead, so this does not require additional translations.
BUG=9782
Review URL: http://codereview.chromium.org/67005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13467 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/dom_ui/downloads_ui.cc | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/chrome/browser/dom_ui/downloads_ui.cc b/chrome/browser/dom_ui/downloads_ui.cc index ddd3ee2..cd3ac91 100644 --- a/chrome/browser/dom_ui/downloads_ui.cc +++ b/chrome/browser/dom_ui/downloads_ui.cc @@ -475,17 +475,20 @@ std::wstring DownloadsDOMHandler::GetProgressStatusText( received_size.assign(amount_localized); } - amount_units = GetByteDisplayUnits(total); - std::wstring total_text = FormatBytes(total, amount_units, true); - std::wstring total_text_localized; - if (l10n_util::AdjustStringForLocaleDirection(total_text, - &total_text_localized)) - total_text.assign(total_text_localized); - - amount = l10n_util::GetStringF(IDS_DOWNLOAD_TAB_PROGRESS_SIZE, - received_size, - total_text); - + if (total) { + amount_units = GetByteDisplayUnits(total); + std::wstring total_text = FormatBytes(total, amount_units, true); + std::wstring total_text_localized; + if (l10n_util::AdjustStringForLocaleDirection(total_text, + &total_text_localized)) + total_text.assign(total_text_localized); + + amount = l10n_util::GetStringF(IDS_DOWNLOAD_TAB_PROGRESS_SIZE, + received_size, + total_text); + } else { + amount.assign(received_size); + } amount_units = GetByteDisplayUnits(download->CurrentSpeed()); std::wstring speed_text = FormatSpeed(download->CurrentSpeed(), amount_units, true); |