summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/dom_ui/downloads_ui.cc25
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);