Skip to content

Commit

Permalink
Privacy Settings Redesign: Solidify redesigned implementation
Browse files Browse the repository at this point in the history
CL removes logic to support the pre-redesign version of settings. This
was previously dependent on the privacySettingsRedesignEnabled flag.

Bug: 1067336
Change-Id: I4e8ecb28045b19b8dc156bfc269f15b8e0c28c03
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2274886
Reviewed-by: dpapad <dpapad@chromium.org>
Reviewed-by: Sean Harrison <harrisonsean@chromium.org>
Reviewed-by: Rainhard Findling <rainhard@chromium.org>
Reviewed-by: Andrey Zaytsev <andzaytsev@google.com>
Commit-Queue: Theodore Olsauskas-Warren <sauski@google.com>
Cr-Commit-Position: refs/heads/master@{#785636}
  • Loading branch information
sauski-alternative authored and Commit Bot committed Jul 7, 2020
1 parent 3474239 commit 55acceb
Show file tree
Hide file tree
Showing 34 changed files with 140 additions and 1,159 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
sub-label="$i18n{enableCreditCardsSublabel}"
pref="{{prefs.autofill.credit_card_enabled}}">
</settings-toggle-button>
<template is="dom-if" if="[[privacySettingsRedesignEnabled_]]">
<settings-toggle-button id="canMakePaymentToggle"
aria-label="$i18n{canMakePaymentToggleLabel}"
label="$i18n{canMakePaymentToggleLabel}"
pref="{{prefs.payments.can_make_payment_enabled}}"
on-settings-boolean-control-change="onCanMakePaymentChange_">
</settings-toggle-button>
</template>
<settings-toggle-button id="canMakePaymentToggle"
aria-label="$i18n{canMakePaymentToggleLabel}"
label="$i18n{canMakePaymentToggleLabel}"
pref="{{prefs.payments.can_make_payment_enabled}}"
on-settings-boolean-control-change="onCanMakePaymentChange_">
</settings-toggle-button>
<template is="dom-if"
if="[[shouldShowFidoToggle_(
prefs.autofill.credit_card_enabled.value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,6 @@ Polymer({
},
readOnly: true,
},

/**
* True if the privacy settings redesign feature is enabled.
* @private
*/
privacySettingsRedesignEnabled_: {
type: Boolean,
value() {
return loadTimeData.getBoolean('privacySettingsRedesignEnabled');
}
},
},

