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

Unified Diff: chrome/browser/resources/safe_browsing/malware_block_v2.js

Issue 14752005: Finch experiments on SSL, malware, and phishing interstitials (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Browsertest trybot fix Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/safe_browsing/malware_block_v2.js
diff --git a/chrome/browser/resources/safe_browsing/malware_block_v2.js b/chrome/browser/resources/safe_browsing/malware_block_v2.js
index 61550d9a1dbd4cfe99589b20aa6846396dad7e33..3e43131251c585313e1471ce714266a8aad58e6f 100644
--- a/chrome/browser/resources/safe_browsing/malware_block_v2.js
+++ b/chrome/browser/resources/safe_browsing/malware_block_v2.js
@@ -38,6 +38,25 @@ function seeMore() {
}
}
+/* This sets up 4 conditions for the Field Trial.
+ * The 'NoBrand' conditions don't have the Chrome/Chromium logo at the top.
+ * The 'OneStep' conditions don't hide the proceed button.
+ */
+function setupInterstitialExperiment() {
+ var condition = templateData.trialType;
+ if (condition == '' || condition == 'Default') {
+ return; // This is the most common case.
Dan Beam 2013/05/07 08:07:16 make this 1 line, don't use } else { after a retur
+ } else if (condition == 'cond2MalwareNoBrand' ||
+ condition == 'cond4PhishingNoBrand') {
+ $('logo').style.display = 'none';
Dan Beam 2013/05/07 08:07:16 why are you using .display = 'none'; here vs. hidd
+ } else if (condition == 'cond5MalwareOneStep' ||
+ condition == 'cond6PhishingOneStep') {
+ $('see-more-contents').hidden = false;
+ $('see-less-text').hidden = true;
+ $('see-more-text').hidden = true;
+ }
+}
+
/**
* Onload listener to initialize javascript handlers.
*/
@@ -71,6 +90,8 @@ document.addEventListener('DOMContentLoaded', function() {
// handler, we don't want the default actions.
preventDefaultOnPoundLinkClicks(); // From webui/js/util.js.
+ setupInterstitialExperiment();
+
// Allow jsdisplay elements to be visible now.
document.documentElement.classList.remove('loading');
});

Powered by Google App Engine
This is Rietveld 408576698