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

Side by Side Diff: chrome/browser/interstitials/security_interstitial_page.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, 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 (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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 "chrome/browser/interstitials/security_interstitial_page.h" 5 #include "chrome/browser/interstitials/security_interstitial_page.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/browser_process.h"
10 #include "chrome/grit/browser_resources.h" 11 #include "chrome/grit/browser_resources.h"
11 #include "content/public/browser/interstitial_page.h" 12 #include "content/public/browser/interstitial_page.h"
12 #include "content/public/browser/web_contents.h" 13 #include "content/public/browser/web_contents.h"
13 #include "ui/base/resource/resource_bundle.h" 14 #include "ui/base/resource/resource_bundle.h"
14 #include "ui/base/webui/jstemplate_builder.h" 15 #include "ui/base/webui/jstemplate_builder.h"
15 #include "ui/base/webui/web_ui_util.h" 16 #include "ui/base/webui/web_ui_util.h"
16 17
17 SecurityInterstitialPage::SecurityInterstitialPage( 18 SecurityInterstitialPage::SecurityInterstitialPage(
18 content::WebContents* web_contents, 19 content::WebContents* web_contents,
19 const GURL& request_url) 20 const GURL& request_url)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 base::string16 SecurityInterstitialPage::GetFormattedHostName() const { 57 base::string16 SecurityInterstitialPage::GetFormattedHostName() const {
57 base::string16 host(base::UTF8ToUTF16(request_url_.host())); 58 base::string16 host(base::UTF8ToUTF16(request_url_.host()));
58 if (base::i18n::IsRTL()) 59 if (base::i18n::IsRTL())
59 base::i18n::WrapStringWithLTRFormatting(&host); 60 base::i18n::WrapStringWithLTRFormatting(&host);
60 return host; 61 return host;
61 } 62 }
62 63
63 std::string SecurityInterstitialPage::GetHTMLContents() { 64 std::string SecurityInterstitialPage::GetHTMLContents() {
64 base::DictionaryValue load_time_data; 65 base::DictionaryValue load_time_data;
65 PopulateInterstitialStrings(&load_time_data); 66 PopulateInterstitialStrings(&load_time_data);
66 webui::SetFontAndTextDirection(&load_time_data); 67 const std::string& app_locale = g_browser_process->GetApplicationLocale();
68 webui::SetLoadTimeDataDefaults(app_locale, &load_time_data);
67 std::string html = ResourceBundle::GetSharedInstance() 69 std::string html = ResourceBundle::GetSharedInstance()
68 .GetRawDataResource(IDR_SECURITY_INTERSTITIAL_HTML) 70 .GetRawDataResource(IDR_SECURITY_INTERSTITIAL_HTML)
69 .as_string(); 71 .as_string();
70 webui::AppendWebUiCssTextDefaults(&html); 72 webui::AppendWebUiCssTextDefaults(&html);
71 return webui::GetI18nTemplateHtml(html, &load_time_data); 73 return webui::GetI18nTemplateHtml(html, &load_time_data);
72 } 74 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/hotword_private/hotword_private_api.cc ('k') | chrome/browser/resources/about_conflicts.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698