summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfelt@chromium.org <felt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-20 05:33:07 +0000
committerfelt@chromium.org <felt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-20 05:33:07 +0000
commit8e6c2924ddcf05139e70aa0fb6bc2582a56399d2 (patch)
treed837bae17eb45307d0650a4ea6f4396a0c7a49ee
parentc5653b5f6f901b2739086aead9672c37be494584 (diff)
downloadchromium_src-8e6c2924ddcf05139e70aa0fb6bc2582a56399d2.zip
chromium_src-8e6c2924ddcf05139e70aa0fb6bc2582a56399d2.tar.gz
chromium_src-8e6c2924ddcf05139e70aa0fb6bc2582a56399d2.tar.bz2
Add experimental versions of the malware interstitial
This adds a few experimental versions of the new malware interstitial. They are all teh addition of an extra string. 1. Prior history 2. "(not recommended)" next to link 3. Advice 4. Social proof BUG=386033 Review URL: https://codereview.chromium.org/346733003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278618 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/generated_resources.grd41
-rw-r--r--chrome/browser/about_flags.cc12
-rw-r--r--chrome/browser/resources/safe_browsing/safe_browsing_v3.js10
-rw-r--r--chrome/browser/resources/ssl/interstitial_v2.css8
-rw-r--r--chrome/browser/resources/ssl/interstitial_v2.js6
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page.cc191
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page.h6
-rw-r--r--chrome/common/chrome_switches.cc9
-rw-r--r--chrome/common/chrome_switches.h8
9 files changed, 192 insertions, 99 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index ae06a07..36b429f 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -9257,9 +9257,30 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_SUBRESOURCE" desc="The explanation of why Safe Browsing has blocked the page.">
Google Safe Browsing recently <ph name="BEGIN_LINK">&lt;a href="#" id="help-link"&gt;</ph>detected malware<ph name="END_LINK">&lt;/a&gt;</ph> on <ph name="SITE">$1<ex>example.com</ex></ph>. Websites that are normally safe are sometimes infected with malware. The malicious content comes from <ph name="SUBRESOURCE_HOST">$2<ex>evil.com</ex></ph>, a known malware distributor.
</message>
+ <message name="IDS_MALWARE_V3_ADVICE_HEADING" desc="A header for the IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_ADVICE paragraph.">
+ What should you do?
+ </message>
+ <message name="IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_ADVICE" desc="The explanation of why Safe Browsing has blocked the page, with additional advice.">
+ You should come back to this website in a few hours. Google Safe Browsing recently <ph name="BEGIN_LINK">&lt;a href="#" id="help-link"&gt;</ph>detected malware<ph name="END_LINK">&lt;/a&gt;</ph> on <ph name="SITE">$1<ex>example.com</ex></ph>. Websites that are normally safe are sometimes infected with malware.
+ </message>
+ <message name="IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_SUBRESOURCE_ADVICE" desc="The explanation of why Safe Browsing has blocked the page, with additional advice.">
+ Google Safe Browsing recently <ph name="BEGIN_LINK">&lt;a href="#" id="help-link"&gt;</ph>detected malware<ph name="END_LINK">&lt;/a&gt;</ph> on <ph name="SITE">$1<ex>example.com</ex></ph>. Websites that are normally safe are sometimes infected with malware. The malicious content comes from <ph name="SUBRESOURCE_HOST">$2<ex>evil.com</ex></ph>, a known malware distributor. You should come back in a few hours.
+ </message>
+ <message name="IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_HISTORY" desc="The explanation of why Safe Browsing has blocked the page, with additional text about history.">
+ Even if you have visited this website before, it is not safe right now. Google Safe Browsing recently <ph name="BEGIN_LINK">&lt;a href="#" id="help-link"&gt;</ph>detected malware<ph name="END_LINK">&lt;/a&gt;</ph> on <ph name="SITE">$1<ex>example.com</ex></ph>. Websites that are normally safe are sometimes infected with malware.
+ </message>
+ <message name="IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_SUBRESOURCE_HISTORY" desc="The explanation of why Safe Browsing has blocked the page, with additional text about history.">
+ Even if you have visited this website before, it is not safe right now. Google Safe Browsing recently <ph name="BEGIN_LINK">&lt;a href="#" id="help-link"&gt;</ph>detected malware<ph name="END_LINK">&lt;/a&gt;</ph> on <ph name="SITE">$1<ex>example.com</ex></ph>. Websites that are normally safe are sometimes infected with malware. The malicious content comes from <ph name="SUBRESOURCE_HOST">$2<ex>evil.com</ex></ph>, a known malware distributor.
+ </message>
<message name="IDS_MALWARE_V3_PROCEED_PARAGRAPH" desc="The paragraph that lets the user skip the warning.">
If you understand the risks to your security, you may <ph name="BEGIN_LINK">&lt;a href="#" id="proceed-link"&gt;</ph>visit this unsafe site<ph name="END_LINK">&lt;/a&gt;</ph> before the dangerous programs have been removed.
</message>
+ <message name="IDS_MALWARE_V3_PROCEED_PARAGRAPH_NOT_RECOMMEND" desc="The paragraph that lets the user skip the warning, with the additional anti-recommendation string.">
+ If you understand the risks to your security, you may <ph name="BEGIN_LINK">&lt;a href="#" id="proceed-link"&gt;</ph>visit this unsafe site<ph name="END_LINK">&lt;/a&gt;</ph> (not recommended) before the dangerous programs have been removed.
+ </message>
+ <message name="IDS_MALWARE_V3_PROCEED_PARAGRAPH_SOCIAL" desc="The paragraph that lets the user skip the warning, with the additional anti-recommendation string.">
+ More than 80% of people who see this warning go back to safety instead of risking malware. However, if you understand the risks to your security, you may <ph name="BEGIN_LINK">&lt;a href="#" id="proceed-link"&gt;</ph>visit this unsafe site<ph name="END_LINK">&lt;/a&gt;</ph> before the dangerous programs have been removed.
+ </message>
<!-- Phishing interstitial V3 -->
<message name="IDS_PHISHING_V3_HEADING" desc="The large heading at the top of the phishing interstitial.">
@@ -14388,11 +14409,23 @@ Do you accept?
<message name="IDS_FLAGS_MALWARE_INTERSTITIAL_TRIAL_DESCRIPTION" desc="Description of the about:flags malware interstitial v3 experiment">
Switch between different versions of the malware and phishing interstitials.
</message>
- <message name="IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V2" desc="Go back to the old (V1) version">
- Last version
+ <message name="IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V2" desc="Go back to the old (V2) version">
+ Old version
+ </message>
+ <message name="IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V3" desc="The new interstitial (also default)">
+ New version
+ </message>
+ <message name="IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V3_ADVICE" desc="The new interstitial plus an advice string">
+ New version plus advice
+ </message>
+ <message name="IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V3_SOCIAL" desc="The new interstitial plus a social string">
+ New version plus social string
+ </message>
+ <message name="IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V3_NOTRECOMMEND" desc="The new interstitial plus an anti-recommendation string">
+ New version plus anti-recommendation string
</message>
- <message name="IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V3" desc="The new interstitial, with a gray background (also default)">
- Newest version
+ <message name="IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V3_HISTORY" desc="The new interstitial (also default)">
+ New version plus history string
</message>
</messages>
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 89f854c..ab3f36d 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -427,9 +427,17 @@ const Experiment::Choice kSSLInterstitialVersions[] = {
const Experiment::Choice kMalwareInterstitialVersions[] = {
{ IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
{ IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V2,
- switches::kMalwareInterstitialVersionV2, "" },
+ switches::kMalwareInterstitialV2, "" },
{ IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V3,
- switches::kMalwareInterstitialVersionV3, "" },
+ switches::kMalwareInterstitialV3, "" },
+ { IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V3_ADVICE,
+ switches::kMalwareInterstitialV3Advice, "" },
+ { IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V3_SOCIAL,
+ switches::kMalwareInterstitialV3Social, "" },
+ { IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V3_NOTRECOMMEND,
+ switches::kMalwareInterstitialV3NotRecommend, "" },
+ { IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V3_HISTORY,
+ switches::kMalwareInterstitialV3History, "" },
};
#if defined(OS_CHROMEOS)
diff --git a/chrome/browser/resources/safe_browsing/safe_browsing_v3.js b/chrome/browser/resources/safe_browsing/safe_browsing_v3.js
index 06ceb50..315a009 100644
--- a/chrome/browser/resources/safe_browsing/safe_browsing_v3.js
+++ b/chrome/browser/resources/safe_browsing/safe_browsing_v3.js
@@ -33,3 +33,13 @@ function setupCheckbox() {
$('opt-in-checkbox').checked ? SB_CMD_DO_REPORT : SB_CMD_DONT_REPORT);
});
}
+
+function setupMalwareFinchExperiment() {
+ if (loadTimeData.getString('trialCondition') != 'V3Advice')
+ return;
+ // Add all this dynamically instead of into the HTML because it's just a
+ // short-lived experiment.
+ var heading = document.createElement('h2');
+ heading.innerText = loadTimeData.getString('adviceHeading');
+ $('details').insertBefore(heading, $('details').firstChild);
+}
diff --git a/chrome/browser/resources/ssl/interstitial_v2.css b/chrome/browser/resources/ssl/interstitial_v2.css
index c3040b3..2306d66 100644
--- a/chrome/browser/resources/ssl/interstitial_v2.css
+++ b/chrome/browser/resources/ssl/interstitial_v2.css
@@ -68,6 +68,11 @@ h1 {
line-height: 1.25em;
}
+h2 {
+ font-size: 1.2em;
+ font-weight: normal;
+}
+
.hidden {
display: none;
}
@@ -112,7 +117,8 @@ h1 {
.safe-browsing a,
.safe-browsing #details,
.safe-browsing #details-button,
-.safe-browsing h1 {
+.safe-browsing h1,
+.safe-browsing h2 {
color: white;
}
diff --git a/chrome/browser/resources/ssl/interstitial_v2.js b/chrome/browser/resources/ssl/interstitial_v2.js
index a70b7bd..52becaf 100644
--- a/chrome/browser/resources/ssl/interstitial_v2.js
+++ b/chrome/browser/resources/ssl/interstitial_v2.js
@@ -11,10 +11,12 @@ function setupEvents() {
var overridable = loadTimeData.getBoolean('overridable');
var ssl = loadTimeData.getBoolean('ssl');
- if (ssl)
+ if (ssl) {
$('body').classList.add('ssl');
- else
+ } else {
$('body').classList.add('safe-browsing');
+ setupMalwareFinchExperiment();
+ }
$('primary-button').addEventListener('click', function() {
if (!ssl)
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
index bd285c1..467b8bf 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
@@ -117,19 +117,6 @@ const char kDisplayCheckBox[] = "displaycheckbox";
base::LazyInstance<SafeBrowsingBlockingPage::UnsafeResourceMap>
g_unsafe_resource_map = LAZY_INSTANCE_INITIALIZER;
-// These are the conditions for the summer 2013 Finch experiment.
-// TODO(felt): Get rid of these now that experiment has ended.
-const char kMalwareStudyName[] = "InterstitialMalware310";
-const char kPhishingStudyName[] = "InterstitialPhishing564";
-const char kCond7MalwareFearMsg[] = "cond7MalwareFearMsg";
-const char kCond8PhishingFearMsg[] = "cond8PhishingFearMsg";
-const char kCond9MalwareCollabMsg[] = "cond9MalwareCollabMsg";
-const char kCond10PhishingCollabMsg[] = "cond10PhishingCollabMsg";
-const char kCond11MalwareQuestion[] = "cond11MalwareQuestion";
-const char kCond12PhishingQuestion[] = "cond12PhishingQuestion";
-const char kCond13MalwareGoBack[] = "cond13MalwareGoBack";
-const char kCond14PhishingGoBack[] = "cond14PhishingGoBack";
-
// This enum is used for a histogram. Don't reorder, delete, or insert
// elements. New elements should be added before MAX_ACTION only.
enum DetailedDecision {
@@ -150,19 +137,58 @@ void RecordDetailedUserAction(DetailedDecision decision) {
MAX_DETAILED_ACTION);
}
-// These are the constants for the M37 Finch trial.
-const char kV3StudyName[] = "MalwareInterstitialVersion";
-const char kCondUseV2[] = "V2";
-
-// Default to V3 unless a flag or field trial says otherwise.
-bool Version3Enabled() {
+// Constants for the M37 Finch trial.
+const char kV3StudyName[] = "MalwareInterstitialVersion";
+const char kCondV2[] = "V2";
+const char kCondV3[] = "V3";
+const char kCondV3Advice[] = "V3Advice";
+const char kCondV3Social[] = "V3Social";
+const char kCondV3NotRecommend[] = "V3NotRecommend";
+const char kCondV3History[] = "V3History";
+
+// Default to V3 unless a flag or field trial says otherwise. Flags override
+// field trial settings.
+const char* GetTrialCondition() {
if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kMalwareInterstitialVersionV2)) {
- return false;
+ switches::kMalwareInterstitialV2)) {
+ return kCondV2;
}
- if (base::FieldTrialList::FindFullName(kV3StudyName) == kCondUseV2)
- return false;
- return true;
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kMalwareInterstitialV3)) {
+ return kCondV3;
+ }
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kMalwareInterstitialV3Advice)) {
+ return kCondV3Advice;
+ }
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kMalwareInterstitialV3Social)) {
+ return kCondV3Social;
+ }
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kMalwareInterstitialV3NotRecommend)) {
+ return kCondV3NotRecommend;
+ }
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kMalwareInterstitialV3History)) {
+ return kCondV3History;
+ }
+
+ // Make sure that the return value is one of the expected types instead of
+ // directly returning base::FieldTrialList::FindFullName.
+ if (base::FieldTrialList::FindFullName(kV3StudyName) == kCondV2)
+ return kCondV2;
+ if (base::FieldTrialList::FindFullName(kV3StudyName) == kCondV3)
+ return kCondV3;
+ if (base::FieldTrialList::FindFullName(kV3StudyName) == kCondV3Advice)
+ return kCondV3Advice;
+ if (base::FieldTrialList::FindFullName(kV3StudyName) == kCondV3Social)
+ return kCondV3Social;
+ if (base::FieldTrialList::FindFullName(kV3StudyName) == kCondV3NotRecommend)
+ return kCondV3NotRecommend;
+ if (base::FieldTrialList::FindFullName(kV3StudyName) == kCondV3History)
+ return kCondV3History;
+ return kCondV3;
}
} // namespace
@@ -190,11 +216,11 @@ class SafeBrowsingBlockingPageFactoryImpl
unsafe_resources[0].threat_type == SB_THREAT_TYPE_URL_PHISHING ||
unsafe_resources[0].threat_type ==
SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL)) {
- if (Version3Enabled()) {
- return new SafeBrowsingBlockingPageV3(ui_manager, web_contents,
+ if (GetTrialCondition() == kCondV2) {
+ return new SafeBrowsingBlockingPageV2(ui_manager, web_contents,
unsafe_resources);
} else {
- return new SafeBrowsingBlockingPageV2(ui_manager, web_contents,
+ return new SafeBrowsingBlockingPageV3(ui_manager, web_contents,
unsafe_resources);
}
}
@@ -1041,18 +1067,6 @@ SafeBrowsingBlockingPageV2::SafeBrowsingBlockingPageV2(
WebContents* web_contents,
const UnsafeResourceList& unsafe_resources)
: SafeBrowsingBlockingPage(ui_manager, web_contents, unsafe_resources) {
- if (unsafe_resources_[0].threat_type == SB_THREAT_TYPE_URL_MALWARE ||
- unsafe_resources_[0].threat_type ==
- SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL) {
- trialCondition_ =
- base::FieldTrialList::FindFullName(kMalwareStudyName);
- } else if (unsafe_resources_[0].threat_type ==
- SB_THREAT_TYPE_URL_PHISHING ||
- unsafe_resources_[0].threat_type ==
- SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL) {
- trialCondition_ =
- base::FieldTrialList::FindFullName(kPhishingStudyName);
- }
}
std::string SafeBrowsingBlockingPageV2::GetHTMLContents() {
@@ -1110,36 +1124,6 @@ void SafeBrowsingBlockingPageV2::PopulateStringDictionary(
IDS_SAFE_BROWSING_MALWARE_V2_SEE_MORE));
strings->SetString("proceed",
l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_V2_PROCEED_LINK));
-
- // Field trial
- strings->SetString("trialType", trialCondition_);
- if (trialCondition_ == kCond7MalwareFearMsg) {
- strings->SetString("headLine",
- l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_FEAR_HEADLINE));
- } else if (trialCondition_ == kCond8PhishingFearMsg) {
- strings->SetString("headLine",
- l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_FEAR_HEADLINE));
- } else if (trialCondition_ == kCond9MalwareCollabMsg) {
- strings->SetString("headLine",
- l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_COLLAB_HEADLINE));
- } else if (trialCondition_ == kCond10PhishingCollabMsg) {
- strings->SetString("headLine",
- l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_COLLAB_HEADLINE));
- } else if (trialCondition_ == kCond11MalwareQuestion) {
- strings->SetString("headLine",
- l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_QUESTION_HEADLINE));
- } else if (trialCondition_ == kCond12PhishingQuestion) {
- strings->SetString("headLine",
- l10n_util::GetStringUTF16(
- IDS_SAFE_BROWSING_PHISHING_QUESTION_HEADLINE));
- } else if (trialCondition_ == kCond13MalwareGoBack) {
- strings->SetString("headLine",
- l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_BACK_HEADLINE));
- } else if (trialCondition_ == kCond14PhishingGoBack) {
- strings->SetString("headLine",
- l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_BACK_HEADLINE));
- }
-
webui::SetFontAndTextDirection(strings);
}
@@ -1253,7 +1237,8 @@ SafeBrowsingBlockingPageV3::SafeBrowsingBlockingPageV3(
SafeBrowsingUIManager* ui_manager,
WebContents* web_contents,
const UnsafeResourceList& unsafe_resources)
- : SafeBrowsingBlockingPage(ui_manager, web_contents, unsafe_resources) {
+ : SafeBrowsingBlockingPage(ui_manager, web_contents, unsafe_resources),
+ trial_condition_(GetTrialCondition()) {
}
std::string SafeBrowsingBlockingPageV3::GetHTMLContents() {
@@ -1310,25 +1295,64 @@ std::string SafeBrowsingBlockingPageV3::GetHTMLContents() {
void SafeBrowsingBlockingPageV3::PopulateMalwareLoadTimeData(
base::DictionaryValue* load_time_data) {
+ load_time_data->SetString("trialCondition", trial_condition_);
load_time_data->SetBoolean("phishing", false);
load_time_data->SetString(
"heading", l10n_util::GetStringUTF16(IDS_MALWARE_V3_HEADING));
load_time_data->SetString(
"primaryParagraph",
l10n_util::GetStringUTF16(IDS_MALWARE_V3_PRIMARY_PARAGRAPH));
- load_time_data->SetString(
- "explanationParagraph",
- is_main_frame_load_blocked_ ?
- l10n_util::GetStringFUTF16(
- IDS_MALWARE_V3_EXPLANATION_PARAGRAPH,
- base::UTF8ToUTF16(url_.host())) :
- l10n_util::GetStringFUTF16(
- IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_SUBRESOURCE,
- base::UTF8ToUTF16(web_contents_->GetURL().host()),
- base::UTF8ToUTF16(url_.host())));
- load_time_data->SetString(
- "finalParagraph",
- l10n_util::GetStringUTF16(IDS_MALWARE_V3_PROCEED_PARAGRAPH));
+ if (trial_condition_ == kCondV3History) {
+ load_time_data->SetString(
+ "explanationParagraph",
+ is_main_frame_load_blocked_ ?
+ l10n_util::GetStringFUTF16(
+ IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_HISTORY,
+ base::UTF8ToUTF16(url_.host())) :
+ l10n_util::GetStringFUTF16(
+ IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_SUBRESOURCE_HISTORY,
+ base::UTF8ToUTF16(web_contents_->GetURL().host()),
+ base::UTF8ToUTF16(url_.host())));
+ } else if (trial_condition_ == kCondV3Advice) {
+ load_time_data->SetString(
+ "explanationParagraph",
+ is_main_frame_load_blocked_ ?
+ l10n_util::GetStringFUTF16(
+ IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_ADVICE,
+ base::UTF8ToUTF16(url_.host())) :
+ l10n_util::GetStringFUTF16(
+ IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_SUBRESOURCE_ADVICE,
+ base::UTF8ToUTF16(web_contents_->GetURL().host()),
+ base::UTF8ToUTF16(url_.host())));
+ load_time_data->SetString(
+ "adviceHeading",
+ l10n_util::GetStringUTF16(IDS_MALWARE_V3_ADVICE_HEADING));
+ } else {
+ load_time_data->SetString(
+ "explanationParagraph",
+ is_main_frame_load_blocked_ ?
+ l10n_util::GetStringFUTF16(
+ IDS_MALWARE_V3_EXPLANATION_PARAGRAPH,
+ base::UTF8ToUTF16(url_.host())) :
+ l10n_util::GetStringFUTF16(
+ IDS_MALWARE_V3_EXPLANATION_PARAGRAPH_SUBRESOURCE,
+ base::UTF8ToUTF16(web_contents_->GetURL().host()),
+ base::UTF8ToUTF16(url_.host())));
+ }
+ if (trial_condition_ == kCondV3Social) {
+ load_time_data->SetString(
+ "finalParagraph",
+ l10n_util::GetStringUTF16(IDS_MALWARE_V3_PROCEED_PARAGRAPH_SOCIAL));
+ } else if (trial_condition_ == kCondV3NotRecommend) {
+ load_time_data->SetString(
+ "finalParagraph",
+ l10n_util::GetStringUTF16(
+ IDS_MALWARE_V3_PROCEED_PARAGRAPH_NOT_RECOMMEND));
+ } else {
+ load_time_data->SetString(
+ "finalParagraph",
+ l10n_util::GetStringUTF16(IDS_MALWARE_V3_PROCEED_PARAGRAPH));
+ }
load_time_data->SetBoolean(kDisplayCheckBox, CanShowMalwareDetailsOption());
if (CanShowMalwareDetailsOption()) {
@@ -1357,6 +1381,7 @@ void SafeBrowsingBlockingPageV3::PopulateMalwareLoadTimeData(
void SafeBrowsingBlockingPageV3::PopulatePhishingLoadTimeData(
base::DictionaryValue* load_time_data) {
+ load_time_data->SetString("trialCondition", std::string());
load_time_data->SetBoolean("phishing", true);
load_time_data->SetString(
"heading",
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h
index 51ec776..6b9f232 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h
@@ -281,9 +281,6 @@ class SafeBrowsingBlockingPageV2 : public SafeBrowsingBlockingPage {
const base::string16& description2,
const base::string16& description3);
- // For the FieldTrial: this contains the name of the condition.
- std::string trialCondition_;
-
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageV2);
};
@@ -302,6 +299,9 @@ class SafeBrowsingBlockingPageV3 : public SafeBrowsingBlockingPage {
void PopulateMalwareLoadTimeData(base::DictionaryValue* load_time_data);
void PopulatePhishingLoadTimeData(base::DictionaryValue* load_time_data);
+ // For the M37 FieldTrial: this contains the name of the condition.
+ std::string trial_condition_;
+
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageV3);
};
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 45420cc..5ffdd73 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -809,8 +809,13 @@ const char kLoadComponentExtension[] = "load-component-extension";
const char kLoadExtension[] = "load-extension";
// Controls which version of the malware and phishing interstitials is shown.
-const char kMalwareInterstitialVersionV2[] = "malware-interstitial-v2";
-const char kMalwareInterstitialVersionV3[] = "malware-interstitial-v3";
+const char kMalwareInterstitialV2[] = "malware-interstitial-v2";
+const char kMalwareInterstitialV3[] = "malware-interstitial-v3";
+const char kMalwareInterstitialV3Advice[] = "malware-interstitial-v3-advice";
+const char kMalwareInterstitialV3Social[] = "malware-interstitial-v3-social";
+const char kMalwareInterstitialV3NotRecommend[] =
+ "malware-interstitial-v3-not-recommend";
+const char kMalwareInterstitialV3History[] = "malware-interstitial-v3-history";
// Makes Chrome default browser
const char kMakeDefaultBrowser[] = "make-default-browser";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 9e41b6a..406283a 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -228,8 +228,12 @@ extern const char kLedgerTracingToken[];
extern const char kLimitedInstallFromWebstore[];
extern const char kLoadComponentExtension[];
extern const char kLoadExtension[];
-extern const char kMalwareInterstitialVersionV2[];
-extern const char kMalwareInterstitialVersionV3[];
+extern const char kMalwareInterstitialV2[];
+extern const char kMalwareInterstitialV3[];
+extern const char kMalwareInterstitialV3Advice[];
+extern const char kMalwareInterstitialV3Social[];
+extern const char kMalwareInterstitialV3NotRecommend[];
+extern const char kMalwareInterstitialV3History[];
extern const char kMakeDefaultBrowser[];
extern const char kSupervisedUserId[];
extern const char kSupervisedUserSyncToken[];