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

Unified Diff: chrome/common/localized_error.cc

Issue 880313002: webui: add [lang] attribute to <html> element on all webui pages so (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cros Created 5 years, 11 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/common/localized_error.h ('k') | chrome/renderer/chrome_content_renderer_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/localized_error.cc
diff --git a/chrome/common/localized_error.cc b/chrome/common/localized_error.cc
index 5a969bc5fbe5555f1cbf69ba61171aa0d6e29a6c..5472b778567b20b01b83a26fdb3b89f29467a38d 100644
--- a/chrome/common/localized_error.cc
+++ b/chrome/common/localized_error.cc
@@ -477,10 +477,6 @@ const LocalizedErrorMap* LookupErrorMap(const std::string& error_domain,
}
}
-bool LocaleIsRTL() {
- return base::i18n::IsRTL();
-}
-
// Returns a dictionary containing the strings for the settings menu under the
// wrench, and the advanced settings button.
base::DictionaryValue* GetStandardMenuItemsText() {
@@ -517,9 +513,7 @@ void LocalizedError::GetStrings(int error_code,
const std::string& accept_languages,
scoped_ptr<error_page::ErrorPageParams> params,
base::DictionaryValue* error_strings) {
- bool rtl = LocaleIsRTL();
- error_strings->SetString("textdirection", rtl ? "rtl" : "ltr");
- webui::SetFontAndTextDirection(error_strings);
+ webui::SetLoadTimeDataDefaults(locale, error_strings);
// Grab the strings and settings that depend on the error type. Init
// options with default values.
@@ -555,7 +549,7 @@ void LocalizedError::GetStrings(int error_code,
failed_url, accept_languages, net::kFormatUrlOmitNothing,
net::UnescapeRule::NORMAL, NULL, NULL, NULL));
// URLs are always LTR.
- if (rtl)
+ if (base::i18n::IsRTL())
base::i18n::WrapStringWithLTRFormatting(&failed_url_string);
error_strings->SetString("title",
l10n_util::GetStringFUTF16(options.title_resource_id, failed_url_string));
@@ -856,15 +850,15 @@ bool LocalizedError::HasStrings(const std::string& error_domain,
void LocalizedError::GetAppErrorStrings(
const GURL& display_url,
const extensions::Extension* app,
+ const std::string& locale,
base::DictionaryValue* error_strings) {
DCHECK(app);
- bool rtl = LocaleIsRTL();
- error_strings->SetString("textdirection", rtl ? "rtl" : "ltr");
+ webui::SetLoadTimeDataDefaults(locale, error_strings);
base::string16 failed_url(base::ASCIIToUTF16(display_url.spec()));
// URLs are always LTR.
- if (rtl)
+ if (base::i18n::IsRTL())
base::i18n::WrapStringWithLTRFormatting(&failed_url);
error_strings->SetString(
"url", l10n_util::GetStringFUTF16(IDS_ERRORPAGES_TITLE_NOT_AVAILABLE,
« no previous file with comments | « chrome/common/localized_error.h ('k') | chrome/renderer/chrome_content_renderer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698