summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-18 21:59:31 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-18 21:59:31 +0000
commitc3265d8866e5b0d2c1b129e4da685755a35a84b2 (patch)
tree276afaff1dee110f08bc0e2999dc55ce82e6db95 /chrome/browser/download
parent147af6dcdc20b7162ed186ab18eeced8123ba9a0 (diff)
downloadchromium_src-c3265d8866e5b0d2c1b129e4da685755a35a84b2.zip
chromium_src-c3265d8866e5b0d2c1b129e4da685755a35a84b2.tar.gz
chromium_src-c3265d8866e5b0d2c1b129e4da685755a35a84b2.tar.bz2
Revert "Convert FormatBytes to string16."
This reverts commit r56603. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56608 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download')
-rw-r--r--chrome/browser/download/download_item_model.cc11
-rw-r--r--chrome/browser/download/download_util.cc11
2 files changed, 11 insertions, 11 deletions
diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc
index 48c75ad..c360273 100644
--- a/chrome/browser/download/download_item_model.cc
+++ b/chrome/browser/download/download_item_model.cc
@@ -32,15 +32,17 @@ std::wstring DownloadItemModel::GetStatusText() {
int64 total = download_->total_bytes();
DataUnits amount_units = GetByteDisplayUnits(total);
- const string16 simple_size = FormatBytes(size, amount_units, false);
+ const string16 simple_size = WideToUTF16Hack(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.
- string16 simple_total = base::i18n::GetDisplayStringInLTRDirectionality(
- FormatBytes(total, amount_units, true));
+ string16 simple_total = WideToUTF16Hack(FormatBytes(total, amount_units,
+ true));
+ simple_total = base::i18n::GetDisplayStringInLTRDirectionality(simple_total);
TimeDelta remaining;
string16 simple_time;
@@ -69,7 +71,8 @@ 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) :
- FormatBytes(size, GetByteDisplayUnits(size), true);
+ WideToUTF16Hack(FormatBytes(size, GetByteDisplayUnits(size),
+ true));
} else {
status_text = l10n_util::GetStringFUTF16(
IDS_DOWNLOAD_STATUS_IN_PROGRESS, simple_size, simple_total,
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index e7f75c9..e76bf6e 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -591,8 +591,7 @@ std::wstring GetProgressStatusText(DownloadItem* download) {
int64 total = download->total_bytes();
int64 size = download->received_bytes();
DataUnits amount_units = GetByteDisplayUnits(size);
- std::wstring received_size = UTF16ToWideHack(FormatBytes(size, amount_units,
- true));
+ std::wstring received_size = FormatBytes(size, amount_units, true);
std::wstring amount = received_size;
// Adjust both strings for the locale direction since we don't yet know which
@@ -605,8 +604,7 @@ std::wstring GetProgressStatusText(DownloadItem* download) {
if (total) {
amount_units = GetByteDisplayUnits(total);
- std::wstring total_text =
- UTF16ToWideHack(FormatBytes(total, amount_units, true));
+ std::wstring total_text = FormatBytes(total, amount_units, true);
std::wstring total_text_localized;
if (base::i18n::AdjustStringForLocaleDirection(total_text,
&total_text_localized))
@@ -619,9 +617,8 @@ std::wstring GetProgressStatusText(DownloadItem* download) {
amount.assign(received_size);
}
amount_units = GetByteDisplayUnits(download->CurrentSpeed());
- std::wstring speed_text =
- UTF16ToWideHack(FormatSpeed(download->CurrentSpeed(), amount_units,
- true));
+ std::wstring speed_text = FormatSpeed(download->CurrentSpeed(),
+ amount_units, true);
std::wstring speed_text_localized;
if (base::i18n::AdjustStringForLocaleDirection(speed_text,
&speed_text_localized))