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

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

Issue 1073005: Move RTL related functions from app/l10n_util to base/i18n/rtl... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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/download/download_item_model.cc ('k') | chrome/browser/encoding_menu_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_util.cc
===================================================================
--- chrome/browser/download/download_util.cc (revision 42180)
+++ chrome/browser/download/download_util.cc (working copy)
@@ -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 @@
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 @@
// 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 @@
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 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;
« no previous file with comments | « chrome/browser/download/download_item_model.cc ('k') | chrome/browser/encoding_menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698