listeners: {
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/resources/settings/basic_page/basic_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@
<settings-autofill-page prefs="{{prefs}}"></settings-autofill-page>
</settings-section>
</template>
<template is="dom-if" if="[[showSafetyCheckPage_(
pageVisibility.safetyCheck)]]" restamp>
<template is="dom-if" if="[[showPage_(pageVisibility.safetyCheck)]]"
restamp>
<settings-section page-title="$i18n{safetyCheckSectionTitle}"
section="safetyCheck"
id="safetyCheckSettingsSection">
Expand Down
10 changes: 0 additions & 10 deletions chrome/browser/resources/settings/basic_page/basic_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,6 @@ Polymer({
return visibility !== false;
},

/**
* @param {boolean|undefined} visibility
* @return {boolean}
* @private
*/
showSafetyCheckPage_: function(visibility) {
return loadTimeData.getBoolean('privacySettingsRedesignEnabled') &&
this.showPage_(visibility);
},

/**
* Queues a task to search the basic sections, then another for the advanced
* sections.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@
label="$i18n{searchSuggestPref}"
sub-label="$i18n{searchSuggestPrefDesc}">
</settings-toggle-button>
<template is="dom-if" if="[[!privacySettingsRedesignEnabled_]]">
<settings-toggle-button id="linkDoctor" class="hr"
pref="{{prefs.alternate_error_pages.enabled}}"
label="$i18n{linkDoctorPref}"
sub-label="$i18n{linkDoctorPrefDesc}">
</settings-toggle-button>
</template>
<if expr="_google_chrome">
<if expr="chromeos">
<settings-toggle-button class="hr"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ Polymer({
/** @private */
showSignoutDialog_: Boolean,

/** @private */
privacySettingsRedesignEnabled_: {
type: Boolean,
value: function() {
return loadTimeData.getBoolean('privacySettingsRedesignEnabled');
},
},

/** @private */
syncFirstSetupInProgress_: {
type: Boolean,
Expand Down
166 changes: 22 additions & 144 deletions chrome/browser/resources/settings/privacy_page/privacy_page.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<style include="cr-shared-style settings-shared iron-flex">
.iron-collapse-indented {
margin-inline-start: var(--cr-section-indent-width);
}
</style>
<template is="dom-if" if="[[showClearBrowsingDataDialog_]]" restamp>
<settings-clear-browsing-data-dialog prefs="{{prefs}}"
Expand All @@ -11,111 +8,29 @@
<settings-animated-pages id="pages" section="privacy"
focus-config="[[focusConfig_]]">
<div route-path="default">
<template is="dom-if" if="[[!privacySettingsRedesignEnabled_]]" restamp>
<cr-link-row id="clearBrowsingData"
class="hr"
label="$i18n{clearBrowsingData}"
sub-label="$i18n{clearBrowsingDataDescription}"
on-click="onClearBrowsingDataTap_"></cr-link-row>
<cr-link-row id="site-settings-subpage-trigger"
class="hr"
label="$i18n{siteSettings}"
sub-label="$i18n{siteSettingsDescription}"
on-click="onSiteSettingsTap_"></cr-link-row>
<cr-expand-button id="moreExpansion"
alt="$i18n{privacyPageMore}"
class="cr-row"
expanded="{{moreOpened_}}">
<div>$i18n{privacyPageMore}</div>
</cr-expand-button>
<iron-collapse id="moreCollapse" opened="[[moreOpened_]]"
class="iron-collapse-indented">
<settings-toggle-button id="safeBrowsingToggle"
pref="{{prefs.safebrowsing.enabled}}"
label="$i18n{safeBrowsingEnableProtection}"
sub-label="$i18n{safeBrowsingEnableProtectionDesc}"
on-settings-boolean-control-change=
"onSafeBrowsingToggleChange_">
</settings-toggle-button>
<settings-passwords-leak-detection-toggle
id="passwordsLeakDetectionToggle"
prefs="{{prefs}}"
sync-status="[[syncStatus]]">
</settings-passwords-leak-detection-toggle>
<settings-toggle-button id="safeBrowsingReportingToggle"
class="hr"
pref="[[safeBrowsingReportingPref_]]" no-set-pref
label="$i18n{safeBrowsingEnableExtendedReporting}"
sub-label="$i18n{safeBrowsingEnableExtendedReportingDesc}"
disabled="[[getDisabledExtendedSafeBrowsing_(prefs.*)]]"
on-settings-boolean-control-change=
"onSafeBrowsingReportingToggleChange_">
</settings-toggle-button>
<settings-do-not-track-toggle id="doNotTrack" prefs="{{prefs}}">
</settings-do-not-track-toggle>
<settings-toggle-button id="canMakePaymentToggle"
class="hr"
aria-label="$i18n{canMakePaymentToggleLabel}"
label="$i18n{canMakePaymentToggleLabel}"
pref="{{prefs.payments.can_make_payment_enabled}}"
on-settings-boolean-control-change="onCanMakePaymentChange_">
</settings-toggle-button>
<settings-toggle-button class="hr"
hidden="[[!pageVisibility.networkPrediction]]"
pref="{{prefs.net.network_prediction_options}}"
label="$i18n{networkPredictionEnabled}"
sub-label="$i18n{networkPredictionEnabledDesc}"
numeric-unchecked-value="[[networkPredictionUncheckedValue_]]"
on-settings-boolean-control-change="onNetworkPredictionChange_">
</settings-toggle-button>
<template is="dom-if" if="[[showSecureDnsSetting_]]">
<settings-secure-dns prefs="{{prefs}}"></settings-secure-dns>
</template>
<if expr="use_nss_certs or is_win or is_macosx">
<cr-link-row id="manageCertificates"
class="hr"
<if expr="not use_nss_certs">
external
</if>
label="$i18n{manageCertificates}"
sub-label="$i18n{manageCertificatesDescription}"
on-click="onManageCertificatesTap_"></cr-link-row>
</if>
<template is="dom-if" if="[[enableSecurityKeysSubpage_]]">
<cr-link-row id="security-keys-subpage-trigger"
class="hr"
label="$i18n{securityKeysTitle}"
sub-label="$i18n{securityKeysDesc}"
on-click="onSecurityKeysTap_"></cr-link-row>
</template>
</iron-collapse>
</template>
<template is="dom-if" if="[[privacySettingsRedesignEnabled_]]" restamp>
<cr-link-row id="clearBrowsingData"
class="hr" start-icon="cr:delete"
label="$i18n{clearBrowsingData}"
sub-label="$i18n{clearBrowsingDataDescription}"
on-click="onClearBrowsingDataTap_"></cr-link-row>
<cr-link-row id="cookiesLinkRow" start-icon="settings:cookie"
class="hr" label="$i18n{cookiePageTitle}"
sub-label="[[cookieSettingDescription_]]"
on-click="onCookiesClick_"></cr-link-row>
<cr-link-row id="securityLinkRow" start-icon="cr:security"
class="hr" label="$i18n{securityPageTitle}"
sub-label="$i18n{securityPageDescription}"
on-click="onSecurityPageClick_"></cr-link-row>
<cr-link-row id="permissionsLinkRow" start-icon="settings:permissions"
class="hr" label="$i18n{siteSettings}"
sub-label="$i18n{permissionsPageDescription}"
on-click="onPermissionsPageClick_"></cr-link-row>
</template>
<cr-link-row id="clearBrowsingData"
class="hr" start-icon="cr:delete"
label="$i18n{clearBrowsingData}"
sub-label="$i18n{clearBrowsingDataDescription}"
on-click="onClearBrowsingDataTap_"></cr-link-row>
<cr-link-row id="cookiesLinkRow" start-icon="settings:cookie"
class="hr" label="$i18n{cookiePageTitle}"
sub-label="[[cookieSettingDescription_]]"
on-click="onCookiesClick_"></cr-link-row>
<cr-link-row id="securityLinkRow" start-icon="cr:security"
class="hr" label="$i18n{securityPageTitle}"
sub-label="$i18n{securityPageDescription}"
on-click="onSecurityPageClick_"></cr-link-row>
<cr-link-row id="permissionsLinkRow" start-icon="settings:permissions"
class="hr" label="$i18n{siteSettings}"
sub-label="$i18n{permissionsPageDescription}"
on-click="onPermissionsPageClick_"></cr-link-row>
</div>

<if expr="use_nss_certs">
<template is="dom-if" route-path="/certificates">
<settings-subpage
associated-control="[[getControlForCertificatesSubpage_(
privacySettingsRedesignEnabled_)]]"
associated-control="[[$$('#securityLinkRow'))]]"
page-title="$i18n{manageCertificates}">
<certificate-manager></certificate-manager>
</settings-subpage>
Expand All @@ -124,9 +39,7 @@

