<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-material/paper-material.html">
<link rel="import" href="chrome://resources/cr_elements/v1_0/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/v1_0/cr_input/cr_input.html">
<link rel="import" href="chrome://md-settings/checkbox/checkbox.html">
<link rel="import" href="user_list.html">

<dom-module id="cr-settings-users-page">
  <link rel="import" type="css" href="chrome://md-settings/settings_page/settings_page.css">
  <link rel="import" type="css" href="users_page.css">
  <template>
    <paper-material>
      <div class="page-content">
        <div i18n-content="usersModifiedByOwnerLabel"
            hidden$="{{computeHideOwnerLabel_(isOwner, isWhitelistManaged)}}">
        </div>
        <div i18n-content="settingsManagedLabel"
            hidden$="{{computeHideManagedLabel_(isOwner, isWhitelistManaged)}}">
        </div>
        <div>
          <cr-settings-checkbox
              pref="{{prefs.cros.accounts.allowBWSI}}"
              i18n-values="label:guestBrowsingLabel"
              disabled="{{editingDisabled}}">
          </cr-settings-checkbox>
          <cr-settings-checkbox
              pref="{{prefs.cros.accounts.supervisedUsersEnabled}}"
              i18n-values="label:supervisedUsersLabel"
              disabled="{{editingDisabled}}">
          </cr-settings-checkbox>
          <cr-settings-checkbox
              pref="{{prefs.cros.accounts.showUserNamesOnSignIn}}"
              i18n-values="label:showOnSigninLabel"
              disabled="{{editingDisabled}}">
          </cr-settings-checkbox>
          <cr-settings-checkbox
              pref="{{prefs.cros.accounts.allowGuest}}"
              id="restrictSignIn"
              i18n-values="label:restrictSigninLabel"
              disabled="{{editingDisabled}}" inverted>
          </cr-settings-checkbox>
        </div>
        <div class="users">
          <div>
            <cr-settings-user-list prefs="[[prefs]]"
                disabled="[[editingUsersDisabled]]">
            </cr-settings-user-list>
          </div>
          <div>
            <cr-input id="addUserInput" i18n-values="label:addUsersLabel"
                disabled="[[editingUsersDisabled]]"></cr-input>
            <div class="add-user-button layout horizontal end-justified">
              <cr-button i18n-content="addLabel" on-click="addUser_"
                  disabled="[[editingUsersDisabled]]" raised>
              </cr-button>
            </div>
          </div>
        </div>
      </div>
    </paper-material>
  </template>
  <script src="users_page.js"></script>
</dom-module>
