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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_resource_cache.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: 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
Index: chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
index 105ac6bd96c8944b479243d4ce37c74a57ab95c1..9e81bda2a3cfb73c24ccd199bf938f147d25a75a 100644
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -324,7 +324,8 @@ void NTPResourceCache::CreateNewTabIncognitoHTML() {
profile_->GetPrefs()->GetBoolean(bookmarks::prefs::kShowBookmarkBar);
localized_strings.SetBoolean("bookmarkbarattached", bookmark_bar_attached);
- webui::SetFontAndTextDirection(&localized_strings);
+ const std::string& app_locale = g_browser_process->GetApplicationLocale();
+ webui::SetLoadTimeDataDefaults(app_locale, &localized_strings);
static const base::StringPiece incognito_tab_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
@@ -377,7 +378,8 @@ void NTPResourceCache::CreateNewTabGuestHTML() {
l10n_util::GetStringUTF16(guest_tab_link_ids));
localized_strings.SetString("learnMoreLink", guest_tab_link);
- webui::SetFontAndTextDirection(&localized_strings);
+ const std::string& app_locale = g_browser_process->GetApplicationLocale();
+ webui::SetLoadTimeDataDefaults(app_locale, &localized_strings);
static const base::StringPiece guest_tab_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(guest_tab_ids));
@@ -463,10 +465,10 @@ void NTPResourceCache::CreateNewTabHTML() {
l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_LEARN_MORE_URL));
load_time_data.SetString("learnMore",
l10n_util::GetStringUTF16(IDS_LEARN_MORE));
+ const std::string& app_locale = g_browser_process->GetApplicationLocale();
load_time_data.SetString("webStoreLink",
google_util::AppendGoogleLocaleParam(
- GURL(extension_urls::GetWebstoreLaunchURL()),
- g_browser_process->GetApplicationLocale()).spec());
+ GURL(extension_urls::GetWebstoreLaunchURL()), app_locale).spec());
load_time_data.SetString("appInstallHintText",
l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_INSTALL_HINT_LABEL));
load_time_data.SetBoolean("isDiscoveryInNTPEnabled",
@@ -516,7 +518,7 @@ void NTPResourceCache::CreateNewTabHTML() {
NewTabPageHandler::GetLocalizedValues(profile_, &load_time_data);
NTPLoginHandler::GetLocalizedValues(profile_, &load_time_data);
- webui::SetFontAndTextDirection(&load_time_data);
+ webui::SetLoadTimeDataDefaults(app_locale, &load_time_data);
// Control fade and resize animations.
load_time_data.SetBoolean("anim",
@@ -553,7 +555,7 @@ void NTPResourceCache::CreateNewTabHTML() {
// Determine whether to show the menu for accessing tabs on other devices.
bool show_other_sessions_menu =
should_show_other_devices_menu_ &&
- !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableNTPOtherSessionsMenu);
load_time_data.SetBoolean("showOtherSessionsMenu", show_other_sessions_menu);
load_time_data.SetBoolean(

Powered by Google App Engine
This is Rietveld 408576698