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

Unified Diff: chrome/browser/download/download_item_model.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
« no previous file with comments | « chrome/browser/diagnostics/recon_diagnostics.cc ('k') | chrome/browser/download/download_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_item_model.cc
diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc
index 8b58751a864890ed563e5c8b2aaed6d650603c37..1098b2a3d60f5ddaafc879fcbe6d075331c1152a 100644
--- a/chrome/browser/download/download_item_model.cc
+++ b/chrome/browser/download/download_item_model.cc
@@ -32,15 +32,15 @@ std::wstring DownloadItemModel::GetStatusText() {
int64 total = download_->total_bytes();
DataUnits amount_units = GetByteDisplayUnits(total);
- const string16 simple_size = WideToUTF16Hack(FormatBytes(size, amount_units,
- false));
+ const string16 simple_size = FormatBytes(size, amount_units, false);
// In RTL locales, we render the text "size/total" in an RTL context. This
// is problematic since a string such as "123/456 MB" is displayed
// as "MB 123/456" because it ends with an LTR run. In order to solve this,
// we mark the total string as an LTR string if the UI layout is
// right-to-left so that the string "456 MB" is treated as an LTR run.
- std::wstring simple_total = FormatBytes(total, amount_units, true);
+ std::wstring simple_total =
+ UTF16ToWide(FormatBytes(total, amount_units, true));
base::i18n::GetDisplayStringInLTRDirectionality(&simple_total);
viettrungluu 2010/08/18 16:15:54 I guess we really should make a string16 version o
TimeDelta remaining;
@@ -70,12 +70,11 @@ std::wstring DownloadItemModel::GetStatusText() {
// Instead of displaying "0 B" we keep the "Starting..." string.
status_text = (size == 0) ?
l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_STARTING) :
- WideToUTF16Hack(FormatBytes(size, GetByteDisplayUnits(size),
- true));
+ FormatBytes(size, GetByteDisplayUnits(size), true);
} else {
status_text = l10n_util::GetStringFUTF16(
IDS_DOWNLOAD_STATUS_IN_PROGRESS, simple_size,
- WideToUTF16Hack(simple_total), simple_time);
+ WideToUTF16(simple_total), simple_time);
}
}
break;
« no previous file with comments | « chrome/browser/diagnostics/recon_diagnostics.cc ('k') | chrome/browser/download/download_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698