OLD | NEW |
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 "components/security_interstitials/content/security_interstitial_page.h
" | 5 #include "components/security_interstitials/content/security_interstitial_page.h
" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 *controller_->GetPrefService(), on_show_extended_reporting_pref_exists_, | 98 *controller_->GetPrefService(), on_show_extended_reporting_pref_exists_, |
99 on_show_extended_reporting_pref_value_); | 99 on_show_extended_reporting_pref_value_); |
100 } | 100 } |
101 } | 101 } |
102 | 102 |
103 base::string16 SecurityInterstitialPage::GetFormattedHostName() const { | 103 base::string16 SecurityInterstitialPage::GetFormattedHostName() const { |
104 return security_interstitials::common_string_util::GetFormattedHostName( | 104 return security_interstitials::common_string_util::GetFormattedHostName( |
105 request_url_); | 105 request_url_); |
106 } | 106 } |
107 | 107 |
| 108 int SecurityInterstitialPage::GetHTMLTemplateId() { |
| 109 return IDR_SECURITY_INTERSTITIAL_HTML; |
| 110 } |
| 111 |
108 std::string SecurityInterstitialPage::GetHTMLContents() { | 112 std::string SecurityInterstitialPage::GetHTMLContents() { |
109 base::DictionaryValue load_time_data; | 113 base::DictionaryValue load_time_data; |
110 PopulateInterstitialStrings(&load_time_data); | 114 PopulateInterstitialStrings(&load_time_data); |
111 webui::SetLoadTimeDataDefaults( | 115 webui::SetLoadTimeDataDefaults( |
112 controller()->GetApplicationLocale(), &load_time_data); | 116 controller()->GetApplicationLocale(), &load_time_data); |
113 std::string html = ResourceBundle::GetSharedInstance() | 117 std::string html = ResourceBundle::GetSharedInstance() |
114 .GetRawDataResource(IDR_SECURITY_INTERSTITIAL_HTML) | 118 .GetRawDataResource(GetHTMLTemplateId()) |
115 .as_string(); | 119 .as_string(); |
116 webui::AppendWebUiCssTextDefaults(&html); | 120 webui::AppendWebUiCssTextDefaults(&html); |
117 return webui::GetI18nTemplateHtml(html, &load_time_data); | 121 return webui::GetI18nTemplateHtml(html, &load_time_data); |
118 } | 122 } |
119 | 123 |
120 } // security_interstitials | 124 } // security_interstitials |
OLD | NEW |