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

Unified Diff: chrome/browser/download/download_util.cc

Issue 3107021: Convert FormatBytes to string16. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 4 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
Index: chrome/browser/download/download_util.cc
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index f61ac4c78f09a0ef786396512c5bf497cfd3e69f..25c85747af59615c0a8fdb236a1bf550d6cc6a69 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -590,7 +590,8 @@ std::wstring GetProgressStatusText(DownloadItem* download) {
int64 total = download->total_bytes();
int64 size = download->received_bytes();
DataUnits amount_units = GetByteDisplayUnits(size);
- std::wstring received_size = FormatBytes(size, amount_units, true);
+ std::wstring received_size = UTF16ToWideHack(FormatBytes(size, amount_units,
+ true));
std::wstring amount = received_size;
// Adjust both strings for the locale direction since we don't yet know which
@@ -603,7 +604,8 @@ std::wstring GetProgressStatusText(DownloadItem* download) {
if (total) {
amount_units = GetByteDisplayUnits(total);
- std::wstring total_text = FormatBytes(total, amount_units, true);
+ std::wstring total_text =
+ UTF16ToWideHack(FormatBytes(total, amount_units, true));
std::wstring total_text_localized;
if (base::i18n::AdjustStringForLocaleDirection(total_text,
&total_text_localized))
@@ -616,8 +618,9 @@ std::wstring GetProgressStatusText(DownloadItem* download) {
amount.assign(received_size);
}
amount_units = GetByteDisplayUnits(download->CurrentSpeed());
- std::wstring speed_text = FormatSpeed(download->CurrentSpeed(),
- amount_units, true);
+ std::wstring speed_text =
+ UTF16ToWideHack(FormatSpeed(download->CurrentSpeed(), amount_units,
+ true));
std::wstring speed_text_localized;
if (base::i18n::AdjustStringForLocaleDirection(speed_text,
&speed_text_localized))

Powered by Google App Engine
This is Rietveld 408576698