<template is="dom-if" if="[[enableSecurityKeysSubpage_]]">
<template is="dom-if" route-path="/securityKeys">
<settings-subpage
associated-control="[[getControlForSecurityKeysSubpage_(
privacySettingsRedesignEnabled_)]]"
<settings-subpage associated-control="[[$$('#securityLinkRow')]]"
page-title="$i18n{securityKeysTitle}">
<security-keys-subpage></security-keys-subpage>
</settings-subpage>
Expand All @@ -135,8 +48,7 @@

<template is="dom-if" route-path="/content">
<settings-subpage
associated-control="[[getControlForSiteSettingsSubpage_(
privacySettingsRedesignEnabled_)]]"
associated-control="[[$$('#permissionsLinkRow')]]"
id="site-settings"
page-title="$i18n{siteSettings}"
learn-more-url="$i18n{exceptionsLearnMoreURL}">
Expand All @@ -145,10 +57,8 @@
</settings-subpage>
</template>

<template is="dom-if" route-path="/security"
no-search="[[!privacySettingsRedesignEnabled_]]">
<template is="dom-if" route-path="/security">
<settings-subpage id="security" page-title="$i18n{securityPageTitle}"
no-search$="[[!privacySettingsRedesignEnabled_]]"
associated-control="[[$$('#securityLinkRow')]]"
learn-more-url="$i18n{safeBrowsingHelpCenterURL}">
<settings-security-page prefs="{{prefs}}"
Expand Down Expand Up @@ -217,11 +127,9 @@
</category-setting-exceptions>
</settings-subpage>
</template>
<template is="dom-if" route-path="/cookies"
no-search="[[!privacySettingsRedesignEnabled_]]">
<template is="dom-if" route-path="/cookies" no-search>
<settings-subpage id="cookies" page-title="$i18n{cookiePageTitle}"
learn-more-url="$i18n{cookiesSettingsHelpCenterURL}"
no-search$="[[!privacySettingsRedesignEnabled_]]"
search-label="$i18n{siteSettingsAllSitesSearch}"
search-term="{{searchFilter_}}"
associated-control="[[$$('#cookiesLinkRow')]]">
Expand All @@ -231,36 +139,6 @@
</settings-cookies-page>
</settings-subpage>
</template>
<template is="dom-if" route-path="/content/cookies" no-search>
<settings-subpage page-title="$i18n{siteSettingsCategoryCookies}"
search-label="$i18n{siteSettingsAllSitesSearch}"
search-term="{{searchFilter_}}">
<category-default-setting category="{{ContentSettingsTypes.COOKIES}}"
toggle-off-label="$i18n{siteSettingsBlocked}"
toggle-on-label="$i18n{siteSettingsCookiesAllowedRecommended}"
sub-option-label="$i18n{deleteDataPostSession}"
sub-option-mode="cookies-session-only">
</category-default-setting>
<settings-toggle-button
id="blockThirdPartyCookies"
class="hr"
pref="{{prefs.profile.block_third_party_cookies}}"
label="$i18n{thirdPartyCookie}"
sub-label="$i18n{thirdPartyCookieSublabel}"
on-settings-boolean-control-change=
"onBlockThirdPartyCookiesToggleChange_"
no-set-pref>
</settings-toggle-button>
<cr-link-row id="site-data-trigger" class="hr"
on-click="onSiteDataTap_" label="$i18n{siteSettingsCookieLink}">
</cr-link-row>
<category-setting-exceptions
category="{{ContentSettingsTypes.COOKIES}}"
block-header="$i18n{siteSettingsBlock}"
search-filter="[[searchFilter_]]">
</category-setting-exceptions>
</settings-subpage>
</template>
<template is="dom-if" route-path="/siteData" no-search>
<settings-subpage page-title="$i18n{siteSettingsCookieHeader}"
search-label="$i18n{siteSettingsCookieSearch}"
Expand Down

0 comments on commit 55acceb

Please sign in to comment.