Commit 60ed7e98 authored by Anastasiia N's avatar Anastasiia N Committed by Chromium LUCI CQ

Add icons to subsections in People section in Settings

Add icons to "Sync" and "Parental controls" subsections.

Screenshot: http://screen/7wmcgUf7mLvUesB

Bug: 1148246
Change-Id: I2ad53d4f1926daeb9ffd8000af410346a61f80bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2544509
Commit-Queue: Anastasiia N <anastasiian@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837533}
parent 21bc4b59
...@@ -41,6 +41,10 @@ ...@@ -41,6 +41,10 @@
<dom-module id="os-settings-people-page"> <dom-module id="os-settings-people-page">
<template> <template>
<style include="settings-shared iron-flex"> <style include="settings-shared iron-flex">
:host {
--icon-width: 40px;
}
.sync-row { .sync-row {
align-items: center; align-items: center;
flex: auto; flex: auto;
...@@ -59,10 +63,14 @@ ...@@ -59,10 +63,14 @@
} }
cr-link-row { cr-link-row {
--cr-link-row-icon-width: 40px; --cr-link-row-icon-width: var(--icon-width);
border-top: var(--cr-separator-line); border-top: var(--cr-separator-line);
} }
settings-parental-controls-page {
--cr-link-row-icon-width: var(--icon-width);
}
.icon-container { .icon-container {
display: flex; display: flex;
flex-shrink: 0; flex-shrink: 0;
...@@ -107,6 +115,8 @@ ...@@ -107,6 +115,8 @@
</div> </div>
<cr-link-row id="sync-setup" <cr-link-row id="sync-setup"
start-icon="[[getSyncSetupIcon_(
isAccountManagementFlowsV2Enabled_)]]"
label="[[getSyncRowLabel_()]]" label="[[getSyncRowLabel_()]]"
sub-label="[[getSyncAndGoogleServicesSubtext_(syncStatus)]]" sub-label="[[getSyncAndGoogleServicesSubtext_(syncStatus)]]"
on-click="onSyncTap_" on-click="onSyncTap_"
......
...@@ -546,6 +546,10 @@ Polymer({ ...@@ -546,6 +546,10 @@ Polymer({
return cr.icon.getImage(iconUrl); return cr.icon.getImage(iconUrl);
}, },
/**
* @return {string}
* @private
*/
getProfileName_() { getProfileName_() {
if (this.isAccountManagerEnabled_ && if (this.isAccountManagerEnabled_ &&
this.isAccountManagementFlowsV2Enabled_) { this.isAccountManagementFlowsV2Enabled_) {
...@@ -554,6 +558,14 @@ Polymer({ ...@@ -554,6 +558,14 @@ Polymer({
return this.profileName_; return this.profileName_;
}, },
/**
* @return {string}
* @private
*/
getSyncSetupIcon_() {
return this.isAccountManagementFlowsV2Enabled_ ? 'cr:sync' : '';
},
/** /**
* @param {!settings.SyncStatus} syncStatus * @param {!settings.SyncStatus} syncStatus
* @return {boolean} Whether to show the "Sign in to Chrome" button. * @return {boolean} Whether to show the "Sign in to Chrome" button.
......
...@@ -17,6 +17,10 @@ ...@@ -17,6 +17,10 @@
cr-link-row { cr-link-row {
--cr-section-padding: 0; --cr-section-padding: 0;
} }
/* The same width as in cr-link-row */
.start-icon {
width: var(--cr-link-row-icon-width, var(--cr-icon-size));
}
</style> </style>
<div id="parental-controls-item" class="settings-box two-line"> <div id="parental-controls-item" class="settings-box two-line">
<template is="dom-if" if="[[isChild_]]"> <template is="dom-if" if="[[isChild_]]">
...@@ -28,7 +32,11 @@ ...@@ -28,7 +32,11 @@
</cr-link-row> </cr-link-row>
</template> </template>
<template is="dom-if" if="[[!isChild_]]"> <template is="dom-if" if="[[!isChild_]]">
<div class="start settings-box-text"> <template is="dom-if" if="[[isAccountManagementFlowsV2Enabled_]]">
<iron-icon class="start-icon" icon="cr20:kite"></iron-icon>
</template>
<div class$="[[getLabelClassList_(
isAccountManagementFlowsV2Enabled_)]]">
<div id="label" aria-hidden="true"> <div id="label" aria-hidden="true">
$i18n{parentalControlsPageTitle} $i18n{parentalControlsPageTitle}
</div> </div>
......
...@@ -30,6 +30,18 @@ Polymer({ ...@@ -30,6 +30,18 @@ Polymer({
return navigator.onLine; return navigator.onLine;
} }
}, },
/**
* True if redesign of account management flows is enabled.
* @private
*/
isAccountManagementFlowsV2Enabled_: {
type: Boolean,
value() {
return loadTimeData.getBoolean('isAccountManagementFlowsV2Enabled');
},
readOnly: true,
},
}, },
/** @override */ /** @override */
...@@ -81,6 +93,16 @@ Polymer({ ...@@ -81,6 +93,16 @@ Polymer({
} }
}, },
/**
* @return {string}
* @private
*/
getLabelClassList_() {
return this.isAccountManagementFlowsV2Enabled_ ?
'middle settings-box-text' :
'start settings-box-text';
},
/** @private */ /** @private */
handleSetupButtonClick_(event) { handleSetupButtonClick_(event) {
event.stopPropagation(); event.stopPropagation();
......
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