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

Unified Diff: chrome/renderer/localized_error.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
Index: chrome/renderer/localized_error.cc
===================================================================
--- chrome/renderer/localized_error.cc (revision 42180)
+++ chrome/renderer/localized_error.cc (working copy)
@@ -5,6 +5,7 @@
#include "chrome/renderer/localized_error.h"
#include "app/l10n_util.h"
+#include "base/i18n/rtl.h"
#include "base/logging.h"
#include "base/string_util.h"
#include "base/values.h"
@@ -106,11 +107,11 @@
bool LocaleIsRTL() {
#if defined(TOOLKIT_GTK)
- // l10n_util::GetTextDirection uses the GTK text direction, which doesn't work
+ // base::i18n::GetTextDirection uses the GTK text direction, which doesn't work
// within the renderer sandbox.
- return l10n_util::GetICUTextDirection() == l10n_util::RIGHT_TO_LEFT;
+ return base::i18n::GetICUTextDirection() == base::i18n::RIGHT_TO_LEFT;
#else
- return l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT;
+ return base::i18n::IsRTL();
#endif
}
@@ -156,7 +157,7 @@
ASCIIToWide(std::string(error.unreachableURL.spec())));
// URLs are always LTR.
if (rtl)
- l10n_util::WrapStringWithLTRFormatting(&failed_url);
+ base::i18n::WrapStringWithLTRFormatting(&failed_url);
error_strings->SetString(L"title",
l10n_util::GetStringF(options.title_resource_id,
failed_url));
@@ -197,7 +198,7 @@
std::wstring homepage(ASCIIToWide(failed_url.GetWithEmptyPath().spec()));
// URLs are always LTR.
if (rtl)
- l10n_util::WrapStringWithLTRFormatting(&homepage);
+ base::i18n::WrapStringWithLTRFormatting(&homepage);
suggest_home_page->SetString(L"homePage", homepage);
// TODO(tc): we actually want the unicode hostname
suggest_home_page->SetString(L"hostName",
@@ -242,7 +243,7 @@
std::wstring failed_url(ASCIIToWide(display_url.spec()));
// URLs are always LTR.
if (rtl)
- l10n_util::WrapStringWithLTRFormatting(&failed_url);
+ base::i18n::WrapStringWithLTRFormatting(&failed_url);
error_strings->SetString(
L"title", l10n_util::GetStringF(IDS_ERRORPAGES_TITLE_NOT_AVAILABLE,
failed_url.c_str()));
« no previous file with comments | « chrome/common/extensions/extension_message_bundle_unittest.cc ('k') | chrome/test/automation/automation_proxy_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698