Commit 06209e69 authored by felt@chromium.org's avatar felt@chromium.org

Delete the Safe Browsing V2 interstitial and Finch trial

BUG=396275

Review URL: https://codereview.chromium.org/445493002

Cr-Commit-Position: refs/heads/master@{#288472}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288472 0039d316-1c4b-4281-b951-d872f2087c98
parent 7e392798
This diff is collapsed.
......@@ -431,25 +431,6 @@ const Experiment::Choice kAnswersInSuggestChoices[] = {
};
#endif
// Using independent flags (instead of flag=value flags) to be able to
// associate the version with a FieldTrial. FieldTrials don't currently support
// flag=value flags.
const Experiment::Choice kMalwareInterstitialVersions[] = {
{ IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
{ IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V2,
switches::kMalwareInterstitialV2, "" },
{ IDS_FLAGS_MALWARE_INTERSTITIAL_VERSION_V3,
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)
const Experiment::Choice kEnableFileManagerMTPChoices[] = {
{ IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" },
......@@ -1885,13 +1866,6 @@ const Experiment kExperiments[] = {
MULTI_VALUE_TYPE(kAnswersInSuggestChoices)
},
#endif
{
"malware-interstitial-version",
IDS_FLAGS_MALWARE_INTERSTITIAL_TRIAL_NAME,
IDS_FLAGS_MALWARE_INTERSTITIAL_TRIAL_DESCRIPTION,
kOsAll,
MULTI_VALUE_TYPE(kMalwareInterstitialVersions)
},
#if defined(OS_ANDROID)
{
"enable-data-reduction-proxy-dev",
......
......@@ -79,7 +79,6 @@
</if>
<structure name="IDR_READER_OUT_OF_DATE_HTML" file="resources\reader_out_of_date.html" flattenhtml="true" type="chrome_html" />
<structure name="IRD_SSL_INTERSTITIAL_V2_HTML" file="resources\ssl\interstitial_v2.html" flattenhtml="true" type="chrome_html" />
<structure name="IDR_SAFE_BROWSING_MALWARE_BLOCK_V2" file="resources\safe_browsing\malware_block_v2.html" flattenhtml="true" type="chrome_html" />
</structures>
<includes>
<if expr="is_win">
......
/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
html.loading [jsdisplay] {
display: none;
}
[hidden] {
display: none !important;
}
body {
background: url('images/stripe.png') rgb(140, 0, 0);
margin: 0;
}
.box {
-webkit-border-radius: 5px;
-webkit-box-shadow: 3px 3px 8px rgb(140, 0, 0);
background-color: white;
color: rgb(75, 75, 77);
margin: 40px auto;
padding: 40px;
text-align: start;
width: 700px;
}
.float {
float: right;
}
html[dir='rtl'] .float {
float: left;
}
.icon {
margin-top: 23px;
}
.clear {
clear: both;
}
#logo {
content: -webkit-image-set(
url('../../../app/theme/%DISTRIBUTION%/product_logo_name_48.png') 1x,
url('../../../app/theme/%DISTRIBUTION%/product_logo_name_96.png') 2x);
max-width: 100%;
}
#headline {
-webkit-margin-end: 260px;
color: #333;
font-size: 22px;
font-weight: bold;
margin-top: 20px;
}
.main {
-webkit-margin-end: 260px;
font-size: 16px;
line-height: 22px;
margin-bottom: 21px;
margin-top: 14px;
}
.advanced {
-webkit-margin-start: 10px;
display: inline-block;
font-size: 13px;
}
footer {
font-size: 13px;
margin-top: 50px;
}
#learn-more-link {
display: inline-block;
font-size: 13px;
}
#privacy-link {
display: inline-block;
}
.submission {
-webkit-margin-end: 5px;
margin-bottom: 15px;
padding: 0;
}
button {
-webkit-box-shadow: inset 0 1px 0 0 rgb(129, 169, 243),
0 1px 2px rgba(0, 0, 0, .2);
background: -webkit-linear-gradient(rgb(112, 154, 241),
rgb(108, 148, 240) 44%, rgb(95, 132, 238));
border: 1px solid rgb(53, 116, 203);
border-radius: 3px;
color: white;
cursor: pointer;
display: inline-block;
font-size: 14px;
font-weight: bold;
line-height: 1;
padding: 11px 38px 10px 38px;
text-align: center;
text-decoration: none;
text-shadow: 0 -1px 0 rgb(72, 101, 228);
}
button:hover,
button:focus {
-webkit-box-shadow: inset 0 1px 0 0 rgb(129, 169, 243),
0 1px 2px rgba(0, 0, 0, .3);
background: -webkit-linear-gradient(rgb(165, 188, 245),
rgb(108, 148, 240) 70%, rgb(95, 132, 238));
border: 1px solid rgb(53, 116, 203);
}
button:active {
-webkit-box-shadow: inset 1px 1px 1px 1px rgba(0, 0, 0, .1);
background: -webkit-linear-gradient(rgb(112, 154, 241),
rgb(108, 148, 240) 44%, rgb(95, 132, 238));
border: 1px solid rgb(53, 116, 203);
}
a {
color: rgb(17, 84, 204);
}
a:link,
a:visited {
text-decoration: none;
}
a:hover,
a:active {
text-decoration: underline;
}
.checkbox {
margin-top: 11px;
position: relative;
}
.checkbox input {
-webkit-margin-start: 1px;
margin-top: 3px;
position: absolute;
}
.checkbox span {
-webkit-margin-start: 21px;
display: inline-block;
}
/* When the window is 860px or smaller, switch to dynamically scaling the
* contents. The text is also allowed to flow around the icon rather than
* staying in a separate column. The percentage values below are derived so
* that at 860px everything is the same size as the static values above, and
* then scales down smoothly from there. */
@media screen and (max-width: 860px) {
.box {
margin: 4.6%;
padding: 4.6%;
width: 81.6%;
}
.icon {
-webkit-margin-start: 2%;
margin-bottom: 2%;
max-width: 33%;
}
#headline,
.main {
-webkit-margin-end: 0;
}
}
<!DOCTYPE html>
<html id="template-root" class="loading" i18n-values="dir:textdirection">
<head>
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1">
<title i18n-content="title"></title>
<link rel="stylesheet" href="malware_block_v2.css">
<script src="../../../../ui/webui/resources/js/util.js"></script>
<script src="malware_block_v2.js"></script>
</head>
<body i18n-values=".style.fontFamily:fontfamily">
<div class="box">
<div>
<img id="logo" alt="">
</div>
<img id="malware-icon" class="float icon"
jsdisplay="!isPhishing && isMainFrame"
src="images/malware_icon_v2.png" alt="" />
<img id="subresource-icon" class="float icon"
jsdisplay="!isPhishing && !isMainFrame"
src="images/subresource_icon.png" alt="" />
<img id="phishing-icon" class="float icon" jsdisplay="isPhishing"
src="images/phishing_icon.png" alt="" />
<div id="headline" i18n-content="headLine"></div>
<div class="main" i18n-content="description1"></div>
<div class="main" i18n-content="description2"></div>
<div class="main">
<span i18n-content="description3"></span>
<a id="learn-more-link" href="#" i18n-content="learnMore"></a>
</div>
<div class="clear"></div>
<div class="submission">
<button id="back" i18n-content="back_button"></button>
<span id="see-more-contents" hidden>
<span class="advanced">
<a id="show-diagnostic-link" href="#" i18n-content="details"></a>
<a id="report-error-link" href="#"
i18n-content="report_error"></a>
</span>
<span id="proceed-span" class="advanced" hidden>
<a id="proceed" href="#" i18n-content="proceed"></a>
</span>
</span>
<a id="see-more-link" class="advanced" href="#">
<span id="see-more-text" i18n-content="seeMore"></span>
<span id="see-less-text" hidden>«</span>
</a>
</div>
<footer jsdisplay="displaycheckbox">
<hr>
<div class="checkbox">
<label>
<input id="check-report" type="checkbox"
jsvalues=".checked:boxchecked">
<span i18n-values=".innerHTML:confirm_text"></span>
</label>
</div>
</footer>
</div>
</body>
</html>
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* Sends a command message to SafeBrowsingBlockingPage::CommandReceived.
* @param {string} cmd The command to send.
*/
function sendCommand(cmd) {
window.domAutomationController.setAutomationId(1);
window.domAutomationController.send(cmd);
}
/**
* Records state of the reporting checkbox.
*/
function savePreference() {
var checkBox = $('check-report');
if (checkBox.checked)
sendCommand('doReport');
else
sendCommand('dontReport');
}
/**
* Expands or collapses the "see more" section of the page.
*/
function seeMore() {
if ($('see-less-text').hidden) {
$('see-more-text').hidden = true;
$('see-less-text').hidden = false;
$('see-more-contents').hidden = false;
sendCommand('expandedSeeMore');
} else {
$('see-more-text').hidden = false;
$('see-less-text').hidden = true;
$('see-more-contents').hidden = true;
}
}
/* 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 == 'cond2MalwareNoBrand' ||
condition == 'cond4PhishingNoBrand') {
$('logo').style.display = 'none';
} 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.
*/
document.addEventListener('DOMContentLoaded', function() {
$('proceed-span').hidden = templateData.proceedDisabled;
$('back').onclick = function() {
sendCommand('takeMeBack');
};
$('proceed').onclick = function(e) {
sendCommand('proceed');
};
$('learn-more-link').onclick = function(e) {
sendCommand('learnMore2');
};
$('show-diagnostic-link').onclick = function(e) {
sendCommand('showDiagnostic');
};
$('report-error-link').onclick = function(e) {
sendCommand('reportError');
};
$('see-more-link').onclick = function(e) {
seeMore();
// preventDefaultOnPoundLinkClicks doesn't work for this link since it
// contains <span>s, which confuse preventDefaultOnPoundLinkClicks.
e.preventDefault();
};
$('check-report').onclick = savePreference;
// All the links are handled by javascript sending commands back to the C++
// 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');
});
......@@ -33,13 +33,3 @@ 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);
}
......@@ -17,7 +17,6 @@ function setupEvents() {
$('error-code').classList.remove('hidden');
} else {
$('body').classList.add('safe-browsing');
setupMalwareFinchExperiment(); /* From safe_browsing_v3.js. */
}
$('primary-button').addEventListener('click', function() {
......
......@@ -89,16 +89,15 @@ class SafeBrowsingBlockingPage : public content::InterstitialPageDelegate {
}
// InterstitialPageDelegate method:
virtual std::string GetHTMLContents() OVERRIDE;
virtual void OnProceed() OVERRIDE;
virtual void OnDontProceed() OVERRIDE;
virtual void CommandReceived(const std::string& command) OVERRIDE;
virtual void OverrideRendererPrefs(
content::RendererPreferences* prefs) OVERRIDE;
virtual void OnProceed() OVERRIDE;
virtual void OnDontProceed() OVERRIDE;
protected:
template <class TestSBInterstitialPage>
friend class SafeBrowsingBlockingPageTest;
template <class TestSBInterstitialPage>
FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest,
ProceedThenDontProceed);
......@@ -121,10 +120,8 @@ class SafeBrowsingBlockingPage : public content::InterstitialPageDelegate {
return interstitial_page_;
}
template <class TestSBInterstitialPage>
FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest,
MalwareReportsTransitionDisabled);
template <class TestSBInterstitialPage>
FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest,
MalwareReportsToggling);
......@@ -239,91 +236,17 @@ class SafeBrowsingBlockingPage : public content::InterstitialPageDelegate {
int num_visits_;
base::CancelableTaskTracker request_tracker_;
private:
#if defined(ENABLE_EXTENSIONS)
scoped_ptr<extensions::ExperienceSamplingEvent> sampling_event_;
#endif
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPage);
};
class SafeBrowsingBlockingPageV1 : public SafeBrowsingBlockingPage {
public:
// Don't instantiate this class directly, use ShowBlockingPage instead.
SafeBrowsingBlockingPageV1(SafeBrowsingUIManager* ui_manager,
content::WebContents* web_contents,
const UnsafeResourceList& unsafe_resources);
// InterstitialPageDelegate method:
virtual std::string GetHTMLContents() OVERRIDE;
private:
// Fills the passed dictionary with the strings passed to JS Template when
// creating the HTML.
void PopulateMultipleThreatStringDictionary(base::DictionaryValue* strings);
void PopulateMalwareStringDictionary(base::DictionaryValue* strings);
void PopulatePhishingStringDictionary(base::DictionaryValue* strings);
// A helper method used by the Populate methods above used to populate common
// fields.
void PopulateStringDictionary(base::DictionaryValue* strings,
const base::string16& title,
const base::string16& headline,
const base::string16& description1,
const base::string16& description2,
const base::string16& description3);
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageV1);
};
class SafeBrowsingBlockingPageV2 : public SafeBrowsingBlockingPage {
public:
// Don't instantiate this class directly, use ShowBlockingPage instead.
SafeBrowsingBlockingPageV2(SafeBrowsingUIManager* ui_manager,
content::WebContents* web_contents,
const UnsafeResourceList& unsafe_resources);
// InterstitialPageDelegate method:
virtual std::string GetHTMLContents() OVERRIDE;
private:
// Fills the passed dictionary with the strings passed to JS Template when
// creating the HTML.
void PopulateMultipleThreatStringDictionary(base::DictionaryValue* strings);
void PopulateMalwareStringDictionary(base::DictionaryValue* strings);
void PopulatePhishingStringDictionary(base::DictionaryValue* strings);
// A helper method used by the Populate methods above used to populate common
// fields.
void PopulateStringDictionary(base::DictionaryValue* strings,
const base::string16& title,
const base::string16& headline,
const base::string16& description1,
const base::string16& description2,
const base::string16& description3);
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageV2);
};
class SafeBrowsingBlockingPageV3 : public SafeBrowsingBlockingPage {
public:
SafeBrowsingBlockingPageV3(SafeBrowsingUIManager* ui_manager,
content::WebContents* web_contents,
const UnsafeResourceList& unsafe_resources);
// InterstitialPageDelegate method:
virtual std::string GetHTMLContents() OVERRIDE;
private:
// Fills the passed dictionary with the values to be passed to the template
// when creating the HTML.
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_;
#if defined(ENABLE_EXTENSIONS)
scoped_ptr<extensions::ExperienceSamplingEvent> sampling_event_;
#endif
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageV3);
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPage);
};
// Factory for creating SafeBrowsingBlockingPage. Useful for tests.
......
......@@ -76,7 +76,7 @@ DownloadFeedbackDialogView::DownloadFeedbackDialogView(
views::MessageBoxView::InitParams(l10n_util::GetStringUTF16(
IDS_FEEDBACK_SERVICE_DIALOG_EXPLANATION)))),
link_view_(new views::Link(l10n_util::GetStringUTF16(
IDS_SAFE_BROWSING_PRIVACY_POLICY_PAGE_V2))),
IDS_SAFE_BROWSING_PRIVACY_POLICY_PAGE))),
title_text_(l10n_util::GetStringUTF16(IDS_FEEDBACK_SERVICE_DIALOG_TITLE)),
ok_button_text_(l10n_util::GetStringUTF16(
IDS_FEEDBACK_SERVICE_DIALOG_OK_BUTTON_LABEL)),
......
......@@ -788,15 +788,6 @@ const char kLoadComponentExtension[] = "load-component-extension";
// Loads an extension from the specified directory.
const char kLoadExtension[] = "load-extension";
// Controls which version of the malware and phishing interstitials is shown.
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";
......
......@@ -226,12 +226,6 @@ extern const char kLimitedInstallFromWebstore[];
extern const char kLoadComponentExtension[];
extern const char kLoadExtension[];
extern const char kMakeDefaultBrowser[];
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 kManualEnhancedBookmarks[];
extern const char kManualEnhancedBookmarksOptout[];
extern const char kMediaCacheSize[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment