Commit 4bcd0855 authored by Mihai Sardarescu's avatar Mihai Sardarescu Committed by Commit Bot

Remove unifiedConsentEnabled from all settings resources.

This CL removes unifiedConsentEnabled variable from all settings
resources that were still referencing it.

Bug: 1015805

Change-Id: I8c12a9558a4cfab236d423c037f92e24bea99975
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1878195Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710259}
parent 0114fc7b
...@@ -185,7 +185,6 @@ ...@@ -185,7 +185,6 @@
page-title="$i18n{syncPageTitle}" page-title="$i18n{syncPageTitle}"
learn-more-url="$i18n{syncAndGoogleServicesLearnMoreURL}"> learn-more-url="$i18n{syncAndGoogleServicesLearnMoreURL}">
<settings-sync-page <settings-sync-page
unified-consent-enabled
sync-status="[[syncStatus]]" prefs="{{prefs}}" sync-status="[[syncStatus]]" prefs="{{prefs}}"
page-visibility="[[pageVisibility.privacy]]"> page-visibility="[[pageVisibility.privacy]]">
</settings-sync-page> </settings-sync-page>
......
...@@ -146,7 +146,6 @@ ...@@ -146,7 +146,6 @@
<template is="dom-if" if="[[shouldShowSyncAccountControl_(diceEnabled_, <template is="dom-if" if="[[shouldShowSyncAccountControl_(diceEnabled_,
syncStatus.syncSystemEnabled, syncStatus.signinAllowed)]]"> syncStatus.syncSystemEnabled, syncStatus.signinAllowed)]]">
<settings-sync-account-control <settings-sync-account-control
unified-consent-enabled
sync-status="[[syncStatus]]" sync-status="[[syncStatus]]"
promo-label-with-account="$i18n{peopleSignInPrompt}" promo-label-with-account="$i18n{peopleSignInPrompt}"
promo-label-with-no-account="$i18n{peopleSignInPrompt}" promo-label-with-no-account="$i18n{peopleSignInPrompt}"
...@@ -300,7 +299,6 @@ ...@@ -300,7 +299,6 @@
<if expr="not chromeos"> <if expr="not chromeos">
dice-enabled="[[diceEnabled_]]" dice-enabled="[[diceEnabled_]]"
</if> </if>
unified-consent-enabled
sync-status="[[syncStatus]]" prefs="{{prefs}}" sync-status="[[syncStatus]]" prefs="{{prefs}}"
page-visibility="[[pageVisibility.privacy]]"> page-visibility="[[pageVisibility.privacy]]">
</settings-sync-page> </settings-sync-page>
......
...@@ -181,8 +181,7 @@ ...@@ -181,8 +181,7 @@
[[getAccountLabel_( [[getAccountLabel_(
'$i18nPolymer{syncingTo}', shownAccount_.email, '$i18nPolymer{syncingTo}', shownAccount_.email,
syncStatus.hasError, syncStatus.signedIn, syncStatus.hasError, syncStatus.signedIn,
syncStatus.disabled, syncStatus.firstSetupInProgress, syncStatus.disabled, syncStatus.firstSetupInProgress)]]
unifiedConsentEnabled)]]
</div> </div>
</div> </div>
</div> </div>
......
...@@ -87,12 +87,10 @@ Polymer({ ...@@ -87,12 +87,10 @@ Polymer({
'promoSecondaryLabelWithNoAccount, shownAccount_)', 'promoSecondaryLabelWithNoAccount, shownAccount_)',
}, },
unifiedConsentEnabled: Boolean,
/** @private */ /** @private */
showSetupButtons_: { showSetupButtons_: {
type: Boolean, type: Boolean,
computed: 'computeShowSetupButtons_(unifiedConsentEnabled,' + computed: 'computeShowSetupButtons_(' +
'hideButtons, syncStatus.firstSetupInProgress)', 'hideButtons, syncStatus.firstSetupInProgress)',
}, },
}, },
...@@ -210,7 +208,7 @@ Polymer({ ...@@ -210,7 +208,7 @@ Polymer({
* @private * @private
*/ */
getAccountLabel_: function(label, account) { getAccountLabel_: function(label, account) {
if (this.unifiedConsentEnabled && this.syncStatus.firstSetupInProgress) { if (this.syncStatus.firstSetupInProgress) {
return this.syncStatus.statusText || account; return this.syncStatus.statusText || account;
} }
return this.syncStatus.signedIn && !this.syncStatus.hasError && return this.syncStatus.signedIn && !this.syncStatus.hasError &&
...@@ -455,8 +453,7 @@ Polymer({ ...@@ -455,8 +453,7 @@ Polymer({
* @private * @private
*/ */
computeShowSetupButtons_: function() { computeShowSetupButtons_: function() {
return !this.hideButtons && !!this.unifiedConsentEnabled && return !this.hideButtons && !!this.syncStatus.firstSetupInProgress;
!!this.syncStatus.firstSetupInProgress;
}, },
/** @private */ /** @private */
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html"> <link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="sync_browser_proxy.html"> <link rel="import" href="sync_browser_proxy.html">
<link rel="import" href="sync_controls.html">
<link rel="import" href="../privacy_page/personalization_options.html"> <link rel="import" href="../privacy_page/personalization_options.html">
<link rel="import" href="../route.html"> <link rel="import" href="../route.html">
<link rel="import" href="../settings_shared_css.html"> <link rel="import" href="../settings_shared_css.html">
...@@ -96,10 +95,8 @@ ...@@ -96,10 +95,8 @@
</style> </style>
<if expr="not chromeos"> <if expr="not chromeos">
<template is="dom-if" if="[[shouldShowSyncAccountControl_( <template is="dom-if" if="[[shouldShowSyncAccountControl_(
unifiedConsentEnabled, syncStatus.syncSystemEnabled, syncStatus.syncSystemEnabled, syncStatus.signinAllowed)]]">
syncStatus.signinAllowed)]]">
<settings-sync-account-control embedded-in-subpage <settings-sync-account-control embedded-in-subpage
unified-consent-enabled="[[unifiedConsentEnabled]]"
sync-status="[[syncStatus]]" sync-status="[[syncStatus]]"
promo-label-with-account= promo-label-with-account=
"$i18n{peopleSignInPromptSecondaryWithAccount}" "$i18n{peopleSignInPromptSecondaryWithAccount}"
...@@ -117,7 +114,7 @@ ...@@ -117,7 +114,7 @@
</div> </div>
<template is="dom-if" if="[[shouldShowExistingPassphraseBelowAccount_( <template is="dom-if" if="[[shouldShowExistingPassphraseBelowAccount_(
unifiedConsentEnabled, syncPrefs.passphraseRequired)]]" syncPrefs.passphraseRequired)]]"
on-dom-change="focusPassphraseInput_"> on-dom-change="focusPassphraseInput_">
<div id="existingPassphrase" class="list-frame"> <div id="existingPassphrase" class="list-frame">
<div id="existingPassphraseTitle" class="list-item"> <div id="existingPassphraseTitle" class="list-item">
...@@ -150,7 +147,7 @@ ...@@ -150,7 +147,7 @@
<div id="sync-separator" hidden="[[!syncSectionDisabled_]]"></div> <div id="sync-separator" hidden="[[!syncSectionDisabled_]]"></div>
<div id="sync-section" hidden="[[syncSectionDisabled_]]"> <div id="sync-section" hidden="[[syncSectionDisabled_]]">
<div class="settings-box first" hidden="[[!unifiedConsentEnabled]]"> <div class="settings-box first">
<h2 class="cr-title-text start">$i18n{sync}</h2> <h2 class="cr-title-text start">$i18n{sync}</h2>
</div> </div>
...@@ -164,67 +161,17 @@ ...@@ -164,67 +161,17 @@
</div> </div>
<div id="[[pages_.CONFIGURE]]" <div id="[[pages_.CONFIGURE]]"
hidden$="[[!isStatus_(pages_.CONFIGURE, pageStatus_)]]"> hidden$="[[!isStatus_(pages_.CONFIGURE, pageStatus_)]]">
<!-- TODO(http://crbug.com/862983) Remove this section once the Unified <div id="other-sync-items" class="list-frame">
Consent feature is launched. --> <div id="sync-advanced-row" class="list-item first"
<template is="dom-if" if="[[shouldShowExistingPassphraseInSyncSection_( on-click="onSyncAdvancedTap_" actionable>
unifiedConsentEnabled, syncPrefs.passphraseRequired)]]" <div class="start">
on-dom-change="focusPassphraseInput_"> $i18n{syncAdvancedPageTitle}
<div id="existingPassphrase" class="list-frame">
<div class="list-item">
<div class="settings-box-text"
inner-h-t-m-l="[[syncPrefs.enterPassphraseBody]]">
</div>
</div>
<div id="existingPassphraseContainer" class="list-item">
<cr-input id="existingPassphraseInput" type="password"
value="{{existingPassphrase_}}"
placeholder="$i18n{passphrasePlaceholder}"
error-message="$i18n{incorrectPassphraseError}"
on-keypress="onSubmitExistingPassphraseTap_">
<cr-button id="submitExistingPassphrase" slot="suffix"
on-click="onSubmitExistingPassphraseTap_"
class="action-button" disabled="[[!existingPassphrase_]]">
$i18n{submitPassphraseButton}
</cr-button>
</cr-input>
</div>
<div id="passphraseRecoverHint" class="list-item">
<span>$i18nRaw{passphraseRecover}</span>
</div> </div>
<cr-icon-button class="subpage-arrow"
aria-label="$i18n{syncAdvancedPageTitle}"></cr-icon-button>
</div> </div>
</template>
<template is="dom-if" if="[[!unifiedConsentEnabled]]">
<settings-sync-controls sync-status="[[syncStatus]]">
</settings-sync-controls>
</template>
<div id="other-sync-items"
class$="[[getListFrameClass_(unifiedConsentEnabled)]]">
<template is="dom-if" if="[[unifiedConsentEnabled]]">
<div id="sync-advanced-row" class="list-item first"
on-click="onSyncAdvancedTap_" actionable>
<div class="start">
$i18n{syncAdvancedPageTitle}
</div>
<cr-icon-button class="subpage-arrow"
aria-label="$i18n{syncAdvancedPageTitle}"></cr-icon-button>
</div>
</template>
<template is="dom-if" <a class="inherit-color no-outline list-item" tabindex="-1"
if="[[shouldShowDriveSuggest_(unifiedConsentEnabled)]]" restamp>
<settings-toggle-button
class$="[[getListItemClass_(unifiedConsentEnabled)]]"
pref="{{prefs.documentsuggest.enabled}}"
label="$i18n{driveSuggestPref}"
sub-label="$i18n{driveSuggestPrefDesc}">
</settings-toggle-button>
</template>
<a class$="inherit-color no-outline
[[getListItemClass_(unifiedConsentEnabled)]]" tabindex="-1"
target="_blank" href="$i18n{activityControlsUrl}" target="_blank" href="$i18n{activityControlsUrl}"
on-click="onActivityControlsTap_"> on-click="onActivityControlsTap_">
<div class="start settings-box-text"> <div class="start settings-box-text">
...@@ -234,8 +181,7 @@ ...@@ -234,8 +181,7 @@
</a> </a>
<a id="syncDashboardLink" <a id="syncDashboardLink"
class$="inherit-color no-outline class="inherit-color no-outline list-item"
[[getListItemClass_(unifiedConsentEnabled)]]"
tabindex="-1" target="_blank" href="$i18n{syncDashboardUrl}" tabindex="-1" target="_blank" href="$i18n{syncDashboardUrl}"
hidden="[[syncStatus.supervisedUser]]"> hidden="[[syncStatus.supervisedUser]]">
<div class="start settings-box-text"> <div class="start settings-box-text">
...@@ -248,7 +194,7 @@ ...@@ -248,7 +194,7 @@
hidden="[[syncPrefs.passphraseRequired]]" hidden="[[syncPrefs.passphraseRequired]]"
class$="single-column settings-box-text class$="single-column settings-box-text
[[getPassphraseHintLines_(syncPrefs.encryptAllData)]] [[getPassphraseHintLines_(syncPrefs.encryptAllData)]]
[[getListItemClass_(unifiedConsentEnabled)]]"> list-item">
$i18n{encryptionOptionsTitle} $i18n{encryptionOptionsTitle}
<div class="secondary"> <div class="secondary">
$i18n{syncDataEncryptedText} $i18n{syncDataEncryptedText}
...@@ -317,17 +263,14 @@ ...@@ -317,17 +263,14 @@
</div> </div>
</div> </div>
<template is="dom-if" if="[[unifiedConsentEnabled]]"> <div class="settings-box first">
<div class="settings-box first"> <h2 class="cr-title-text">
<h2 class="cr-title-text"> $i18n{nonPersonalizedServicesSectionLabel}
$i18n{nonPersonalizedServicesSectionLabel} </h2>
</h2> </div>
</div> <settings-personalization-options class="list-frame" prefs="{{prefs}}"
<settings-personalization-options class="list-frame" prefs="{{prefs}}" page-visibility="[[pageVisibility]]" sync-status="[[syncStatus]]">
page-visibility="[[pageVisibility]]" sync-status="[[syncStatus]]" </settings-personalization-options>
unified-consent-enabled="[[unifiedConsentEnabled]]">
</settings-personalization-options>
</template>
<if expr="not chromeos"> <if expr="not chromeos">
<template is="dom-if" if="[[showSetupCancelDialog_]]" restamp> <template is="dom-if" if="[[showSetupCancelDialog_]]" restamp>
...@@ -347,15 +290,6 @@ ...@@ -347,15 +290,6 @@
</div> </div>
</cr-dialog> </cr-dialog>
</template> </template>
<template is="dom-if" if="[[!unifiedConsentEnabled]]">
<cr-toast id="toast" open="[[syncStatus.firstSetupInProgress]]">
<div>$i18n{syncWillStart}</div>
<cr-button on-click="onSyncSetupCancel_">
$i18n{cancelSync}
</cr-button>
</cr-toast>
</template>
</if> </if>
</template> </template>
<script src="sync_page.js"></script> <script src="sync_page.js"></script>
......
...@@ -129,7 +129,7 @@ Polymer({ ...@@ -129,7 +129,7 @@ Polymer({
type: Boolean, type: Boolean,
value: false, value: false,
computed: 'computeSyncSectionDisabled_(' + computed: 'computeSyncSectionDisabled_(' +
'unifiedConsentEnabled, syncStatus.signedIn, syncStatus.disabled, ' + 'syncStatus.signedIn, syncStatus.disabled, ' +
'syncStatus.hasError, syncStatus.statusAction)', 'syncStatus.hasError, syncStatus.statusAction)',
}, },
...@@ -137,11 +137,6 @@ Polymer({ ...@@ -137,11 +137,6 @@ Polymer({
diceEnabled: Boolean, diceEnabled: Boolean,
// </if> // </if>
unifiedConsentEnabled: {
type: Boolean,
observer: 'initializeDidAbort_',
},
/** @private */ /** @private */
showSetupCancelDialog_: { showSetupCancelDialog_: {
type: Boolean, type: Boolean,
...@@ -159,12 +154,9 @@ Polymer({ ...@@ -159,12 +154,9 @@ Polymer({
browserProxy_: null, browserProxy_: null,
/** /**
* If unified consent is enabled, the beforeunload callback is used to * The beforeunload callback is used to show the 'Leave site' dialog. This
* show the 'Leave site' dialog. This makes sure that the user has the chance * makes sure that the user has the chance to go back and confirm the sync
* to go back and confirm the sync opt-in before leaving. * opt-in before leaving.
*
* If unified consent is disabled, the beforeunload callback is used
* to confirm the sync setup before leaving the opt-in flow.
* *
* This property is non-null if the user is currently navigated on the sync * This property is non-null if the user is currently navigated on the sync
* settings route. * settings route.
...@@ -174,9 +166,8 @@ Polymer({ ...@@ -174,9 +166,8 @@ Polymer({
beforeunloadCallback_: null, beforeunloadCallback_: null,
/** /**
* If unified consent is enabled, the unload callback is used to cancel the * The unload callback is used to cancel the sync setup when the user hits
* sync setup when the user hits the browser back button after arriving on the * the browser back button after arriving on the page.
* page.
* Note: Cases like closing the tab or reloading don't need to be handled, * Note: Cases like closing the tab or reloading don't need to be handled,
* because they are already caught in |PeopleHandler::~PeopleHandler| * because they are already caught in |PeopleHandler::~PeopleHandler|
* from the C++ code. * from the C++ code.
...@@ -193,11 +184,10 @@ Polymer({ ...@@ -193,11 +184,10 @@ Polymer({
collapsibleSectionsInitialized_: false, collapsibleSectionsInitialized_: false,
/** /**
* Whether the user decided to abort sync. When unified consent is enabled, * Whether the user decided to abort sync.
* this is initialized to true.
* @private {boolean} * @private {boolean}
*/ */
didAbort_: false, didAbort_: true,
/** /**
* Whether the user confirmed the cancellation of sync. * Whether the user confirmed the cancellation of sync.
...@@ -251,7 +241,7 @@ Polymer({ ...@@ -251,7 +241,7 @@ Polymer({
* @private * @private
*/ */
computeSyncSectionDisabled_: function() { computeSyncSectionDisabled_: function() {
return !!this.unifiedConsentEnabled && this.syncStatus !== undefined && return this.syncStatus !== undefined &&
(!this.syncStatus.signedIn || !!this.syncStatus.disabled || (!this.syncStatus.signedIn || !!this.syncStatus.disabled ||
(!!this.syncStatus.hasError && (!!this.syncStatus.hasError &&
this.syncStatus.statusAction !== this.syncStatus.statusAction !==
...@@ -308,8 +298,7 @@ Polymer({ ...@@ -308,8 +298,7 @@ Polymer({
const userActionCancelsSetup = this.syncStatus && const userActionCancelsSetup = this.syncStatus &&
this.syncStatus.firstSetupInProgress && this.didAbort_; this.syncStatus.firstSetupInProgress && this.didAbort_;
if (this.unifiedConsentEnabled && userActionCancelsSetup && if (userActionCancelsSetup && !this.setupCancelConfirmed_) {
!this.setupCancelConfirmed_) {
chrome.metricsPrivate.recordUserAction( chrome.metricsPrivate.recordUserAction(
'Signin_Signin_BackOnAdvancedSyncSettings'); 'Signin_Signin_BackOnAdvancedSyncSettings');
// Show the 'Cancel sync?' dialog. // Show the 'Cancel sync?' dialog.
...@@ -357,27 +346,21 @@ Polymer({ ...@@ -357,27 +346,21 @@ Polymer({
this.browserProxy_.didNavigateToSyncPage(); this.browserProxy_.didNavigateToSyncPage();
if (this.unifiedConsentEnabled) { this.beforeunloadCallback_ = event => {
this.beforeunloadCallback_ = event => { // When the user tries to leave the sync setup, show the 'Leave site'
// When the user tries to leave the sync setup, show the 'Leave site' // dialog.
// dialog. if (this.syncStatus && this.syncStatus.firstSetupInProgress) {
if (this.unifiedConsentEnabled && this.syncStatus && event.preventDefault();
this.syncStatus.firstSetupInProgress) { event.returnValue = '';
event.preventDefault();
event.returnValue = '';
chrome.metricsPrivate.recordUserAction(
'Signin_Signin_AbortAdvancedSyncSettings');
}
};
window.addEventListener('beforeunload', this.beforeunloadCallback_);
this.unloadCallback_ = this.onNavigateAwayFromPage_.bind(this); chrome.metricsPrivate.recordUserAction(
window.addEventListener('unload', this.unloadCallback_); 'Signin_Signin_AbortAdvancedSyncSettings');
} else { }
this.beforeunloadCallback_ = this.onNavigateAwayFromPage_.bind(this); };
window.addEventListener('beforeunload', this.beforeunloadCallback_); window.addEventListener('beforeunload', this.beforeunloadCallback_);
}
this.unloadCallback_ = this.onNavigateAwayFromPage_.bind(this);
window.addEventListener('unload', this.unloadCallback_);
}, },
/** @private */ /** @private */
...@@ -391,7 +374,6 @@ Polymer({ ...@@ -391,7 +374,6 @@ Polymer({
this.pageStatus_ = settings.PageStatus.CONFIGURE; this.pageStatus_ = settings.PageStatus.CONFIGURE;
this.browserProxy_.didNavigateAwayFromSyncPage(this.didAbort_); this.browserProxy_.didNavigateAwayFromSyncPage(this.didAbort_);
this.initializeDidAbort_();
window.removeEventListener('beforeunload', this.beforeunloadCallback_); window.removeEventListener('beforeunload', this.beforeunloadCallback_);
this.beforeunloadCallback_ = null; this.beforeunloadCallback_ = null;
...@@ -567,28 +549,6 @@ Polymer({ ...@@ -567,28 +549,6 @@ Polymer({
} }
}, },
/**
* When unified-consent enabled, the non-toggle items on the bottom of sync
* section should be wrapped with 'list-frame' in order to be indented
* correctly.
* @return {string}
* @private
*/
getListFrameClass_: function() {
return this.unifiedConsentEnabled ? 'list-frame' : '';
},
/**
* When unified-consent enabled, the non-toggle items on the bottom of sync
* section will be wrapped with 'list-frame', and should have the 'list-item'
* instead of 'settings-box' in order to be indented correctly.
* @return {string}
* @private
*/
getListItemClass_: function() {
return this.unifiedConsentEnabled ? 'list-item' : 'settings-box';
},
/** /**
* When there is a sync passphrase, some items have an additional line for the * When there is a sync passphrase, some items have an additional line for the
* passphrase reset hint, making them three lines rather than two. * passphrase reset hint, making them three lines rather than two.
...@@ -605,7 +565,7 @@ Polymer({ ...@@ -605,7 +565,7 @@ Polymer({
* @private * @private
*/ */
shouldShowSyncAccountControl_: function() { shouldShowSyncAccountControl_: function() {
return !!this.unifiedConsentEnabled && this.syncStatus !== undefined && return this.syncStatus !== undefined &&
!!this.syncStatus.syncSystemEnabled && !!this.syncStatus.signinAllowed; !!this.syncStatus.syncSystemEnabled && !!this.syncStatus.signinAllowed;
}, },
// </if> // </if>
...@@ -615,17 +575,7 @@ Polymer({ ...@@ -615,17 +575,7 @@ Polymer({
* @private * @private
*/ */
shouldShowExistingPassphraseBelowAccount_: function() { shouldShowExistingPassphraseBelowAccount_: function() {
return !!this.unifiedConsentEnabled && this.syncPrefs !== undefined && return this.syncPrefs !== undefined && !!this.syncPrefs.passphraseRequired;
!!this.syncPrefs.passphraseRequired;
},
/**
* @return {boolean}
* @private
*/
shouldShowExistingPassphraseInSyncSection_: function() {
return !this.unifiedConsentEnabled && this.syncPrefs !== undefined &&
!!this.syncPrefs.passphraseRequired;
}, },
/** /**
...@@ -652,29 +602,6 @@ Polymer({ ...@@ -652,29 +602,6 @@ Polymer({
settings.navigateTo(settings.routes.SYNC_ADVANCED); settings.navigateTo(settings.routes.SYNC_ADVANCED);
}, },
/**
* @return {boolean}
* @private
*/
shouldShowDriveSuggest_: function() {
return loadTimeData.getBoolean('driveSuggestAvailable') &&
!this.unifiedConsentEnabled;
},
/**
* Used when unified consent is disabled.
* @private
*/
onSyncSetupCancel_: function() {
this.didAbort_ = true;
settings.navigateTo(settings.routes.BASIC);
},
/** @private */
initializeDidAbort_: function() {
this.didAbort_ = !!this.unifiedConsentEnabled;
},
/** /**
* @param {!CustomEvent<boolean>} e The event passed from * @param {!CustomEvent<boolean>} e The event passed from
* settings-sync-account-control. * settings-sync-account-control.
......
...@@ -69,13 +69,11 @@ ...@@ -69,13 +69,11 @@
</settings-toggle-button> </settings-toggle-button>
</if><!-- not chromeos --> </if><!-- not chromeos -->
</if><!-- _google_chrome --> </if><!-- _google_chrome -->
<template is="dom-if" if="[[unifiedConsentEnabled]]"> <settings-toggle-button
<settings-toggle-button pref="{{prefs.url_keyed_anonymized_data_collection.enabled}}"
pref="{{prefs.url_keyed_anonymized_data_collection.enabled}}" label="$i18n{urlKeyedAnonymizedDataCollection}"
label="$i18n{urlKeyedAnonymizedDataCollection}" sub-label="$i18n{urlKeyedAnonymizedDataCollectionDesc}">
sub-label="$i18n{urlKeyedAnonymizedDataCollectionDesc}"> </settings-toggle-button>
</settings-toggle-button>
</template>
<if expr="_google_chrome"> <if expr="_google_chrome">
<settings-toggle-button id="spellCheckControl" <settings-toggle-button id="spellCheckControl"
pref="{{prefs.spellcheck.use_spelling_service}}" pref="{{prefs.spellcheck.use_spelling_service}}"
...@@ -85,7 +83,7 @@ ...@@ -85,7 +83,7 @@
hidden="[[!showSpellCheckControl_(prefs.spellcheck.dictionaries)]]"> hidden="[[!showSpellCheckControl_(prefs.spellcheck.dictionaries)]]">
</settings-toggle-button> </settings-toggle-button>
</if><!-- _google_chrome --> </if><!-- _google_chrome -->
<template is="dom-if" if="[[shouldShowDriveSuggest_(unifiedConsentEnabled, <template is="dom-if" if="[[shouldShowDriveSuggest_(
syncStatus, syncStatus.signedIn, syncStatus.statusAction)]]" restamp> syncStatus, syncStatus.signedIn, syncStatus.statusAction)]]" restamp>
<settings-toggle-button id="driveSuggestControl" <settings-toggle-button id="driveSuggestControl"
pref="{{prefs.documentsuggest.enabled}}" pref="{{prefs.documentsuggest.enabled}}"
......
...@@ -29,8 +29,6 @@ Polymer({ ...@@ -29,8 +29,6 @@ Polymer({
*/ */
pageVisibility: Object, pageVisibility: Object,
unifiedConsentEnabled: Boolean,
/** @type {settings.SyncStatus} */ /** @type {settings.SyncStatus} */
syncStatus: Object, syncStatus: Object,
...@@ -127,10 +125,10 @@ Polymer({ ...@@ -127,10 +125,10 @@ Polymer({
* @private * @private
*/ */
showSpellCheckControl_: function() { showSpellCheckControl_: function() {
return !this.unifiedConsentEnabled || return (
(!!this.prefs.spellcheck && !!this.prefs.spellcheck &&
/** @type {!Array<string>} */ /** @type {!Array<string>} */
(this.prefs.spellcheck.dictionaries.value).length > 0); (this.prefs.spellcheck.dictionaries.value).length > 0);
}, },
/** /**
...@@ -139,8 +137,7 @@ Polymer({ ...@@ -139,8 +137,7 @@ Polymer({
*/ */
shouldShowDriveSuggest_: function() { shouldShowDriveSuggest_: function() {
return loadTimeData.getBoolean('driveSuggestAvailable') && return loadTimeData.getBoolean('driveSuggestAvailable') &&
!!this.unifiedConsentEnabled && !!this.syncStatus && !!this.syncStatus && !!this.syncStatus.signedIn &&
!!this.syncStatus.signedIn &&
this.syncStatus.statusAction !== settings.StatusAction.REAUTHENTICATE; this.syncStatus.statusAction !== settings.StatusAction.REAUTHENTICATE;
}, },
}); });
......
...@@ -86,7 +86,6 @@ AccessibilityTest.define('SettingsA11ySignOut', { ...@@ -86,7 +86,6 @@ AccessibilityTest.define('SettingsA11ySignOut', {
if (this.peoplePage.diceEnabled_) { if (this.peoplePage.diceEnabled_) {
const syncAccountControl = const syncAccountControl =
this.peoplePage.$$('settings-sync-account-control'); this.peoplePage.$$('settings-sync-account-control');
syncAccountControl.unifiedConsentEnabled = true;
syncAccountControl.syncStatus = { syncAccountControl.syncStatus = {
firstSetupInProgress: false, firstSetupInProgress: false,
signedIn: true, signedIn: true,
......
...@@ -11,12 +11,10 @@ suite('sync-page-test', function() { ...@@ -11,12 +11,10 @@ suite('sync-page-test', function() {
settings.navigateTo(settings.routes.SYNC); settings.navigateTo(settings.routes.SYNC);
syncPage = document.createElement('settings-sync-page'); syncPage = document.createElement('settings-sync-page');
document.body.appendChild(syncPage); document.body.appendChild(syncPage);
Polymer.dom.flush();
}); });
test('autofocus passphrase input', function() { test('autofocus passphrase input', function() {
syncPage.unifiedConsentEnabled = true;
Polymer.dom.flush();
cr.webUIListenerCallback('sync-prefs-changed', {passphraseRequired: false}); cr.webUIListenerCallback('sync-prefs-changed', {passphraseRequired: false});
Polymer.dom.flush(); Polymer.dom.flush();
// Passphrase input is not available when no passphrase is required. // Passphrase input is not available when no passphrase is required.
......
...@@ -84,20 +84,7 @@ cr.define('settings_people_page_sync_page', function() { ...@@ -84,20 +84,7 @@ cr.define('settings_people_page_sync_page', function() {
.then(testRecreate); .then(testRecreate);
}); });
test('SyncSectionLayout_NoUnifiedConsent_SignedIn', function() { test('SyncSectionLayout_SignedIn', function() {
const syncSection = syncPage.$$('#sync-section');
const otherItems = syncPage.$$('#other-sync-items');
syncPage.syncStatus = {signedIn: true, disabled: false};
syncPage.unifiedConsentEnabled = false;
Polymer.dom.flush();
assertFalse(syncSection.hidden);
assertTrue(syncPage.$$('#sync-separator').hidden);
assertFalse(otherItems.classList.contains('list-frame'));
assertFalse(!!otherItems.querySelector('list-item'));
});
test('SyncSectionLayout_UnifiedConsentEnabled_SignedIn', function() {
const syncSection = syncPage.$$('#sync-section'); const syncSection = syncPage.$$('#sync-section');
const otherItems = syncPage.$$('#other-sync-items'); const otherItems = syncPage.$$('#other-sync-items');
...@@ -107,7 +94,6 @@ cr.define('settings_people_page_sync_page', function() { ...@@ -107,7 +94,6 @@ cr.define('settings_people_page_sync_page', function() {
hasError: false, hasError: false,
statusAction: settings.StatusAction.NO_ACTION, statusAction: settings.StatusAction.NO_ACTION,
}; };
syncPage.unifiedConsentEnabled = true;
Polymer.dom.flush(); Polymer.dom.flush();
assertFalse(syncSection.hidden); assertFalse(syncSection.hidden);
assertTrue(syncPage.$$('#sync-separator').hidden); assertTrue(syncPage.$$('#sync-separator').hidden);
...@@ -136,7 +122,7 @@ cr.define('settings_people_page_sync_page', function() { ...@@ -136,7 +122,7 @@ cr.define('settings_people_page_sync_page', function() {
assertTrue(syncPage.$$('#sync-separator').hidden); assertTrue(syncPage.$$('#sync-separator').hidden);
}); });
test('SyncSectionLayout_UnifiedConsentEnabled_SignedOut', function() { test('SyncSectionLayout_SignedOut', function() {
const syncSection = syncPage.$$('#sync-section'); const syncSection = syncPage.$$('#sync-section');
syncPage.syncStatus = { syncPage.syncStatus = {
...@@ -145,13 +131,12 @@ cr.define('settings_people_page_sync_page', function() { ...@@ -145,13 +131,12 @@ cr.define('settings_people_page_sync_page', function() {
hasError: false, hasError: false,
statusAction: settings.StatusAction.NO_ACTION, statusAction: settings.StatusAction.NO_ACTION,
}; };
syncPage.unifiedConsentEnabled = true;
Polymer.dom.flush(); Polymer.dom.flush();
assertTrue(syncSection.hidden); assertTrue(syncSection.hidden);
assertFalse(syncPage.$$('#sync-separator').hidden); assertFalse(syncPage.$$('#sync-separator').hidden);
}); });
test('SyncSectionLayout_UnifiedConsentEnabled_SyncDisabled', function() { test('SyncSectionLayout_SyncDisabled', function() {
const syncSection = syncPage.$$('#sync-section'); const syncSection = syncPage.$$('#sync-section');
syncPage.syncStatus = { syncPage.syncStatus = {
...@@ -160,7 +145,6 @@ cr.define('settings_people_page_sync_page', function() { ...@@ -160,7 +145,6 @@ cr.define('settings_people_page_sync_page', function() {
hasError: false, hasError: false,
statusAction: settings.StatusAction.NO_ACTION, statusAction: settings.StatusAction.NO_ACTION,
}; };
syncPage.unifiedConsentEnabled = true;
Polymer.dom.flush(); Polymer.dom.flush();
assertTrue(syncSection.hidden); assertTrue(syncSection.hidden);
}); });
...@@ -350,8 +334,6 @@ cr.define('settings_people_page_sync_page', function() { ...@@ -350,8 +334,6 @@ cr.define('settings_people_page_sync_page', function() {
prefs.encryptAllData = true; prefs.encryptAllData = true;
prefs.passphraseRequired = true; prefs.passphraseRequired = true;
cr.webUIListenerCallback('sync-prefs-changed', prefs); cr.webUIListenerCallback('sync-prefs-changed', prefs);
syncPage.unifiedConsentEnabled = false;
Polymer.dom.flush(); Polymer.dom.flush();
const existingPassphraseInput = const existingPassphraseInput =
...@@ -371,8 +353,6 @@ cr.define('settings_people_page_sync_page', function() { ...@@ -371,8 +353,6 @@ cr.define('settings_people_page_sync_page', function() {
prefs.encryptAllData = true; prefs.encryptAllData = true;
prefs.passphraseRequired = true; prefs.passphraseRequired = true;
cr.webUIListenerCallback('sync-prefs-changed', prefs); cr.webUIListenerCallback('sync-prefs-changed', prefs);
syncPage.unifiedConsentEnabled = false;
Polymer.dom.flush(); Polymer.dom.flush();
const existingPassphraseInput = syncPage.$$('#existingPassphraseInput'); const existingPassphraseInput = syncPage.$$('#existingPassphraseInput');
...@@ -403,8 +383,6 @@ cr.define('settings_people_page_sync_page', function() { ...@@ -403,8 +383,6 @@ cr.define('settings_people_page_sync_page', function() {
prefs.encryptAllData = true; prefs.encryptAllData = true;
prefs.passphraseRequired = true; prefs.passphraseRequired = true;
cr.webUIListenerCallback('sync-prefs-changed', prefs); cr.webUIListenerCallback('sync-prefs-changed', prefs);
syncPage.unifiedConsentEnabled = false;
Polymer.dom.flush(); Polymer.dom.flush();
const existingPassphraseInput = syncPage.$$('#existingPassphraseInput'); const existingPassphraseInput = syncPage.$$('#existingPassphraseInput');
...@@ -438,7 +416,6 @@ cr.define('settings_people_page_sync_page', function() { ...@@ -438,7 +416,6 @@ cr.define('settings_people_page_sync_page', function() {
}); });
test('SyncAdvancedRow', function() { test('SyncAdvancedRow', function() {
syncPage.unifiedConsentEnabled = true;
Polymer.dom.flush(); Polymer.dom.flush();
const syncAdvancedRow = syncPage.$$('#sync-advanced-row'); const syncAdvancedRow = syncPage.$$('#sync-advanced-row');
...@@ -525,47 +502,8 @@ cr.define('settings_people_page_sync_page', function() { ...@@ -525,47 +502,8 @@ cr.define('settings_people_page_sync_page', function() {
// ################################## // ##################################
if (!cr.isChromeOS) { if (!cr.isChromeOS) {
test('SyncSetupCancel_UnifiedConsentDisabled', function() { test('SyncSetupCancel', function() {
syncPage.unifiedConsentEnabled = false;
Polymer.dom.flush();
const toast = syncPage.$$('cr-toast');
// During initialization, the toast values start as undefined/false.
syncPage.syncStatus = {};
Polymer.dom.flush();
assertTrue(!!toast);
assertFalse(!!toast.open);
// Next, the toast shows up during setup.
syncPage.syncStatus = {firstSetupInProgress: true};
Polymer.dom.flush();
assertTrue(toast.open);
// At the end, confirm that setup can be cancelled.
toast.querySelector('cr-button').click();
return browserProxy.whenCalled('didNavigateAwayFromSyncPage')
.then(abort => {
assertTrue(abort);
});
});
test('SyncSetupLeavePage UnifiedConsentDisabled', function() {
syncPage.unifiedConsentEnabled = false;
Polymer.dom.flush();
settings.navigateTo(settings.routes.BASIC);
return browserProxy.whenCalled('didNavigateAwayFromSyncPage')
.then(abort => {
assertFalse(abort);
});
});
test('SyncSetupCancel UnifiedConsentEnabled', function() {
syncPage.diceEnabled = true; syncPage.diceEnabled = true;
syncPage.unifiedConsentEnabled = true;
syncPage.syncStatus = { syncPage.syncStatus = {
signinAllowed: true, signinAllowed: true,
syncSystemEnabled: true, syncSystemEnabled: true,
...@@ -588,9 +526,8 @@ cr.define('settings_people_page_sync_page', function() { ...@@ -588,9 +526,8 @@ cr.define('settings_people_page_sync_page', function() {
}); });
}); });
test('SyncSetupConfirm UnifiedConsentEnabled', function() { test('SyncSetupConfirm', function() {
syncPage.diceEnabled = true; syncPage.diceEnabled = true;
syncPage.unifiedConsentEnabled = true;
syncPage.syncStatus = { syncPage.syncStatus = {
signinAllowed: true, signinAllowed: true,
syncSystemEnabled: true, syncSystemEnabled: true,
...@@ -613,8 +550,7 @@ cr.define('settings_people_page_sync_page', function() { ...@@ -613,8 +550,7 @@ cr.define('settings_people_page_sync_page', function() {
}); });
}); });
test('SyncSetupLeavePage UnifiedConsentEnabled', function() { test('SyncSetupLeavePage', function() {
syncPage.unifiedConsentEnabled = true;
syncPage.syncStatus = { syncPage.syncStatus = {
signinAllowed: true, signinAllowed: true,
syncSystemEnabled: true, syncSystemEnabled: true,
...@@ -664,8 +600,7 @@ cr.define('settings_people_page_sync_page', function() { ...@@ -664,8 +600,7 @@ cr.define('settings_people_page_sync_page', function() {
}); });
}); });
test('SyncSetupSearchSettings UnifiedConsentEnabled', function() { test('SyncSetupSearchSettings', function() {
syncPage.unifiedConsentEnabled = true;
syncPage.syncStatus = { syncPage.syncStatus = {
signinAllowed: true, signinAllowed: true,
syncSystemEnabled: true, syncSystemEnabled: true,
...@@ -689,7 +624,6 @@ cr.define('settings_people_page_sync_page', function() { ...@@ -689,7 +624,6 @@ cr.define('settings_people_page_sync_page', function() {
syncPage.diceEnabled = true; syncPage.diceEnabled = true;
Polymer.dom.flush(); Polymer.dom.flush();
assertFalse(!!syncPage.$$('settings-sync-account-control')); assertFalse(!!syncPage.$$('settings-sync-account-control'));
syncPage.unifiedConsentEnabled = true;
syncPage.syncStatus = {signinAllowed: false, syncSystemEnabled: false}; syncPage.syncStatus = {signinAllowed: false, syncSystemEnabled: false};
Polymer.dom.flush(); Polymer.dom.flush();
assertFalse(!!syncPage.$$('settings-sync-account-control')); assertFalse(!!syncPage.$$('settings-sync-account-control'));
......
...@@ -32,7 +32,6 @@ cr.define('settings_personalization_options', function() { ...@@ -32,7 +32,6 @@ cr.define('settings_personalization_options', function() {
test('DriveSearchSuggestControl', function() { test('DriveSearchSuggestControl', function() {
assertFalse(!!testElement.$$('#driveSuggestControl')); assertFalse(!!testElement.$$('#driveSuggestControl'));
testElement.unifiedConsentEnabled = true;
testElement.syncStatus = { testElement.syncStatus = {
signedIn: true, signedIn: true,
statusAction: settings.StatusAction.NO_ACTION statusAction: settings.StatusAction.NO_ACTION
...@@ -68,8 +67,7 @@ cr.define('settings_personalization_options', function() { ...@@ -68,8 +67,7 @@ cr.define('settings_personalization_options', function() {
testElement.remove(); testElement.remove();
}); });
test('UnifiedConsent spellcheck toggle', function() { test('Spellcheck toggle', function() {
testElement.unifiedConsentEnabled = true;
testElement.prefs = {spellcheck: {dictionaries: {value: ['en-US']}}}; testElement.prefs = {spellcheck: {dictionaries: {value: ['en-US']}}};
Polymer.dom.flush(); Polymer.dom.flush();
assertFalse(testElement.$.spellCheckControl.hidden); assertFalse(testElement.$.spellCheckControl.hidden);
...@@ -89,24 +87,5 @@ cr.define('settings_personalization_options', function() { ...@@ -89,24 +87,5 @@ cr.define('settings_personalization_options', function() {
testElement.$.spellCheckControl.click(); testElement.$.spellCheckControl.click();
assertTrue(testElement.prefs.spellcheck.use_spelling_service.value); assertTrue(testElement.prefs.spellcheck.use_spelling_service.value);
}); });
test('NoUnifiedConsent spellcheck toggle', function() {
testElement.unifiedConsentEnabled = false;
testElement.prefs = {spellcheck: {dictionaries: {value: ['en-US']}}};
Polymer.dom.flush();
assertFalse(testElement.$.spellCheckControl.hidden);
testElement.prefs = {spellcheck: {dictionaries: {value: []}}};
Polymer.dom.flush();
assertFalse(testElement.$.spellCheckControl.hidden);
testElement.prefs = {
browser: {enable_spellchecking: {value: false}},
spellcheck: {use_spelling_service: {value: false}}
};
Polymer.dom.flush();
testElement.$.spellCheckControl.click();
assertTrue(testElement.prefs.spellcheck.use_spelling_service.value);
});
}); });
}); });
...@@ -130,7 +130,6 @@ cr.define('settings_sync_account_control', function() { ...@@ -130,7 +130,6 @@ cr.define('settings_sync_account_control', function() {
}); });
test('not signed in but has stored accounts', function() { test('not signed in but has stored accounts', function() {
testElement.unifiedConsentEnabled = false;
testElement.syncStatus = { testElement.syncStatus = {
firstSetupInProgress: false, firstSetupInProgress: false,
signedIn: false, signedIn: false,
...@@ -224,7 +223,6 @@ cr.define('settings_sync_account_control', function() { ...@@ -224,7 +223,6 @@ cr.define('settings_sync_account_control', function() {
}); });
test('signed in, no error', function() { test('signed in, no error', function() {
testElement.unifiedConsentEnabled = false;
testElement.syncStatus = { testElement.syncStatus = {
firstSetupInProgress: false, firstSetupInProgress: false,
signedIn: true, signedIn: true,
...@@ -260,7 +258,6 @@ cr.define('settings_sync_account_control', function() { ...@@ -260,7 +258,6 @@ cr.define('settings_sync_account_control', function() {
}); });
test('signed in, has error', function() { test('signed in, has error', function() {
testElement.unifiedConsentEnabled = false;
testElement.syncStatus = { testElement.syncStatus = {
firstSetupInProgress: false, firstSetupInProgress: false,
signedIn: true, signedIn: true,
...@@ -341,7 +338,6 @@ cr.define('settings_sync_account_control', function() { ...@@ -341,7 +338,6 @@ cr.define('settings_sync_account_control', function() {
}); });
test('signed in, setup in progress', function() { test('signed in, setup in progress', function() {
testElement.unifiedConsentEnabled = false;
testElement.syncStatus = { testElement.syncStatus = {
signedIn: true, signedIn: true,
signedInUsername: 'bar@bar.com', signedInUsername: 'bar@bar.com',
...@@ -356,12 +352,6 @@ cr.define('settings_sync_account_control', function() { ...@@ -356,12 +352,6 @@ cr.define('settings_sync_account_control', function() {
const userInfo = testElement.$$('#user-info'); const userInfo = testElement.$$('#user-info');
const setupButtons = testElement.$$('#setup-buttons'); const setupButtons = testElement.$$('#setup-buttons');
assertTrue(userInfo.textContent.includes('barName'));
assertFalse(userInfo.textContent.includes('Setup in progress...'));
assertVisible(setupButtons, false);
testElement.unifiedConsentEnabled = true;
assertTrue(userInfo.textContent.includes('barName')); assertTrue(userInfo.textContent.includes('barName'));
assertTrue(userInfo.textContent.includes('Setup in progress...')); assertTrue(userInfo.textContent.includes('Setup in progress...'));
assertVisible(setupButtons, true); assertVisible(setupButtons, true);
...@@ -373,7 +363,6 @@ cr.define('settings_sync_account_control', function() { ...@@ -373,7 +363,6 @@ cr.define('settings_sync_account_control', function() {
const banner = testElement.$$('#banner'); const banner = testElement.$$('#banner');
assertVisible(banner, true); assertVisible(banner, true);
testElement.unifiedConsentEnabled = false;
testElement.syncStatus = { testElement.syncStatus = {
firstSetupInProgress: false, firstSetupInProgress: false,
signedIn: true, signedIn: true,
...@@ -443,7 +432,6 @@ cr.define('settings_sync_account_control', function() { ...@@ -443,7 +432,6 @@ cr.define('settings_sync_account_control', function() {
test('hide buttons', function() { test('hide buttons', function() {
testElement.hideButtons = true; testElement.hideButtons = true;
testElement.unifiedConsentEnabled = false;
testElement.syncStatus = { testElement.syncStatus = {
firstSetupInProgress: false, firstSetupInProgress: false,
signedIn: true, signedIn: true,
......
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