blob: 47d97d4a4b9beb584b2268f9626e574643d18a34 [file] [log] [blame]
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/cr_picture/png.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/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">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/html/icon.html">
<link rel="import" href="chrome://resources/html/util.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="../../controls/settings_toggle_button.html">
<link rel="import" href="../parental_controls_page/parental_controls_page.html">
<link rel="import" href="../../people_page/account_manager_browser_proxy.html">
<link rel="import" href="../../people_page/profile_info_browser_proxy.html">
<link rel="import" href="../../people_page/signout_dialog.html">
<link rel="import" href="../../people_page/sync_browser_proxy.html">
<link rel="import" href="../../people_page/sync_controls.html">
<link rel="import" href="../../people_page/sync_page.html">
<link rel="import" href="../os_route.html">
<link rel="import" href="../../router.html">
<link rel="import" href="../../settings_page/settings_animated_pages.html">
<link rel="import" href="../../settings_page/settings_subpage.html">
<link rel="import" href="../../settings_shared_css.html">
<link rel="import" href="account_manager.html">
<link rel="import" href="fingerprint_list.html">
<link rel="import" href="kerberos_accounts.html">
<link rel="import" href="lock_screen.html">
<link rel="import" href="lock_screen_password_prompt_dialog.html">
<link rel="import" href="lock_state_behavior.html">
<link rel="import" href="users_page.html">
<link rel="import" href="os_sync_controls.html">
<dom-module id="os-settings-people-page">
<template>
<style include="settings-shared iron-flex">
.sync-row {
align-items: center;
flex: auto;
}
#profile-icon {
background: center / cover no-repeat;
border-radius: 20px;
flex-shrink: 0;
height: 40px;
width: 40px;
}
#sync-setup {
--cr-secondary-text-color: var(--cros-error-color);
}
cr-link-row {
--cr-link-row-icon-width: 40px;
border-top: var(--cr-separator-line);
}
.icon-container {
display: flex;
flex-shrink: 0;
justify-content: center;
width: 40px;
}
</style>
<settings-animated-pages id="pages" section="osPeople"
focus-config="[[focusConfig_]]">
<div route-path="default">
<div class="settings-box first two-line">
<template is="dom-if" if="[[syncStatus]]">
<!-- Does not use <cr-link-row> due to custom aria label. -->
<div id="profile-icon"
style="background-image: [[getIconImageSet_(profileIconUrl_)]]"
on-click="onAccountManagerTap_"
actionable$="[[isAccountManagerEnabled_]]">
</div>
<div class="middle two-line no-min-width"
id="profile-row"
on-click="onAccountManagerTap_"
actionable$="[[isAccountManagerEnabled_]]">
<div class="flex text-elide settings-box-text">
<span id="profile-name" aria-hidden="true">
[[profileName_]]
</span>
<div id="profile-label" class="secondary"
aria-hidden="true">
[[profileLabel_]]
</div>
</div>
<cr-icon-button class="subpage-arrow"
hidden="[[!isAccountManagerEnabled_]]"
id="account-manager-subpage-trigger"
aria-label="$i18n{accountManagerSubMenuLabel}"
aria-describedby="profile-name profile-label"
aria-roledescription="$i18n{subpageArrowRoleDescription}">
</cr-icon-button>
</div>
</template>
</div>
<cr-link-row id="sync-setup"
label="[[getSyncRowLabel_()]]"
sub-label="[[getSyncAndGoogleServicesSubtext_(syncStatus)]]"
on-click="onSyncTap_"
role-description="$i18n{subpageArrowRoleDescription}">
</cr-link-row>
<cr-link-row id="lock-screen-subpage-trigger" class="hr"
on-click="onConfigureLockTap_"
label="[[selectLockScreenTitleString(hasPinLogin)]]"
sub-label="[[getPasswordState_(hasPin,
prefs.settings.enable_screen_lock.value)]]"
role-description="$i18n{subpageArrowRoleDescription}"></cr-link-row>
<template is="dom-if" if="[[showParentalControls_]]">
<settings-parental-controls-page>
</settings-parental-controls-page>
</template>
<cr-link-row id="manage-other-people-subpage-trigger"
label="$i18n{manageOtherPeople}" on-click="onManageOtherPeople_"
role-description="$i18n{subpageArrowRoleDescription}">
</cr-link-row>
<template is="dom-if" if="[[pageVisibility.people.kerberosAccounts]]">
<cr-link-row id="kerberos-accounts-subpage-trigger" class="hr"
on-click="onKerberosAccountsTap_"
label="$i18n{kerberosAccountsSubMenuLabel}"
role-description="$i18n{subpageArrowRoleDescription}">
<cr-policy-indicator indicator-type="userPolicy">
</cr-policy-indicator>
</cr-link-row>
</template>
</div>
<template is="dom-if" route-path="/syncSetup">
<settings-subpage
associated-control="[[$$('#sync-setup')]]"
page-title="$i18n{syncPageTitle}"
learn-more-url="$i18n{syncAndGoogleServicesLearnMoreURL}">
<settings-sync-page
sync-status="[[syncStatus]]" prefs="{{prefs}}"
page-visibility="[[pageVisibility.privacy]]">
</settings-sync-page>
</settings-subpage>
</template>
<!-- Pre-SplitSettingsSync we show the browser's sync controls. -->
<template is="dom-if" if="[[!splitSettingsSyncEnabled_]]">
<template is="dom-if" route-path="/syncSetup/advanced">
<settings-subpage page-title="$i18n{syncAdvancedPageTitle}"
associated-control="[[$$('#sync-setup')]]"
learn-more-url="$i18n{syncAndGoogleServicesLearnMoreURL}">
<settings-sync-controls sync-status="[[syncStatus]]">
</settings-sync-controls>
</settings-subpage>
</template>
</template>
<!-- Post-SplitSettingsSync we have separate OS sync controls. -->
<template is="dom-if" if="[[splitSettingsSyncEnabled_]]">
<template is="dom-if" route-path="/osSync">
<settings-subpage page-title="$i18n{osSyncPageTitle}"
associated-control="[[$$('#sync-setup')]]"
learn-more-url="$i18n{syncAndGoogleServicesLearnMoreURL}">
<os-sync-controls sync-status="[[syncStatus]]"
profile-icon-url="[[profileIconUrl_]]"
profile-name="[[profileName_]]"
profile-email="[[profileEmail_]]">
</os-sync-controls>
</settings-subpage>
</template>
</template>
<template is="dom-if" route-path="/lockScreen">
<settings-subpage
page-title="[[selectLockScreenTitleString(hasPinLogin)]]"
associated-control="[[$$('#lock-screen-subpage-trigger')]]">
<settings-lock-screen id="lock-screen" set-modes="[[setModes_]]"
prefs="{{prefs}}" auth-token="[[authToken_]]"
on-password-requested="onPasswordRequested_">
</settings-lock-screen>
</settings-subpage>
</template>
<template is="dom-if" if="[[fingerprintUnlockEnabled_]]">
<template is="dom-if" route-path="/lockScreen/fingerprint" no-search>
<settings-subpage page-title="$i18n{lockScreenFingerprintTitle}">
<settings-fingerprint-list id="fingerprint-list"
auth-token="[[authToken_.token]]"
set-modes="[[setModes_]]"
on-password-requested="onPasswordRequested_">
</settings-fingerprint-list>
</settings-subpage>
</template>
</template>
<template is="dom-if" route-path="/accounts">
<settings-subpage
associated-control="[[$$('#manage-other-people-subpage-trigger')]]"
page-title="$i18n{manageOtherPeople}">
<settings-users-page prefs="{{prefs}}">
</settings-users-page>
</settings-subpage>
</template>
<template is="dom-if" route-path="/accountManager">
<settings-subpage
associated-control="[[$$('#account-manager-subpage-trigger')]]"
page-title="$i18n{accountManagerPageTitle}">
<settings-account-manager prefs="[[prefs]]">
</settings-account-manager>
</settings-subpage>
</template>
<template is="dom-if" if="[[pageVisibility.people.kerberosAccounts]]">
<template is="dom-if" route-path="/kerberosAccounts">
<settings-subpage
associated-control="[[$$('#kerberos-accounts-subpage-trigger')]]"
page-title="$i18n{kerberosAccountsPageTitle}">
<settings-kerberos-accounts></settings-kerberos-accounts>
</settings-subpage>
</template>
</template>
</settings-animated-pages>
<template is="dom-if" if="[[showPasswordPromptDialog_]]" restamp>
<settings-lock-screen-password-prompt-dialog
on-close="onPasswordPromptDialogClose_"
on-auth-token-obtained="onAuthTokenObtained_">
</settings-lock-screen-password-prompt-dialog>
</template>
<template is="dom-if" if="[[showSignoutDialog_]]" restamp>
<settings-signout-dialog sync-status="[[syncStatus]]"
on-close="onDisconnectDialogClosed_">
</settings-signout-dialog>
</template>
</template>
<script src="os_people_page.js"></script>
</dom-module>