<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_expand_button/cr_expand_button.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-collapse.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-item/paper-item-body.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-item/paper-item.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html">
<link rel="import" href="chrome://md-settings/passwords_and_forms_page/passwords_section.html">

<dom-module id="settings-passwords-and-forms-page">
  <link rel="import" type="css" href="chrome://md-settings/settings_shared.css">
  <template>
    <div class="settings-box">
      <paper-item>
        <paper-item-body two-line>
          <div i18n-content="autofill"></div>
          <div secondary i18n-content="autofillDetail"></div>
        </paper-item-body>
        <paper-toggle-button
            checked="{{prefs.autofill.enabled.value}}">
        </paper-toggle-button>
        <cr-expand-button disabled="{{!prefs.autofill.enabled.value}}">
        </cr-expand-button>
      </paper-item>
    </div>
    <div class="settings-box">
      <paper-item>
        <paper-item-body two-line>
          <div i18n-content="passwords"></div>
          <div secondary i18n-content="passwordsDetail"></div>
        </paper-item-body>
        <paper-toggle-button
            checked="{{prefs.profile.password_manager_enabled.value}}">
        </paper-toggle-button>
        <cr-expand-button expanded="{{passwordsOpened}}"
            disabled="{{!prefs.profile.password_manager_enabled.value}}">
        </cr-expand-button>
      </paper-item>
      <iron-collapse id="collapse" opened="{{passwordsOpened}}">
        <passwords-section saved-passwords="{{savedPasswords}}">
        </passwords-section>
      </iron-collapse>
    </div>
  </template>
  <script src="passwords_and_forms_page.js"></script>
</dom-module>
