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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page.cc

Issue 445493002: Delete the Safe Browsing V2 interstitial and Finch trial (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed JS/HTML Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Implementation of the SafeBrowsingBlockingPage class. 5 // Implementation of the SafeBrowsingBlockingPage class.
6 6
7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" 7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h"
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 PHISHING_PROCEED_CROSS_SITE, 120 PHISHING_PROCEED_CROSS_SITE,
121 MAX_DETAILED_ACTION 121 MAX_DETAILED_ACTION
122 }; 122 };
123 123
124 void RecordDetailedUserAction(DetailedDecision decision) { 124 void RecordDetailedUserAction(DetailedDecision decision) {
125 UMA_HISTOGRAM_ENUMERATION("SB2.InterstitialActionDetails", 125 UMA_HISTOGRAM_ENUMERATION("SB2.InterstitialActionDetails",
126 decision, 126 decision,
127 MAX_DETAILED_ACTION); 127 MAX_DETAILED_ACTION);
128 } 128 }
129 129
130 // Constants for the M37 Finch trial.
131 const char kV3StudyName[] = "MalwareInterstitialVersion";
132 const char kCondV2[] = "V2";
133 const char kCondV3[] = "V3";
134 const char kCondV3Advice[] = "V3Advice";
135 const char kCondV3Social[] = "V3Social";
136 const char kCondV3NotRecommend[] = "V3NotRecommend";
137 const char kCondV3History[] = "V3History";
138
139 // Default to V3 unless a flag or field trial says otherwise. Flags override
140 // field trial settings.
141 const char* GetTrialCondition() {
142 if (CommandLine::ForCurrentProcess()->HasSwitch(
143 switches::kMalwareInterstitialV2)) {
144 return kCondV2;
145 }
146 if (CommandLine::ForCurrentProcess()->HasSwitch(
147 switches::kMalwareInterstitialV3)) {
148 return kCondV3;
149 }
150 if (CommandLine::ForCurrentProcess()->HasSwitch(
151 switches::kMalwareInterstitialV3Advice)) {
152 return kCondV3Advice;
153 }
154 if (CommandLine::ForCurrentProcess()->HasSwitch(
155 switches::kMalwareInterstitialV3Social)) {
156 return kCondV3Social;
157 }
158 if (CommandLine::ForCurrentProcess()->HasSwitch(
159 switches::kMalwareInterstitialV3NotRecommend)) {
160 return kCondV3NotRecommend;
161 }
162 if (CommandLine::ForCurrentProcess()->HasSwitch(
163 switches::kMalwareInterstitialV3History)) {
164 return kCondV3History;
165 }
166
167 // Make sure that the return value is one of the expected types instead of
168 // directly returning base::FieldTrialList::FindFullName.
169 if (base::FieldTrialList::FindFullName(kV3StudyName) == kCondV2)
170 return kCondV2;
171 if (base::FieldTrialList::FindFullName(kV3StudyName) == kCondV3)
172 return kCondV3;
173 if (base::FieldTrialList::FindFullName(kV3StudyName) == kCondV3Advice)
174 return kCondV3Advice;
175 if (base::FieldTrialList::FindFullName(kV3StudyName) == kCondV3Social)
176 return kCondV3Social;
177 if (base::FieldTrialList::FindFullName(kV3StudyName) == kCondV3NotRecommend)
178 return kCondV3NotRecommend;
179 if (base::FieldTrialList::FindFullName(kV3StudyName) == kCondV3History)
180 return kCondV3History;
181 return kCondV3;
182 }
183
184 } // namespace 130 } // namespace
185 131
186 // static 132 // static
187 SafeBrowsingBlockingPageFactory* SafeBrowsingBlockingPage::factory_ = NULL; 133 SafeBrowsingBlockingPageFactory* SafeBrowsingBlockingPage::factory_ = NULL;
188 134
189 // The default SafeBrowsingBlockingPageFactory. Global, made a singleton so we 135 // The default SafeBrowsingBlockingPageFactory. Global, made a singleton so we
190 // don't leak it. 136 // don't leak it.
191 class SafeBrowsingBlockingPageFactoryImpl 137 class SafeBrowsingBlockingPageFactoryImpl
192 : public SafeBrowsingBlockingPageFactory { 138 : public SafeBrowsingBlockingPageFactory {
193 public: 139 public:
194 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage( 140 virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage(
195 SafeBrowsingUIManager* ui_manager, 141 SafeBrowsingUIManager* ui_manager,
196 WebContents* web_contents, 142 WebContents* web_contents,
197 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) 143 const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources)
198 OVERRIDE { 144 OVERRIDE {
199 // Only use the V2 page if the interstitial is for a single malware or
200 // phishing resource.
201 if ((GetTrialCondition() == kCondV2) && (unsafe_resources.size() == 1) &&
202 (unsafe_resources[0].threat_type == SB_THREAT_TYPE_URL_MALWARE ||
203 unsafe_resources[0].threat_type ==
204 SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL ||
205 unsafe_resources[0].threat_type == SB_THREAT_TYPE_URL_PHISHING ||
206 unsafe_resources[0].threat_type ==
207 SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL)) {
208 return new SafeBrowsingBlockingPageV2(ui_manager, web_contents,
209 unsafe_resources);
210 }
211 return new SafeBrowsingBlockingPageV3(ui_manager, web_contents, 145 return new SafeBrowsingBlockingPageV3(ui_manager, web_contents,
212 unsafe_resources); 146 unsafe_resources);
213 } 147 }
214 148
215 private: 149 private:
216 friend struct base::DefaultLazyInstanceTraits< 150 friend struct base::DefaultLazyInstanceTraits<
217 SafeBrowsingBlockingPageFactoryImpl>; 151 SafeBrowsingBlockingPageFactoryImpl>;
218 152
219 SafeBrowsingBlockingPageFactoryImpl() { } 153 SafeBrowsingBlockingPageFactoryImpl() { }
220 154
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 // load, since they happen after the page is finished loading. 804 // load, since they happen after the page is finished loading.
871 if (unsafe_resources[0].threat_type == 805 if (unsafe_resources[0].threat_type ==
872 SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL) { 806 SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL) {
873 return false; 807 return false;
874 } 808 }
875 809
876 // Otherwise, check the threat type. 810 // Otherwise, check the threat type.
877 return unsafe_resources.size() == 1 && !unsafe_resources[0].is_subresource; 811 return unsafe_resources.size() == 1 && !unsafe_resources[0].is_subresource;
878 } 812 }
879 813
880 SafeBrowsingBlockingPageV2::SafeBrowsingBlockingPageV2(
881 SafeBrowsingUIManager* ui_manager,
882 WebContents* web_contents,
883 const UnsafeResourceList& unsafe_resources)
884 : SafeBrowsingBlockingPage(ui_manager, web_contents, unsafe_resources) {
885 }
886
887 std::string SafeBrowsingBlockingPageV2::GetHTMLContents() {
888 // Load the HTML page and create the template components.
889 base::DictionaryValue strings;
890 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
891 std::string html;
892
893 if (unsafe_resources_.empty()) {
894 NOTREACHED();
895 return std::string();
896 }
897
898 if (unsafe_resources_.size() > 1) {
899 NOTREACHED();
900 } else {
901 SBThreatType threat_type = unsafe_resources_[0].threat_type;
902 if (threat_type == SB_THREAT_TYPE_URL_MALWARE ||
903 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL) {
904 PopulateMalwareStringDictionary(&strings);
905 } else { // Phishing.
906 DCHECK(threat_type == SB_THREAT_TYPE_URL_PHISHING ||
907 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL);
908 PopulatePhishingStringDictionary(&strings);
909 }
910 html = rb.GetRawDataResource(IDR_SAFE_BROWSING_MALWARE_BLOCK_V2).
911 as_string();
912 }
913 interstitial_show_time_ = base::TimeTicks::Now();
914 return webui::GetTemplatesHtml(html, &strings, "template-root");
915 }
916
917 void SafeBrowsingBlockingPageV2::PopulateStringDictionary(
918 base::DictionaryValue* strings,
919 const base::string16& title,
920 const base::string16& headline,
921 const base::string16& description1,
922 const base::string16& description2,
923 const base::string16& description3) {
924 strings->SetString("title", title);
925 strings->SetString("headLine", headline);
926 strings->SetString("description1", description1);
927 strings->SetString("description2", description2);
928 strings->SetString("description3", description3);
929 strings->SetBoolean("proceedDisabled",
930 IsPrefEnabled(prefs::kSafeBrowsingProceedAnywayDisabled));
931 strings->SetBoolean("isMainFrame", is_main_frame_load_blocked_);
932 strings->SetBoolean("isPhishing", interstitial_type_ == TYPE_PHISHING);
933
934 strings->SetString("back_button",
935 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_BACK_BUTTON));
936 strings->SetString("seeMore", l10n_util::GetStringUTF16(
937 IDS_SAFE_BROWSING_MALWARE_V2_SEE_MORE));
938 strings->SetString("proceed",
939 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_V2_PROCEED_LINK));
940 webui::SetFontAndTextDirection(strings);
941 }
942
943 void SafeBrowsingBlockingPageV2::PopulateMultipleThreatStringDictionary(
944 base::DictionaryValue* strings) {
945 NOTREACHED();
946 }
947
948 void SafeBrowsingBlockingPageV2::PopulateMalwareStringDictionary(
949 base::DictionaryValue* strings) {
950 // Check to see if we're blocking the main page, or a sub-resource on the
951 // main page.
952 base::string16 headline, description1, description2, description3;
953
954
955 description3 = l10n_util::GetStringUTF16(
956 IDS_SAFE_BROWSING_MALWARE_V2_DESCRIPTION3);
957 if (is_main_frame_load_blocked_) {
958 headline = l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_V2_HEADLINE);
959 description1 = l10n_util::GetStringFUTF16(
960 IDS_SAFE_BROWSING_MALWARE_V2_DESCRIPTION1,
961 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
962 base::UTF8ToUTF16(url_.host()));
963 description2 = l10n_util::GetStringUTF16(
964 IDS_SAFE_BROWSING_MALWARE_V2_DESCRIPTION2);
965 strings->SetString("details", l10n_util::GetStringUTF16(
966 IDS_SAFE_BROWSING_MALWARE_V2_DETAILS));
967 } else {
968 headline = l10n_util::GetStringUTF16(
969 IDS_SAFE_BROWSING_MALWARE_V2_HEADLINE_SUBRESOURCE);
970 description1 = l10n_util::GetStringFUTF16(
971 IDS_SAFE_BROWSING_MALWARE_V2_DESCRIPTION1_SUBRESOURCE,
972 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
973 base::UTF8ToUTF16(web_contents_->GetURL().host()));
974 description2 = l10n_util::GetStringFUTF16(
975 IDS_SAFE_BROWSING_MALWARE_V2_DESCRIPTION2_SUBRESOURCE,
976 base::UTF8ToUTF16(url_.host()));
977 strings->SetString("details", l10n_util::GetStringFUTF16(
978 IDS_SAFE_BROWSING_MALWARE_V2_DETAILS_SUBRESOURCE,
979 base::UTF8ToUTF16(url_.host())));
980 }
981
982 PopulateStringDictionary(
983 strings,
984 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_V2_TITLE),
985 headline,
986 description1,
987 description2,
988 description3);
989
990 if (!CanShowMalwareDetailsOption()) {
991 strings->SetBoolean(kDisplayCheckBox, false);
992 strings->SetString("confirm_text", std::string());
993 strings->SetString(kBoxChecked, std::string());
994 } else {
995 // Show the checkbox for sending malware details.
996 strings->SetBoolean(kDisplayCheckBox, true);
997
998 std::string privacy_link = base::StringPrintf(
999 kPrivacyLinkHtml,
1000 l10n_util::GetStringUTF8(
1001 IDS_SAFE_BROWSING_PRIVACY_POLICY_PAGE_V2).c_str());
1002
1003 strings->SetString("confirm_text",
1004 l10n_util::GetStringFUTF16(
1005 IDS_SAFE_BROWSING_MALWARE_V2_REPORTING_AGREE,
1006 base::UTF8ToUTF16(privacy_link)));
1007 Profile* profile = Profile::FromBrowserContext(
1008 web_contents_->GetBrowserContext());
1009 if (profile->GetPrefs()->HasPrefPath(
1010 prefs::kSafeBrowsingExtendedReportingEnabled)) {
1011 reporting_checkbox_checked_ =
1012 IsPrefEnabled(prefs::kSafeBrowsingExtendedReportingEnabled);
1013 } else if (IsPrefEnabled(prefs::kSafeBrowsingReportingEnabled) ||
1014 IsPrefEnabled(prefs::kSafeBrowsingDownloadFeedbackEnabled)) {
1015 reporting_checkbox_checked_ = true;
1016 }
1017 strings->SetString(kBoxChecked,
1018 reporting_checkbox_checked_ ? "yes" : std::string());
1019 }
1020
1021 strings->SetString("report_error", base::string16());
1022 strings->SetString("learnMore",
1023 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_V2_LEARN_MORE));
1024 }
1025
1026 void SafeBrowsingBlockingPageV2::PopulatePhishingStringDictionary(
1027 base::DictionaryValue* strings) {
1028 PopulateStringDictionary(
1029 strings,
1030 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_TITLE),
1031 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_HEADLINE),
1032 l10n_util::GetStringFUTF16(IDS_SAFE_BROWSING_PHISHING_V2_DESCRIPTION1,
1033 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
1034 base::UTF8ToUTF16(url_.host())),
1035 base::string16(),
1036 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_DESCRIPTION2));
1037
1038 strings->SetString("details", std::string());
1039 strings->SetString("confirm_text", std::string());
1040 strings->SetString(kBoxChecked, std::string());
1041 strings->SetString(
1042 "report_error",
1043 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_REPORT_ERROR));
1044 strings->SetBoolean(kDisplayCheckBox, false);
1045 strings->SetString("learnMore",
1046 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_V2_LEARN_MORE));
1047 }
1048
1049 SafeBrowsingBlockingPageV3::SafeBrowsingBlockingPageV3( 814 SafeBrowsingBlockingPageV3::SafeBrowsingBlockingPageV3(
1050 SafeBrowsingUIManager* ui_manager, 815 SafeBrowsingUIManager* ui_manager,
1051 WebContents* web_contents, 816 WebContents* web_contents,
1052 const UnsafeResourceList& unsafe_resources) 817 const UnsafeResourceList& unsafe_resources)
1053 : SafeBrowsingBlockingPage(ui_manager, web_contents, unsafe_resources), 818 : SafeBrowsingBlockingPage(ui_manager, web_contents, unsafe_resources) {
1054 trial_condition_(GetTrialCondition()) {
1055 } 819 }
1056 820
1057 std::string SafeBrowsingBlockingPageV3::GetHTMLContents() { 821 std::string SafeBrowsingBlockingPageV3::GetHTMLContents() {
1058 DCHECK(!unsafe_resources_.empty()); 822 DCHECK(!unsafe_resources_.empty());
1059 823
1060 // Fill in the shared values. 824 // Fill in the shared values.
1061 base::DictionaryValue load_time_data; 825 base::DictionaryValue load_time_data;
1062 webui::SetFontAndTextDirection(&load_time_data); 826 webui::SetFontAndTextDirection(&load_time_data);
1063 load_time_data.SetBoolean("ssl", false); 827 load_time_data.SetBoolean("ssl", false);
1064 load_time_data.SetString( 828 load_time_data.SetString(
(...skipping 20 matching lines...) Expand all
1085 849
1086 base::StringPiece html( 850 base::StringPiece html(
1087 ResourceBundle::GetSharedInstance().GetRawDataResource( 851 ResourceBundle::GetSharedInstance().GetRawDataResource(
1088 IRD_SSL_INTERSTITIAL_V2_HTML)); 852 IRD_SSL_INTERSTITIAL_V2_HTML));
1089 webui::UseVersion2 version; 853 webui::UseVersion2 version;
1090 return webui::GetI18nTemplateHtml(html, &load_time_data); 854 return webui::GetI18nTemplateHtml(html, &load_time_data);
1091 } 855 }
1092 856
1093 void SafeBrowsingBlockingPageV3::PopulateMalwareLoadTimeData( 857 void SafeBrowsingBlockingPageV3::PopulateMalwareLoadTimeData(
1094 base::DictionaryValue* load_time_data) { 858 base::DictionaryValue* load_time_data) {
1095 load_time_data->SetString("trialCondition", trial_condition_);
1096 load_time_data->SetBoolean("phishing", false); 859 load_time_data->SetBoolean("phishing", false);
1097 load_time_data->SetString( 860 load_time_data->SetString(
1098 "heading", l10n_util::GetStringUTF16(IDS_MALWARE_V3_HEADING)); 861 "heading", l10n_util::GetStringUTF16(IDS_MALWARE_V3_HEADING));
1099 load_time_data->SetString( 862 load_time_data->SetString(
1100 "primaryParagraph", 863 "primaryParagraph",
1101 l10n_util::GetStringFUTF16( 864 l10n_util::GetStringFUTF16(
1102 IDS_MALWARE_V3_PRIMARY_PARAGRAPH, 865 IDS_MALWARE_V3_PRIMARY_PARAGRAPH,
1103 base::UTF8ToUTF16(url_.host()))); 866 base::UTF8ToUTF16(url_.host())));
1104 if (trial_condition_ == kCondV3History) { 867 load_time_data->SetString(
1105 load_time_data->SetString( 868 "explanationParagraph",
1106 "explanationParagraph", 869 is_main_frame_load_blocked_ ?
1107 is_main_frame_load_blocked_ ? 870 l10n_util::GetStringFUTF16(
1108 l10n_util::GetStringFUTF16( 871 IDS_MALWARE_V3_EXPLANATION_PARAGRAPH,
1109 IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_HISTORY, 872 base::UTF8ToUTF16(url_.host())) :
1110 base::UTF8ToUTF16(url_.host())) : 873 l10n_util::GetStringFUTF16(
1111 l10n_util::GetStringFUTF16( 874 IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_SUBRESOURCE,
1112 IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_SUBRESOURCE_HISTORY, 875 base::UTF8ToUTF16(web_contents_->GetURL().host()),
1113 base::UTF8ToUTF16(web_contents_->GetURL().host()), 876 base::UTF8ToUTF16(url_.host())));
1114 base::UTF8ToUTF16(url_.host()))); 877 load_time_data->SetString(
1115 } else if (trial_condition_ == kCondV3Advice) { 878 "finalParagraph",
1116 load_time_data->SetString( 879 l10n_util::GetStringUTF16(IDS_MALWARE_V3_PROCEED_PARAGRAPH));
1117 "explanationParagraph",
1118 is_main_frame_load_blocked_ ?
1119 l10n_util::GetStringFUTF16(
1120 IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_ADVICE,
1121 base::UTF8ToUTF16(url_.host())) :
1122 l10n_util::GetStringFUTF16(
1123 IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_SUBRESOURCE_ADVICE,
1124 base::UTF8ToUTF16(web_contents_->GetURL().host()),
1125 base::UTF8ToUTF16(url_.host())));
1126 load_time_data->SetString(
1127 "adviceHeading",
1128 l10n_util::GetStringUTF16(IDS_MALWARE_V3_ADVICE_HEADING));
1129 } else {
1130 load_time_data->SetString(
1131 "explanationParagraph",
1132 is_main_frame_load_blocked_ ?
1133 l10n_util::GetStringFUTF16(
1134 IDS_MALWARE_V3_EXPLANATION_PARAGRAPH,
1135 base::UTF8ToUTF16(url_.host())) :
1136 l10n_util::GetStringFUTF16(
1137 IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_SUBRESOURCE,
1138 base::UTF8ToUTF16(web_contents_->GetURL().host()),
1139 base::UTF8ToUTF16(url_.host())));
1140 }
1141 if (trial_condition_ == kCondV3Social) {
1142 load_time_data->SetString(
1143 "finalParagraph",
1144 l10n_util::GetStringUTF16(IDS_MALWARE_V3_PROCEED_PARAGRAPH_SOCIAL));
1145 } else if (trial_condition_ == kCondV3NotRecommend) {
1146 load_time_data->SetString(
1147 "finalParagraph",
1148 l10n_util::GetStringUTF16(
1149 IDS_MALWARE_V3_PROCEED_PARAGRAPH_NOT_RECOMMEND));
1150 } else {
1151 load_time_data->SetString(
1152 "finalParagraph",
1153 l10n_util::GetStringUTF16(IDS_MALWARE_V3_PROCEED_PARAGRAPH));
1154 }
1155 880
1156 load_time_data->SetBoolean(kDisplayCheckBox, CanShowMalwareDetailsOption()); 881 load_time_data->SetBoolean(kDisplayCheckBox, CanShowMalwareDetailsOption());
1157 if (CanShowMalwareDetailsOption()) { 882 if (CanShowMalwareDetailsOption()) {
1158 std::string privacy_link = base::StringPrintf( 883 std::string privacy_link = base::StringPrintf(
1159 kPrivacyLinkHtml, 884 kPrivacyLinkHtml,
1160 l10n_util::GetStringUTF8( 885 l10n_util::GetStringUTF8(
1161 IDS_SAFE_BROWSING_PRIVACY_POLICY_PAGE_V2).c_str()); 886 IDS_SAFE_BROWSING_PRIVACY_POLICY_PAGE).c_str());
1162 load_time_data->SetString( 887 load_time_data->SetString(
1163 "optInLink", 888 "optInLink",
1164 l10n_util::GetStringFUTF16(IDS_SAFE_BROWSING_MALWARE_V2_REPORTING_AGREE, 889 l10n_util::GetStringFUTF16(IDS_SAFE_BROWSING_MALWARE_REPORTING_AGREE,
1165 base::UTF8ToUTF16(privacy_link))); 890 base::UTF8ToUTF16(privacy_link)));
1166 Profile* profile = Profile::FromBrowserContext( 891 Profile* profile = Profile::FromBrowserContext(
1167 web_contents_->GetBrowserContext()); 892 web_contents_->GetBrowserContext());
1168 if (profile->GetPrefs()->HasPrefPath( 893 if (profile->GetPrefs()->HasPrefPath(
1169 prefs::kSafeBrowsingExtendedReportingEnabled)) { 894 prefs::kSafeBrowsingExtendedReportingEnabled)) {
1170 reporting_checkbox_checked_ = 895 reporting_checkbox_checked_ =
1171 IsPrefEnabled(prefs::kSafeBrowsingExtendedReportingEnabled); 896 IsPrefEnabled(prefs::kSafeBrowsingExtendedReportingEnabled);
1172 } else if (IsPrefEnabled(prefs::kSafeBrowsingReportingEnabled) || 897 } else if (IsPrefEnabled(prefs::kSafeBrowsingReportingEnabled) ||
1173 IsPrefEnabled(prefs::kSafeBrowsingDownloadFeedbackEnabled)) { 898 IsPrefEnabled(prefs::kSafeBrowsingDownloadFeedbackEnabled)) {
1174 reporting_checkbox_checked_ = true; 899 reporting_checkbox_checked_ = true;
1175 } 900 }
1176 load_time_data->SetBoolean( 901 load_time_data->SetBoolean(
1177 kBoxChecked, reporting_checkbox_checked_); 902 kBoxChecked, reporting_checkbox_checked_);
1178 } 903 }
1179 } 904 }
1180 905
1181 void SafeBrowsingBlockingPageV3::PopulatePhishingLoadTimeData( 906 void SafeBrowsingBlockingPageV3::PopulatePhishingLoadTimeData(
1182 base::DictionaryValue* load_time_data) { 907 base::DictionaryValue* load_time_data) {
1183 load_time_data->SetString("trialCondition", std::string());
1184 load_time_data->SetBoolean("phishing", true); 908 load_time_data->SetBoolean("phishing", true);
1185 load_time_data->SetString( 909 load_time_data->SetString(
1186 "heading", 910 "heading",
1187 l10n_util::GetStringUTF16(IDS_PHISHING_V3_HEADING)); 911 l10n_util::GetStringUTF16(IDS_PHISHING_V3_HEADING));
1188 load_time_data->SetString( 912 load_time_data->SetString(
1189 "primaryParagraph", 913 "primaryParagraph",
1190 l10n_util::GetStringFUTF16( 914 l10n_util::GetStringFUTF16(
1191 IDS_PHISHING_V3_PRIMARY_PARAGRAPH, 915 IDS_PHISHING_V3_PRIMARY_PARAGRAPH,
1192 base::UTF8ToUTF16(url_.host()))); 916 base::UTF8ToUTF16(url_.host())));
1193 load_time_data->SetString( 917 load_time_data->SetString(
1194 "explanationParagraph", 918 "explanationParagraph",
1195 l10n_util::GetStringFUTF16(IDS_PHISHING_V3_EXPLANATION_PARAGRAPH, 919 l10n_util::GetStringFUTF16(IDS_PHISHING_V3_EXPLANATION_PARAGRAPH,
1196 base::UTF8ToUTF16(url_.host()))); 920 base::UTF8ToUTF16(url_.host())));
1197 load_time_data->SetString( 921 load_time_data->SetString(
1198 "finalParagraph", 922 "finalParagraph",
1199 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); 923 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH));
1200 } 924 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698