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

Side by Side Diff: ui/base/webui/web_ui_util.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, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/webui/web_ui_util.h" 5 #include "ui/base/webui/web_ui_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 base::win::GetVersion() < base::win::VERSION_VISTA ? 157 base::win::GetVersion() < base::win::VERSION_VISTA ?
158 IDS_WEB_FONT_SIZE_XP : 158 IDS_WEB_FONT_SIZE_XP :
159 #endif 159 #endif
160 IDS_WEB_FONT_SIZE); 160 IDS_WEB_FONT_SIZE);
161 } 161 }
162 162
163 std::string GetTextDirection() { 163 std::string GetTextDirection() {
164 return base::i18n::IsRTL() ? "rtl" : "ltr"; 164 return base::i18n::IsRTL() ? "rtl" : "ltr";
165 } 165 }
166 166
167 void SetFontAndTextDirection(base::DictionaryValue* localized_strings) { 167 void SetLoadTimeDataDefaults(const std::string& app_locale,
168 base::DictionaryValue* localized_strings) {
168 localized_strings->SetString("fontfamily", GetFontFamily()); 169 localized_strings->SetString("fontfamily", GetFontFamily());
169 localized_strings->SetString("fontsize", GetFontSize()); 170 localized_strings->SetString("fontsize", GetFontSize());
171 localized_strings->SetString("language", l10n_util::GetLanguage(app_locale));
170 localized_strings->SetString("textdirection", GetTextDirection()); 172 localized_strings->SetString("textdirection", GetTextDirection());
171 } 173 }
172 174
173 } // namespace webui 175 } // namespace webui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698