summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-20 06:37:01 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-20 06:37:01 +0000
commit7cf1b6ced3b14cce1d66ca0ddc713851f0d37536 (patch)
tree1c2fc9f4d52bf3046addf820d5eec03a2e150749 /chrome/browser/download
parentf9f4841b14a9f309ce5ee613f0d4de6afad88767 (diff)
downloadchromium_src-7cf1b6ced3b14cce1d66ca0ddc713851f0d37536.zip
chromium_src-7cf1b6ced3b14cce1d66ca0ddc713851f0d37536.tar.gz
chromium_src-7cf1b6ced3b14cce1d66ca0ddc713851f0d37536.tar.bz2
Move RTL related functions from app/l10n_util to base/i18n/rtl
TBR=darin BUG=none TEST=none Review URL: http://codereview.chromium.org/1073005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42182 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download')
-rw-r--r--chrome/browser/download/download_item_model.cc5
-rw-r--r--chrome/browser/download/download_util.cc15
2 files changed, 11 insertions, 9 deletions
diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc
index 7371c8c..b69d85f 100644
--- a/chrome/browser/download/download_item_model.cc
+++ b/chrome/browser/download/download_item_model.cc
@@ -6,6 +6,7 @@
#include "app/l10n_util.h"
#include "base/i18n/number_formatting.h"
+#include "base/i18n/rtl.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/download/download_manager.h"
#include "chrome/browser/download/save_package.h"
@@ -38,8 +39,8 @@ std::wstring DownloadItemModel::GetStatusText() {
// 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);
- if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT)
- l10n_util::WrapStringWithLTRFormatting(&simple_total);
+ if (base::i18n::IsRTL())
+ base::i18n::WrapStringWithLTRFormatting(&simple_total);
TimeDelta remaining;
std::wstring simple_time;
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index b839074..b8619e4 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -15,6 +15,7 @@
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/file_util.h"
+#include "base/i18n/rtl.h"
#include "base/i18n/time_formatting.h"
#include "base/path_service.h"
#include "base/singleton.h"
@@ -366,8 +367,8 @@ DictionaryValue* CreateDownloadItemValue(DownloadItem* download, int id) {
file_value->SetString(L"file_path", download->full_path().ToWStringHack());
// Keep file names as LTR.
std::wstring file_name = download->GetFileName().ToWStringHack();
- if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT)
- l10n_util::WrapStringWithLTRFormatting(&file_name);
+ if (base::i18n::IsRTL())
+ base::i18n::WrapStringWithLTRFormatting(&file_name);
file_value->SetString(L"file_name", file_name);
file_value->SetString(L"url", download->url().spec());
file_value->SetBoolean(L"otr", download->is_otr());
@@ -414,7 +415,7 @@ std::wstring GetProgressStatusText(DownloadItem* download) {
// Adjust both strings for the locale direction since we don't yet know which
// string we'll end up using for constructing the final progress string.
std::wstring amount_localized;
- if (l10n_util::AdjustStringForLocaleDirection(amount, &amount_localized)) {
+ if (base::i18n::AdjustStringForLocaleDirection(amount, &amount_localized)) {
amount.assign(amount_localized);
received_size.assign(amount_localized);
}
@@ -423,8 +424,8 @@ std::wstring GetProgressStatusText(DownloadItem* download) {
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))
+ if (base::i18n::AdjustStringForLocaleDirection(total_text,
+ &total_text_localized))
total_text.assign(total_text_localized);
amount = l10n_util::GetStringF(IDS_DOWNLOAD_TAB_PROGRESS_SIZE,
@@ -437,8 +438,8 @@ std::wstring GetProgressStatusText(DownloadItem* download) {
std::wstring speed_text = FormatSpeed(download->CurrentSpeed(),
amount_units, true);
std::wstring speed_text_localized;
- if (l10n_util::AdjustStringForLocaleDirection(speed_text,
- &speed_text_localized))
+ if (base::i18n::AdjustStringForLocaleDirection(speed_text,
+ &speed_text_localized))
speed_text.assign(speed_text_localized);
base::TimeDelta remaining;