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

Unified Diff: content/browser/webui/web_ui_data_source_impl.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 | « content/browser/resources/service_worker/serviceworker_internals.html ('k') | net/base/dir_header.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/webui/web_ui_data_source_impl.cc
diff --git a/content/browser/webui/web_ui_data_source_impl.cc b/content/browser/webui/web_ui_data_source_impl.cc
index 8d8f4658db0e437f51220ee86a1c55cb768c5b42..f3a5777d3da932922f7b58b8d014424d59a01266 100644
--- a/content/browser/webui/web_ui_data_source_impl.cc
+++ b/content/browser/webui/web_ui_data_source_impl.cc
@@ -10,6 +10,7 @@
#include "base/memory/ref_counted_memory.h"
#include "base/strings/string_util.h"
#include "content/grit/content_resources.h"
+#include "content/public/browser/content_browser_client.h"
#include "content/public/common/content_client.h"
#include "third_party/mojo/src/mojo/public/js/constants.h"
#include "ui/base/webui/jstemplate_builder.h"
@@ -231,8 +232,10 @@ void WebUIDataSourceImpl::StartDataRequest(
void WebUIDataSourceImpl::SendLocalizedStringsAsJSON(
const URLDataSource::GotDataCallback& callback) {
std::string template_data;
- if (!disable_set_font_strings_)
- webui::SetFontAndTextDirection(&localized_strings_);
+ if (!disable_set_font_strings_) {
+ std::string locale = GetContentClient()->browser()->GetApplicationLocale();
+ webui::SetLoadTimeDataDefaults(locale, &localized_strings_);
+ }
webui::AppendJsonJS(&localized_strings_, &template_data);
callback.Run(base::RefCountedString::TakeString(&template_data));
« no previous file with comments | « content/browser/resources/service_worker/serviceworker_internals.html ('k') | net/base/dir_header.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698