summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-18 16:23:18 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-18 16:23:18 +0000
commit70edb8606702fd26565cc46fd3075bfe75f68d97 (patch)
treec2647cc5cd843c5abbc9c90bd6855bd8b0b7c674 /chrome/browser/download
parent05672cafff847dc3beb0e29e1506bee6a5a7447e (diff)
downloadchromium_src-70edb8606702fd26565cc46fd3075bfe75f68d97.zip
chromium_src-70edb8606702fd26565cc46fd3075bfe75f68d97.tar.gz
chromium_src-70edb8606702fd26565cc46fd3075bfe75f68d97.tar.bz2
Convert GetDisplayStringInLTRDirectionality from wstring to string16.
BUG=23581 Review URL: http://codereview.chromium.org/3108027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56535 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download')
-rw-r--r--chrome/browser/download/download_item_model.cc9
-rw-r--r--chrome/browser/download/download_util.cc7
2 files changed, 9 insertions, 7 deletions
diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc
index 8b58751..c360273 100644
--- a/chrome/browser/download/download_item_model.cc
+++ b/chrome/browser/download/download_item_model.cc
@@ -40,8 +40,9 @@ std::wstring DownloadItemModel::GetStatusText() {
// 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);
- base::i18n::GetDisplayStringInLTRDirectionality(&simple_total);
+ string16 simple_total = WideToUTF16Hack(FormatBytes(total, amount_units,
+ true));
+ simple_total = base::i18n::GetDisplayStringInLTRDirectionality(simple_total);
TimeDelta remaining;
string16 simple_time;
@@ -74,8 +75,8 @@ std::wstring DownloadItemModel::GetStatusText() {
true));
} else {
status_text = l10n_util::GetStringFUTF16(
- IDS_DOWNLOAD_STATUS_IN_PROGRESS, simple_size,
- WideToUTF16Hack(simple_total), simple_time);
+ IDS_DOWNLOAD_STATUS_IN_PROGRESS, simple_size, simple_total,
+ simple_time);
}
}
break;
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index f61ac4c..e76bf6e 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -548,9 +548,10 @@ DictionaryValue* CreateDownloadItemValue(DownloadItem* download, int id) {
file_value->SetString("file_path",
WideToUTF16Hack(download->full_path().ToWStringHack()));
// Keep file names as LTR.
- std::wstring file_name = download->GetFileName().ToWStringHack();
- base::i18n::GetDisplayStringInLTRDirectionality(&file_name);
- file_value->SetString("file_name", WideToUTF16Hack(file_name));
+ string16 file_name = WideToUTF16Hack(
+ download->GetFileName().ToWStringHack());
+ file_name = base::i18n::GetDisplayStringInLTRDirectionality(file_name);
+ file_value->SetString("file_name", file_name);
file_value->SetString("url", download->url().spec());
file_value->SetBoolean("otr", download->is_otr());