Commit 62c906a0 authored by James Cook's avatar James Cook Committed by Commit Bot

chromeos: Add settings-sync-account-control to browser people settings

Chrome OS with SplitSettingsSync will use this control to show sync
status, just like other platforms.

Linux, syncing (unchanged):
https://screenshot.googleplex.com/t74uFT5iEsL

Linux, not syncing (unchanged):
https://screenshot.googleplex.com/SJGC3rbtGnw

Chrome OS, pre-SplitSettingsSync (unchanged):
https://screenshot.googleplex.com/EKZDSEqVBYy

Chrome OS, post-SplitSettingsSync (new):
https://screenshot.googleplex.com/fLYerpP60rg

Remove some unused references to diceEnabled_.

TODO: Make the "turn off" button actually work.

Bug: 1013466
Test: browser_tests
Change-Id: I2bb50ffdd7bcb408a13885740440ff752ff2fd2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2003758
Commit-Queue: James Cook <jamescook@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733860}
parent 32a1f8bf
......@@ -3,6 +3,7 @@
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.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_link_row/cr_link_row.html">
<link rel="import" href="chrome://resources/cr_elements/cr_toast/cr_toast.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_indicator.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
......@@ -32,7 +33,6 @@
<link rel="import" href="chrome://resources/cr_elements/chromeos/cr_picture/cr_png_behavior.html">
</if>
<if expr="not chromeos">
<link rel="import" href="chrome://resources/cr_elements/cr_toast/cr_toast.html">
<link rel="import" href="import_data_dialog.html">
<link rel="import" href="manage_profile.html">
</if>
......@@ -76,7 +76,6 @@
width: 40px;
}
<if expr="not chromeos">
#toast {
left: 0;
z-index: 1;
......@@ -98,12 +97,10 @@
font-size: 1.1rem;
line-height: 1.625rem;
}
</if>
</style>
<settings-animated-pages id="pages" section="people"
focus-config="[[focusConfig_]]">
<div route-path="default">
<if expr="not chromeos">
<template is="dom-if" if="[[shouldShowSyncAccountControl_(
syncStatus.syncSystemEnabled, syncStatus.signinAllowed)]]">
<settings-sync-account-control
......@@ -117,8 +114,8 @@
"$i18n{peopleSignInPromptSecondaryWithNoAccount}">
</settings-sync-account-control>
</template>
<template is="dom-if" if="[[!diceEnabled_]]">
</if>
<template is="dom-if" if="[[shouldShowProfile_(
syncStatus.syncSystemEnabled, syncStatus.signinAllowed)]]" restamp>
<div id="picture-subpage-trigger" class="settings-box first two-line">
<template is="dom-if" if="[[syncStatus]]">
<div id="profile-icon" on-click="onProfileTap_"
......@@ -151,6 +148,7 @@
aria-describedby="profile-name"></cr-icon-button>
</if>
</div>
<!-- Chrome OS is always signed-in and does not show a sign-out button. -->
<if expr="not chromeos">
<template is="dom-if" if="[[showSignin_(syncStatus)]]">
<div class="separator"></div>
......@@ -169,14 +167,12 @@
</if>
</template>
</div>
<if expr="not chromeos">
</template> <!-- if="[[!diceEnabled_]]" -->
</if>
</template> <!-- if="[[shouldShowProfile_()]]" -->
<template is="dom-if" if="[[!syncStatus.signedIn]]">
<!-- Chrome OS uses settings-sync-account-control for sync promos. -->
<if expr="not chromeos">
<template is="dom-if" if="[[!syncStatus.signedIn]]">
<template is="dom-if" if="[[!diceEnabled_]]">
</if>
<div class="settings-box two-line" id="sync-overview"
hidden="[[!syncStatus.signinAllowed]]">
<div class="start settings-box-text">
......@@ -186,10 +182,9 @@
</a>
</div>
</div>
<if expr="not chromeos">
</template> <!-- if="[[!diceEnabled_]]" -->
</if>
</template>
</if>
<cr-link-row id="sync-setup"
label="$i18n{syncAndNonPersonalizedServices}"
......@@ -230,9 +225,6 @@
page-title="$i18n{syncPageTitle}"
learn-more-url="$i18n{syncAndGoogleServicesLearnMoreURL}">
<settings-sync-page
<if expr="not chromeos">
dice-enabled="[[diceEnabled_]]"
</if>
sync-status="[[syncStatus]]" prefs="{{prefs}}"
page-visibility="[[pageVisibility.privacy]]">
</settings-sync-page>
......@@ -272,11 +264,9 @@
on-close="onImportDataDialogClosed_">
</settings-import-data-dialog>
</template>
<if expr="not chromeos">
<cr-toast duration="3000" id="toast">
<span>$i18n{syncSettingsSavedToast}</span>
</cr-toast>
</if>
</template>
<script src="people_page.js"></script>
</dom-module>
......@@ -25,6 +25,7 @@ Polymer({
notify: true,
},
// Chrome OS does not support DICE.
// <if expr="not chromeos">
/**
* This flag is used to conditionally show a set of new sign-in UIs to the
......@@ -278,13 +279,7 @@ Polymer({
this.syncStatus = syncStatus;
if (
shouldRecordSigninImpression
// <if expr="not chromeos">
// Sync account control is not shown on Chrome OS.
&& !this.shouldShowSyncAccountControl_()
// </if>
) {
if (shouldRecordSigninImpression && !this.shouldShowSyncAccountControl_()) {
// SyncAccountControl records the impressions user actions.
chrome.metricsPrivate.recordUserAction('Signin_Impression_FromSettings');
}
......@@ -334,10 +329,6 @@ Polymer({
}
// </if>
// <if expr="chromeos">
cr.ui.focusWithoutInk(assert(this.$$('#disconnectButton')));
// </if>
if (settings.Router.getInstance().getCurrentRoute() ==
settings.routes.SIGN_OUT) {
settings.Router.getInstance().navigateToPreviousRoute();
......@@ -366,6 +357,7 @@ Polymer({
settings.Router.getInstance().navigateToPreviousRoute();
cr.ui.focusWithoutInk(assert(this.$.importDataDialogTrigger));
},
// </if>
/**
* Open URL for managing your Google Account.
......@@ -385,11 +377,30 @@ Polymer({
if (this.syncStatus == undefined) {
return false;
}
// <if expr="chromeos">
if (!loadTimeData.getBoolean('splitSettingsSyncEnabled')) {
return false;
}
// </if>
return !!this.syncStatus.syncSystemEnabled &&
!!this.syncStatus.signinAllowed;
},
// </if>
/**
* @return {boolean} Whether to show the profile row and associated controls.
* @private
*/
shouldShowProfile_() {
// Closure compiler doesn't understand <if> so use a variable.
let show = false;
// <if expr="chromeos">
show = !this.shouldShowSyncAccountControl_();
// </if>
// <if expr="not chromeos">
show = !this.diceEnabled_;
// </if>
return show;
},
/**
* @param {string} iconUrl
......
......@@ -147,10 +147,6 @@ Polymer({
'syncPrefs.trustedVaultKeysRequired)',
},
// <if expr="not chromeos">
diceEnabled: Boolean,
// </if>
/** @private */
showSetupCancelDialog_: {
type: Boolean,
......
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