Commit 66d936c0 authored by Andy Paicu's avatar Andy Paicu Committed by Commit Bot

Revert "Safebrowsing radio toggle addition to the security page"

This reverts commit 01d497a6.

Reason for revert: crubg.com/1060091

Original change's description:
> Safebrowsing radio toggle addition to the security page
> 
> Adding a new collapsible radio toggle to the security page that includes a third safebrowsing option (enhanced), with more thorough explanations for this third option and the already available standard and disabled options.
> 
> Bug: 1032584
> Change-Id: I6e4732ae464120d3d264b141dbb172aa125f9824
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2088851
> Commit-Queue: Theodore Olsauskas-Warren <sauski@google.com>
> Auto-Submit: Sean Harrison <harrisonsean@chromium.org>
> Reviewed-by: dpapad <dpapad@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#748394}

TBR=dpapad@chromium.org,aee@chromium.org,harrisonsean@chromium.org,sauski@google.com

Change-Id: I4859d2ed5db2352f4d64f014c5154d66b0825c4c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1032584
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2095127Reviewed-by: default avatarAndy Paicu <andypaicu@chromium.org>
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748609}
parent edc438b4
...@@ -1642,46 +1642,7 @@ ...@@ -1642,46 +1642,7 @@
Safe Browsing Safe Browsing
</message> </message>
<message name="IDS_SETTINGS_SAFEBROWSING_ENABLE_REPORTING_DESC" desc="Description for extended safe browsing"> <message name="IDS_SETTINGS_SAFEBROWSING_ENABLE_REPORTING_DESC" desc="Description for extended safe browsing">
Sends anonymous URLs of some pages you visit, limited system information, and some page content to help discover and block new threats against all users on the web. To detect dangerous apps and sites, Chrome sends URLs of some pages you visit, limited system information, and some page content to Google
</message>
<message name="IDS_SETTINGS_SAFEBROWSING_ENHANCED" desc="Label for safe browsing enhanced protection mode">
Enhanced Protection
</message>
<message name="IDS_SETTINGS_SAFEBROWSING_ENHANCED_DESC" desc="Description of safe browsing enhanced protection mode">
Faster, proactive protection against dangerous websites, downloads, and extensions. Warns you about password breaches. Requires browsing data to be sent to Google.
</message>
<message name="IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_ONE" desc="First bullet point under the safe browsing enhanced protection mode">
Predicts and warns you about dangerous events before they happen.
</message>
<message name="IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_TWO" desc="Second bullet point under the safe browsing enhanced protection mode">
Keeps you safe on Chrome and other Google apps when you’re signed in.
</message>
<message name="IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_THREE" desc="Third bullet point under the safe browsing enhanced protection mode">
Improves security for you and everyone on the web.
</message>
<message name="IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_FOUR" desc="Fourth bullet point under the safe browsing enhanced protection mode">
Warns you if passwords are exposed in a data breach.
</message>
<message name="IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_FIVE" desc="Fourth bullet point under the safe browsing enhanced protection mode">
Sends URLs to Safe Browsing to check them. Also sends a small sample of pages, downloads, extension activity, and system information to help discover new threats. Temporarily links this data to your Google Account when you're signed in, to protect you across Google apps.
</message>
<message name="IDS_SETTINGS_SAFEBROWSING_STANDARD" desc="Label for safe browsing standard protection mode">
Standard Protection
</message>
<message name="IDS_SETTINGS_SAFEBROWSING_STANDARD_DESC" desc="Description for safe browsing standard protection mode">
Standard protection against websites, downloads, and extensions that are known to be dangerous.
</message>
<message name="IDS_SETTINGS_SAFEBROWSING_STANDARD_BULLET_ONE" desc="First bullet point under the safe browsing standard protection mode">
Detects and warns you about dangerous events when they happen.
</message>
<message name="IDS_SETTINGS_SAFEBROWSING_STANDARD_BULLET_TWO" desc="First bullet point under the safe browsing standard protection mode">
Checks URLs with a list of unsafe sites stored in Chrome. If a site tries to steal your password, or when you download a harmful file, Chrome may also send URLs, including bits of page content, to Safe Browsing.
</message>
<message name="IDS_SETTINGS_SAFEBROWSING_NONE" desc="Label for safe browsing no protection mode">
No Protection (not recommended)
</message>
<message name="IDS_SETTINGS_SAFEBROWSING_NONE_DESC" desc="Description for safe browsing no protection mode">
Does not protect you against dangerous websites, downloads, or extensions.
</message> </message>
<message name="IDS_SETTINGS_ENABLE_DO_NOT_TRACK" desc="The label of the checkbox to enable/disable sending the 'Do Not track' header"> <message name="IDS_SETTINGS_ENABLE_DO_NOT_TRACK" desc="The label of the checkbox to enable/disable sending the 'Do Not track' header">
Send a "Do Not Track" request with your browsing traffic Send a "Do Not Track" request with your browsing traffic
......
...@@ -250,15 +250,11 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() { ...@@ -250,15 +250,11 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() {
(*s_whitelist)[::prefs::kDnsOverHttpsTemplates] = (*s_whitelist)[::prefs::kDnsOverHttpsTemplates] =
settings_api::PrefType::PREF_TYPE_STRING; settings_api::PrefType::PREF_TYPE_STRING;
// Security page // Sync and personalization page.
(*s_whitelist)[::prefs::kSafeBrowsingEnabled] = (*s_whitelist)[::prefs::kSafeBrowsingEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN; settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kSafeBrowsingEnhanced] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kSafeBrowsingScoutReportingEnabled] = (*s_whitelist)[::prefs::kSafeBrowsingScoutReportingEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN; settings_api::PrefType::PREF_TYPE_BOOLEAN;
// Sync and personalization page.
(*s_whitelist)[::prefs::kSearchSuggestEnabled] = (*s_whitelist)[::prefs::kSearchSuggestEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN; settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist) (*s_whitelist)
......
...@@ -60,10 +60,6 @@ NOTE: Chrome OS icons go in ./chromeos/os_icons.html. ...@@ -60,10 +60,6 @@ NOTE: Chrome OS icons go in ./chromeos/os_icons.html.
<path d="M10,15 L6,11.1783439 L7.41,9.83121019 L10,12.2961783 L16.59,6 L18,7.3566879 L10,15 Z M21,3 L3,3 C1.89,3 1,3.89 1,5 L1,17 C1,18.1 1.89,19 3,19 L8,19 L8,21 L16,21 L16,19 L21,19 C22.1,19 22.99,18.1 22.99,17 L23,5 C23,3.89 22.1,3 21,3 Z M21,17 L3,17 L3,5 L21,5 L21,17 Z"></path> <path d="M10,15 L6,11.1783439 L7.41,9.83121019 L10,12.2961783 L16.59,6 L18,7.3566879 L10,15 Z M21,3 L3,3 C1.89,3 1,3.89 1,5 L1,17 C1,18.1 1.89,19 3,19 L8,19 L8,21 L16,21 L16,19 L21,19 C22.1,19 22.99,18.1 22.99,17 L23,5 C23,3.89 22.1,3 21,3 Z M21,17 L3,17 L3,5 L21,5 L21,17 Z"></path>
</g> </g>
<!-- Safebrowsing SVG -->
<g id="public"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"></path></g>
<g id="web"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-5 14H4v-4h11v4zm0-5H4V9h11v4zm5 5h-4V9h4v9z"></path></g>
<!-- vr-headset SVG obtained from amyroberts@ --> <!-- vr-headset SVG obtained from amyroberts@ -->
<g id="vr-headset"><path d="M18.477.678A2.54 2.54 0 0016.73 0H2.47C1.811 0 1.19.24.723.678A2.229 2.229 0 000 2.315v7.37c0 .618.256 1.2.723 1.637A2.54 2.54 0 002.47 12h3.424c.448 0 .884-.114 1.268-.33.384-.216.697-.522.908-.893l.967-1.68a.572.572 0 01.16-.74.67.67 0 01.806 0c.235.18.302.49.16.74l.967 1.68c.21.365.524.677.908.893.384.216.82.33 1.268.33h3.424c.659 0 1.28-.24 1.747-.678.467-.437.723-1.02.723-1.637v-7.37c0-.618-.256-1.2-.723-1.637zM5.4 7.8C4.072 7.8 3 6.72 3 5.4 3 4.08 4.08 3 5.4 3c1.32 0 2.4 1.08 2.4 2.4 0 1.32-1.072 2.4-2.4 2.4zm8.4 0c-1.328 0-2.4-1.08-2.4-2.4 0-1.32 1.08-2.4 2.4-2.4 1.32 0 2.4 1.08 2.4 2.4 0 1.32-1.072 2.4-2.4 2.4z"></path></g> <g id="vr-headset"><path d="M18.477.678A2.54 2.54 0 0016.73 0H2.47C1.811 0 1.19.24.723.678A2.229 2.229 0 000 2.315v7.37c0 .618.256 1.2.723 1.637A2.54 2.54 0 002.47 12h3.424c.448 0 .884-.114 1.268-.33.384-.216.697-.522.908-.893l.967-1.68a.572.572 0 01.16-.74.67.67 0 01.806 0c.235.18.302.49.16.74l.967 1.68c.21.365.524.677.908.893.384.216.82.33 1.268.33h3.424c.659 0 1.28-.24 1.747-.678.467-.437.723-1.02.723-1.637v-7.37c0-.618-.256-1.2-.723-1.637zM5.4 7.8C4.072 7.8 3 6.72 3 5.4 3 4.08 4.08 3 5.4 3c1.32 0 2.4 1.08 2.4 2.4 0 1.32-1.072 2.4-2.4 2.4zm8.4 0c-1.328 0-2.4-1.08-2.4-2.4 0-1.32 1.08-2.4 2.4-2.4 1.32 0 2.4 1.08 2.4 2.4 0 1.32-1.072 2.4-2.4 2.4z"></path></g>
......
...@@ -183,7 +183,6 @@ js_library("security_page") { ...@@ -183,7 +183,6 @@ js_library("security_page") {
"../people_page:sync_browser_proxy", "../people_page:sync_browser_proxy",
"../prefs:prefs_behavior", "../prefs:prefs_behavior",
"//ui/webui/resources/js:load_time_data", "//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js:web_ui_listener_behavior",
] ]
} }
......
...@@ -28,6 +28,7 @@ Polymer({ ...@@ -28,6 +28,7 @@ Polymer({
/** @private */ /** @private */
onCheckedChanged_() { onCheckedChanged_() {
// The iron-collapse should open when a user selects the radio button.
this.expanded = this.checked; this.expanded = this.checked;
}, },
}); });
...@@ -24,8 +24,7 @@ ...@@ -24,8 +24,7 @@
sub-label="[[getPasswordsLeakDetectionSubLabel_( sub-label="[[getPasswordsLeakDetectionSubLabel_(
userSignedIn_, passwordsLeakDetectionAvailable_)]]" userSignedIn_, passwordsLeakDetectionAvailable_)]]"
disabled="[[getDisabledLeakDetection_( disabled="[[getDisabledLeakDetection_(
userSignedIn_, prefs.safebrowsing.enabled.value, userSignedIn_, prefs.safebrowsing.enabled.value)]]"
prefs.safebrowsing.enhanced.value)]]"
on-settings-boolean-control-change="onPasswordsLeakDetectionChange_"> on-settings-boolean-control-change="onPasswordsLeakDetectionChange_">
</settings-toggle-button> </settings-toggle-button>
</template> </template>
......
...@@ -80,7 +80,8 @@ Polymer({ ...@@ -80,7 +80,8 @@ Polymer({
if (this.prefs === undefined) { if (this.prefs === undefined) {
return false; return false;
} }
return !!this.getPref('profile.password_manager_leak_detection').value; return !!this.getPref('profile.password_manager_leak_detection').value &&
!!this.getPref('safebrowsing.enabled').value;
}, },
/** /**
...@@ -102,8 +103,7 @@ Polymer({ ...@@ -102,8 +103,7 @@ Polymer({
if (this.prefs === undefined) { if (this.prefs === undefined) {
return false; return false;
} }
return !this.userSignedIn_ || !this.getPref('safebrowsing.enabled').value || return !this.userSignedIn_ || !this.getPref('safebrowsing.enabled').value;
!!this.getPref('safebrowsing.enhanced').value;
}, },
/** @private */ /** @private */
......
<link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_radio_button/cr_radio_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_radio_group/cr_radio_group.html">
<link rel="import" href="chrome://resources/cr_elements/cr_link_row/cr_link_row.html"> <link rel="import" href="chrome://resources/cr_elements/cr_link_row/cr_link_row.html">
<link rel="import" href="collapse_radio_button.html"> <link rel="import" href="collapse_radio_button.html">
<link rel="import" href="passwords_leak_detection_toggle.html"> <link rel="import" href="passwords_leak_detection_toggle.html">
<link rel="import" href="privacy_page_browser_proxy.html"> <link rel="import" href="privacy_page_browser_proxy.html">
<link rel="import" href="secure_dns.html"> <link rel="import" href="secure_dns.html">
<link rel="import" href="collapse_radio_button.html">
<link rel="import" href="../controls/settings_toggle_button.html"> <link rel="import" href="../controls/settings_toggle_button.html">
<link rel="import" href="../icons.html">
<link rel="import" href="../metrics_browser_proxy.html"> <link rel="import" href="../metrics_browser_proxy.html">
<link rel="import" href="../prefs/prefs.html"> <link rel="import" href="../prefs/prefs.html">
<link rel="import" href="../prefs/prefs_behavior.html"> <link rel="import" href="../prefs/prefs_behavior.html">
...@@ -20,112 +15,26 @@ ...@@ -20,112 +15,26 @@
<dom-module id="settings-security-page"> <dom-module id="settings-security-page">
<template> <template>
<style include="settings-shared"> <style include="settings-shared"></style>
img { <div class="settings-box first line-only">
width: 100%;
}
.block {
display: block;
}
#labelWrapper {
padding-inline-start: var(--cr-button-edge-spacing);
}
.bullet-line {
align-items: center;
display: flex;
padding-bottom: 10px;
padding-top: 10px;
}
</style>
<img src="../images/safe_browsing_banner.svg">
<div class="settings-box block first">
<h2 class="first">$i18n{safeBrowsingSectionLabel}</h2> <h2 class="first">$i18n{safeBrowsingSectionLabel}</h2>
<cr-radio-group id="safeBrowsingRadio"
selected="[[selectSafeBrowsingRadio_]]"
selectable-elements="cr-radio-button, settings-collapse-radio-button"
on-selected-changed="onSafeBrowsingRadioChange_">
<settings-collapse-radio-button name="[[safeBrowsingEnum_.ENHANCED]]"
id="safeBrowsingEnhanced"
label="$i18n{safeBrowsingEnhanced}"
sub-label="$i18n{safeBrowsingEnhancedDesc}">
<div slot="collapse">
<div class="bullet-line">
<iron-icon icon="cr:security"></iron-icon>
<div id="labelWrapper" class="secondary">
$i18n{safeBrowsingEnhancedBulOne}
</div>
</div>
<div class="bullet-line">
<iron-icon icon="settings20:googleg"></iron-icon>
<div id="labelWrapper" class="secondary">
$i18n{safeBrowsingEnhancedBulTwo}
</div>
</div>
<div class="bullet-line">
<iron-icon icon="settings:public"></iron-icon>
<div id="labelWrapper" class="secondary">
$i18n{safeBrowsingEnhancedBulThree}
</div>
</div>
<div class="bullet-line">
<iron-icon icon="settings20:vpn-key"></iron-icon>
<div id="labelWrapper" class="secondary">
$i18n{safeBrowsingEnhancedBulFour}
</div>
</div>
<div class="bullet-line">
<iron-icon icon="settings:web"></iron-icon>
<div id="labelWrapper" class="secondary">
$i18n{safeBrowsingEnhancedBulFive}
</div>
</div>
</div>
</settings-collapse-radio-button>
<settings-collapse-radio-button name="[[safeBrowsingEnum_.STANDARD]]"
id="safeBrowsingStandard"
label="$i18n{safeBrowsingStandard}"
sub-label="$i18n{safeBrowsingStandardDesc}"
info-opened="{{infoOpened_}}">
<div slot="collapse">
<div class="bullet-line">
<iron-icon icon="cr:computer"></iron-icon>
<div id="labelWrapper" class="secondary">
$i18n{safeBrowsingStandardBulOne}
</div>
</div>
<div class="bullet-line">
<iron-icon icon="settings:web"></iron-icon>
<div id="labelWrapper" class="secondary">
$i18n{safeBrowsingStandardBulTwo}
</div>
</div>
<settings-toggle-button id="safeBrowsingReportingToggle"
pref="[[safeBrowsingReportingPref_]]" no-set-pref
class="settings-box first"
label="$i18n{safeBrowsingEnableExtendedReporting}"
sub-label="$i18n{safeBrowsingEnableExtendedReportingDesc}"
disabled="[[
getDisabledExtendedSafeBrowsing_(prefs.safebrowsing.*)]]"
on-settings-boolean-control-change=
"onSafeBrowsingReportingToggleChange_">
</settings-toggle-button>
<settings-passwords-leak-detection-toggle prefs="{{prefs}}"
sync-status="[[syncStatus]]">
</settings-passwords-leak-detection-toggle>
</div>
</settings-collapse-radio-button>
<cr-radio-button name="[[safeBrowsingEnum_.DISABLED]]"
id="safeBrowsingDisabled">
<div>
<div>$i18n{safeBrowsingNone}</div>
<div class="secondary">$i18n{safeBrowsingNoneDesc}</div>
</div>
</cr-radio-button>
</cr-radio-group>
</div> </div>
<settings-toggle-button id="safeBrowsingToggle"
pref="{{prefs.safebrowsing.enabled}}"
label="$i18n{safeBrowsingEnableProtection}"
sub-label="$i18n{safeBrowsingEnableProtectionDesc}">
</settings-toggle-button>
<settings-passwords-leak-detection-toggle prefs="{{prefs}}"
sync-status="[[syncStatus]]">
</settings-passwords-leak-detection-toggle>
<settings-toggle-button id="safeBrowsingReportingToggle"
pref="[[safeBrowsingReportingPref_]]" no-set-pref
label="$i18n{safeBrowsingEnableExtendedReporting}"
sub-label="$i18n{safeBrowsingEnableExtendedReportingDesc}"
disabled="[[getDisabledExtendedSafeBrowsing_(prefs.safebrowsing.*)]]"
on-settings-boolean-control-change=
"onSafeBrowsingReportingToggleChange_">
</settings-toggle-button>
<div class="settings-box first line-only"> <div class="settings-box first line-only">
<h2>$i18n{securityPageAdvancedSectionLabel}</h2> <h2>$i18n{securityPageAdvancedSectionLabel}</h2>
</div> </div>
......
...@@ -2,17 +2,6 @@ ...@@ -2,17 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
(function() {
/**
* Enumeration of all safe browsing modes.
* @enum {string}
*/
const SafeBrowsing = {
ENHANCED: 'enhanced',
STANDARD: 'standard',
DISABLED: 'disabled',
};
Polymer({ Polymer({
is: 'settings-security-page', is: 'settings-security-page',
...@@ -24,14 +13,6 @@ Polymer({ ...@@ -24,14 +13,6 @@ Polymer({
/** @type {settings.SyncStatus} */ /** @type {settings.SyncStatus} */
syncStatus: Object, syncStatus: Object,
/**
* Preferences state.
*/
prefs: {
type: Object,
notify: true,
},
/** /**
* Whether the secure DNS setting should be displayed. * Whether the secure DNS setting should be displayed.
* @private * @private
...@@ -44,21 +25,6 @@ Polymer({ ...@@ -44,21 +25,6 @@ Polymer({
}, },
}, },
/**
* Valid safe browsing states.
* @private
*/
safeBrowsingEnum_: {
type: Object,
value: SafeBrowsing,
},
/** @private */
selectSafeBrowsingRadio_: {
type: String,
computed: 'computeSelectSafeBrowsingRadio_(prefs.safeBrowsing.*)',
},
/** @private */ /** @private */
enableSecurityKeysSubpage_: { enableSecurityKeysSubpage_: {
type: Boolean, type: Boolean,
...@@ -79,54 +45,15 @@ Polymer({ ...@@ -79,54 +45,15 @@ Polymer({
}); });
}, },
}, },
/** @private {!Map<string, string>} */
focusConfig_: {
type: Object,
value() {
const map = new Map();
// <if expr="use_nss_certs">
if (settings.routes.CERTIFICATES) {
map.set(settings.routes.CERTIFICATES.path, '#manageCertificates');
}
// </if>
if (settings.routes.SECURITY_KEYS) {
map.set(
settings.routes.SECURITY_KEYS.path,
'#security-keys-subpage-trigger');
}
return map;
},
},
}, },
observers: [ observers: [
'onSafeBrowsingReportingPrefChange_(prefs.safebrowsing.*)', 'onSafeBrowsingReportingPrefChange_(prefs.safebrowsing.*)',
], ],
/**
* @return {string}
* @private
*/
computeSelectSafeBrowsingRadio_() {
if (this.prefs === undefined) {
return SafeBrowsing.STANDARD;
}
if (!this.getPref('safebrowsing.enabled').value) {
return SafeBrowsing.DISABLED;
}
return this.getPref('safebrowsing.enhanced').value ? SafeBrowsing.ENHANCED :
SafeBrowsing.STANDARD;
},
/** @private {settings.PrivacyPageBrowserProxy} */ /** @private {settings.PrivacyPageBrowserProxy} */
browserProxy_: null, browserProxy_: null,
/** @private {settings.MetricsBrowserProxy} */
metricsBrowserProxy_: null,
/** @override */ /** @override */
ready() { ready() {
this.browserProxy_ = settings.PrivacyPageBrowserProxyImpl.getInstance(); this.browserProxy_ = settings.PrivacyPageBrowserProxyImpl.getInstance();
...@@ -134,32 +61,12 @@ Polymer({ ...@@ -134,32 +61,12 @@ Polymer({
this.metricsBrowserProxy_ = settings.MetricsBrowserProxyImpl.getInstance(); this.metricsBrowserProxy_ = settings.MetricsBrowserProxyImpl.getInstance();
}, },
/**
* Updates the various underlying cookie prefs based on the newly selected
* radio button.
* @param {!CustomEvent<{value: string}>} event
* @private
*/
onSafeBrowsingRadioChange_: function(event) {
if (event.detail.value == SafeBrowsing.ENHANCED) {
this.setPrefValue('safebrowsing.enabled', true);
this.setPrefValue('safebrowsing.enhanced', true);
} else if (event.detail.value == SafeBrowsing.STANDARD) {
this.setPrefValue('safebrowsing.enabled', true);
this.setPrefValue('safebrowsing.enhanced', false);
} else { // disabled state
this.setPrefValue('safebrowsing.enabled', false);
this.setPrefValue('safebrowsing.enhanced', false);
}
},
/** /**
* @return {boolean} * @return {boolean}
* @private * @private
*/ */
getDisabledExtendedSafeBrowsing_() { getDisabledExtendedSafeBrowsing_() {
return !this.getPref('safebrowsing.enabled').value || return !this.getPref('safebrowsing.enabled').value;
!!this.getPref('safebrowsing.enhanced').value;
}, },
/** @private */ /** @private */
...@@ -176,10 +83,12 @@ Polymer({ ...@@ -176,10 +83,12 @@ Polymer({
} }
const safeBrowsingScoutPref = const safeBrowsingScoutPref =
this.getPref('safebrowsing.scout_reporting_enabled'); this.getPref('safebrowsing.scout_reporting_enabled');
const prefValue = !!this.getPref('safebrowsing.enabled').value &&
!!safeBrowsingScoutPref.value;
this.safeBrowsingReportingPref_ = { this.safeBrowsingReportingPref_ = {
key: '', key: '',
type: chrome.settingsPrivate.PrefType.BOOLEAN, type: chrome.settingsPrivate.PrefType.BOOLEAN,
value: !!safeBrowsingScoutPref.value, value: prefValue,
enforcement: safeBrowsingScoutPref.enforcement, enforcement: safeBrowsingScoutPref.enforcement,
controlledBy: safeBrowsingScoutPref.controlledBy, controlledBy: safeBrowsingScoutPref.controlledBy,
}; };
...@@ -209,4 +118,3 @@ Polymer({ ...@@ -209,4 +118,3 @@ Polymer({
settings.SettingsPageInteractions.PRIVACY_SECURITY_KEYS); settings.SettingsPageInteractions.PRIVACY_SECURITY_KEYS);
}, },
}); });
})();
...@@ -876,19 +876,19 @@ ...@@ -876,19 +876,19 @@
<structure name="IDR_SETTINGS_SECURE_DNS_INPUT_JS" <structure name="IDR_SETTINGS_SECURE_DNS_INPUT_JS"
file="privacy_page/secure_dns_input.js" file="privacy_page/secure_dns_input.js"
type="chrome_html" /> type="chrome_html" />
<!-- TODO(harrisonsean): remove flatten -->
<structure name="IDR_SETTINGS_SECURITY_PAGE_HTML" <structure name="IDR_SETTINGS_SECURITY_PAGE_HTML"
file="privacy_page/security_page.html" file="privacy_page/security_page.html"
type="chrome_html" type="chrome_html"
flattenhtml="true" preprocess="true" />
allowexternalscript="true" />
<structure name="IDR_SETTINGS_SECURITY_PAGE_JS" <structure name="IDR_SETTINGS_SECURITY_PAGE_JS"
file="privacy_page/security_page.js" file="privacy_page/security_page.js"
type="chrome_html" type="chrome_html"
preprocess="true" /> preprocess="true" />
<structure name="IDR_SETTINGS_PRIVACY_PAGE_HTML" <structure name="IDR_SETTINGS_PRIVACY_PAGE_HTML"
file="privacy_page/privacy_page.html" file="privacy_page/privacy_page.html"
type="chrome_html" /> type="chrome_html"
flattenhtml="true"
allowexternalscript="true" />
<structure name="IDR_SETTINGS_PRIVACY_PAGE_JS" <structure name="IDR_SETTINGS_PRIVACY_PAGE_JS"
file="privacy_page/privacy_page.js" file="privacy_page/privacy_page.js"
preprocess="true" preprocess="true"
......
...@@ -1082,26 +1082,6 @@ void AddPrivacyStrings(content::WebUIDataSource* html_source, ...@@ -1082,26 +1082,6 @@ void AddPrivacyStrings(content::WebUIDataSource* html_source,
IDS_SETTINGS_SAFEBROWSING_ENABLE_REPORTING}, IDS_SETTINGS_SAFEBROWSING_ENABLE_REPORTING},
{"safeBrowsingEnableExtendedReportingDesc", {"safeBrowsingEnableExtendedReportingDesc",
IDS_SETTINGS_SAFEBROWSING_ENABLE_REPORTING_DESC}, IDS_SETTINGS_SAFEBROWSING_ENABLE_REPORTING_DESC},
{"safeBrowsingEnhanced", IDS_SETTINGS_SAFEBROWSING_ENHANCED},
{"safeBrowsingEnhancedDesc", IDS_SETTINGS_SAFEBROWSING_ENHANCED_DESC},
{"safeBrowsingEnhancedBulOne",
IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_ONE},
{"safeBrowsingEnhancedBulTwo",
IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_TWO},
{"safeBrowsingEnhancedBulThree",
IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_THREE},
{"safeBrowsingEnhancedBulFour",
IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_FOUR},
{"safeBrowsingEnhancedBulFive",
IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_FIVE},
{"safeBrowsingStandard", IDS_SETTINGS_SAFEBROWSING_STANDARD},
{"safeBrowsingStandardDesc", IDS_SETTINGS_SAFEBROWSING_STANDARD_DESC},
{"safeBrowsingStandardBulOne",
IDS_SETTINGS_SAFEBROWSING_STANDARD_BULLET_ONE},
{"safeBrowsingStandardBulTwo",
IDS_SETTINGS_SAFEBROWSING_STANDARD_BULLET_TWO},
{"safeBrowsingNone", IDS_SETTINGS_SAFEBROWSING_NONE},
{"safeBrowsingNoneDesc", IDS_SETTINGS_SAFEBROWSING_NONE_DESC},
{"safeBrowsingEnableProtection", {"safeBrowsingEnableProtection",
IDS_SETTINGS_SAFEBROWSING_ENABLEPROTECTION}, IDS_SETTINGS_SAFEBROWSING_ENABLEPROTECTION},
{"safeBrowsingEnableProtectionDesc", {"safeBrowsingEnableProtectionDesc",
......
...@@ -14,6 +14,10 @@ suite('CrCollapseRadioButton', function() { ...@@ -14,6 +14,10 @@ suite('CrCollapseRadioButton', function() {
Polymer.dom.flush(); Polymer.dom.flush();
}); });
teardown(function() {
collapseRadioButton.remove();
});
test('openOnSelection', function() { test('openOnSelection', function() {
const collapse = collapseRadioButton.$$('iron-collapse'); const collapse = collapseRadioButton.$$('iron-collapse');
collapseRadioButton.checked = false; collapseRadioButton.checked = false;
......
...@@ -978,8 +978,7 @@ TEST_F( ...@@ -978,8 +978,7 @@ TEST_F(
mocha.run(); mocha.run();
}); });
// TODO(sauski): Privacy page UMA changing, tests need updating/removal. TEST_F('CrSettingsPrivacyPageTest', 'UMALoggingTests', function() {
TEST_F('CrSettingsPrivacyPageTest', 'DISABLED_UMALoggingTests', function() {
settings_privacy_page.registerUMALoggingTests(); settings_privacy_page.registerUMALoggingTests();
mocha.run(); mocha.run();
}); });
...@@ -1996,6 +1995,7 @@ CrCollapseRadioButtonTest.prototype = { ...@@ -1996,6 +1995,7 @@ CrCollapseRadioButtonTest.prototype = {
browsePreload: 'chrome://settings/privacy_page/collapse_radio_button.html', browsePreload: 'chrome://settings/privacy_page/collapse_radio_button.html',
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'../test_util.js',
'collapse_radio_button_tests.js', 'collapse_radio_button_tests.js',
]), ]),
}; };
......
...@@ -27,11 +27,8 @@ suite('CrSettingsPasswordsLeakDetectionToggleTest', function() { ...@@ -27,11 +27,8 @@ suite('CrSettingsPasswordsLeakDetectionToggleTest', function() {
document.createElement('settings-passwords-leak-detection-toggle'); document.createElement('settings-passwords-leak-detection-toggle');
testElement.prefs = { testElement.prefs = {
profile: {password_manager_leak_detection: {value: true}}, profile: {password_manager_leak_detection: {value: true}},
safebrowsing: { safebrowsing:
enabled: {value: true}, {enabled: {value: true}, scout_reporting_enabled: {value: true}},
scout_reporting_enabled: {value: true},
enhanced: {value: false}
},
}; };
document.body.appendChild(testElement); document.body.appendChild(testElement);
Polymer.dom.flush(); Polymer.dom.flush();
......
...@@ -36,11 +36,8 @@ cr.define('settings_privacy_page', function() { ...@@ -36,11 +36,8 @@ cr.define('settings_privacy_page', function() {
allowed_on_next_startup: allowed_on_next_startup:
{type: chrome.settingsPrivate.PrefType.BOOLEAN, value: true} {type: chrome.settingsPrivate.PrefType.BOOLEAN, value: true}
}, },
safebrowsing: { safebrowsing:
enabled: {value: true}, {enabled: {value: true}, scout_reporting_enabled: {value: true}},
scout_reporting_enabled: {value: true},
enhanced: {value: false}
},
}; };
document.body.appendChild(page); document.body.appendChild(page);
Polymer.dom.flush(); Polymer.dom.flush();
...@@ -159,11 +156,8 @@ cr.define('settings_privacy_page', function() { ...@@ -159,11 +156,8 @@ cr.define('settings_privacy_page', function() {
allowed_on_next_startup: allowed_on_next_startup:
{type: chrome.settingsPrivate.PrefType.BOOLEAN, value: true} {type: chrome.settingsPrivate.PrefType.BOOLEAN, value: true}
}, },
safebrowsing: { safebrowsing:
enabled: {value: true}, {enabled: {value: true}, scout_reporting_enabled: {value: true}},
scout_reporting_enabled: {value: true},
enhanced: {value: false}
},
}; };
document.body.appendChild(page); document.body.appendChild(page);
return testSyncBrowserProxy.whenCalled('getSyncStatus'); return testSyncBrowserProxy.whenCalled('getSyncStatus');
......
...@@ -30,11 +30,8 @@ suite('CrSettingsSecurityPageTest', function() { ...@@ -30,11 +30,8 @@ suite('CrSettingsSecurityPageTest', function() {
allowed_on_next_startup: allowed_on_next_startup:
{type: chrome.settingsPrivate.PrefType.BOOLEAN, value: true} {type: chrome.settingsPrivate.PrefType.BOOLEAN, value: true}
}, },
safebrowsing: { safebrowsing:
enabled: {value: true}, {enabled: {value: true}, scout_reporting_enabled: {value: true}},
scout_reporting_enabled: {value: true},
enhanced: {value: false}
},
}; };
document.body.appendChild(page); document.body.appendChild(page);
Polymer.dom.flush(); Polymer.dom.flush();
...@@ -51,101 +48,34 @@ suite('CrSettingsSecurityPageTest', function() { ...@@ -51,101 +48,34 @@ suite('CrSettingsSecurityPageTest', function() {
}); });
} }
test('LogManageCerfificatesClick', function() {
page.$$('#manageCertificates').click();
return testMetricsBrowserProxy.whenCalled('recordSettingsPageHistogram')
.then(result => {
assertEquals(
settings.SettingsPageInteractions.PRIVACY_MANAGE_CERTIFICATES,
result);
});
});
test('safeBrowsingReportingToggle', function() { test('safeBrowsingReportingToggle', function() {
page.$$('#safeBrowsingStandard').click(); const safeBrowsingToggle = page.$.safeBrowsingToggle;
const safeBrowsingReportingToggle = page.$.safeBrowsingReportingToggle; const safeBrowsingReportingToggle = page.$.safeBrowsingReportingToggle;
assertTrue( assertTrue(safeBrowsingToggle.checked);
page.prefs.safebrowsing.enabled.value &&
!page.prefs.safebrowsing.enhanced.value);
assertFalse(safeBrowsingReportingToggle.disabled); assertFalse(safeBrowsingReportingToggle.disabled);
assertTrue(safeBrowsingReportingToggle.checked); assertTrue(safeBrowsingReportingToggle.checked);
// This could also be set to disabled, anything other than standard. safeBrowsingToggle.click();
page.$$('#safeBrowsingEnhanced').click();
Polymer.dom.flush(); Polymer.dom.flush();
assertFalse( assertFalse(safeBrowsingToggle.checked);
page.prefs.safebrowsing.enabled.value &&
!page.prefs.safebrowsing.enhanced.value);
assertTrue(safeBrowsingReportingToggle.disabled); assertTrue(safeBrowsingReportingToggle.disabled);
assertTrue(safeBrowsingReportingToggle.checked); assertFalse(safeBrowsingReportingToggle.checked);
assertTrue(page.prefs.safebrowsing.scout_reporting_enabled.value); assertTrue(page.prefs.safebrowsing.scout_reporting_enabled.value);
page.$$('#safeBrowsingStandard').click(); safeBrowsingToggle.click();
Polymer.dom.flush(); Polymer.dom.flush();
assertTrue( assertTrue(safeBrowsingToggle.checked);
page.prefs.safebrowsing.enabled.value &&
!page.prefs.safebrowsing.enhanced.value);
assertFalse(safeBrowsingReportingToggle.disabled); assertFalse(safeBrowsingReportingToggle.disabled);
assertTrue(safeBrowsingReportingToggle.checked); assertTrue(safeBrowsingReportingToggle.checked);
}); });
test('noControlSafeBrowsingReportingInEnhanced', function() {
page.$$('#safeBrowsingStandard').click();
Polymer.dom.flush();
assertFalse(page.$.safeBrowsingReportingToggle.disabled);
page.$$('#safeBrowsingEnhanced').click();
Polymer.dom.flush();
assertTrue(page.$.safeBrowsingReportingToggle.disabled);
});
test('noValueChangeSafeBrowsingReportingInEnhanced', function() {
page.$$('#safeBrowsingStandard').click();
Polymer.dom.flush();
const previous = page.prefs.safebrowsing.scout_reporting_enabled.value;
page.$$('#safeBrowsingEnhanced').click();
Polymer.dom.flush();
assertTrue(
page.prefs.safebrowsing.scout_reporting_enabled.value == previous);
});
test('noControlSafeBrowsingReportingInDisabled', function() {
page.$$('#safeBrowsingStandard').click();
Polymer.dom.flush();
assertFalse(page.$.safeBrowsingReportingToggle.disabled);
page.$$('#safeBrowsingEnhanced').click();
Polymer.dom.flush();
assertTrue(page.$.safeBrowsingReportingToggle.disabled);
});
test('noValueChangeSafeBrowsingReportingInDisabled', function() {
page.$$('#safeBrowsingStandard').click();
Polymer.dom.flush();
const previous = page.prefs.safebrowsing.scout_reporting_enabled.value;
page.$$('#safeBrowsingDisabled').click();
Polymer.dom.flush();
assertTrue(
page.prefs.safebrowsing.scout_reporting_enabled.value == previous);
});
test('noValueChangePasswordLeakSwitchToEnhanced', function() {
page.$$('#safeBrowsingStandard').click();
Polymer.dom.flush();
const previous = page.prefs.profile.password_manager_leak_detection.value;
page.$$('#safeBrowsingEnhanced').click();
Polymer.dom.flush();
assertTrue(
page.prefs.profile.password_manager_leak_detection.value == previous);
});
test('noValuePasswordLeakSwitchToDisabled', function() {
page.$$('#safeBrowsingStandard').click();
Polymer.dom.flush();
const previous = page.prefs.profile.password_manager_leak_detection.value;
page.$$('#safeBrowsingDisabled').click();
Polymer.dom.flush();
assertTrue(
page.prefs.profile.password_manager_leak_detection.value == previous);
});
}); });
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