<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-checkbox.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
<link rel="import" href="/controls/settings_checkbox.html">
<link rel="import" href="/controls/settings_dropdown_menu.html">
<link rel="import" href="/i18n_setup.html">
<link rel="import" href="/prefs/prefs_behavior.html">
<link rel="import" href="/prefs/prefs_types.html">
<link rel="import" href="/settings_shared_css.html">

<dom-module id="settings-date-time-page">
  <template>
    <style include="settings-shared">
      settings-dropdown-menu {
        --md-select-width: 400px;
      }

      cr-policy-pref-indicator {
        -webkit-margin-start: var(--checkbox-spacing);
      }
    </style>
    <div class="settings-box first">
      <settings-dropdown-menu pref="{{prefs.cros.system.timezone}}"
          menu-options="[[timeZoneList_]]"
          disabled="[[timeZoneAutoDetect_]]">
      </settings-dropdown-menu>
    </div>
    <div class="settings-box continuation">
      <paper-checkbox
          id="timeZoneAutoDetectCheckbox"
          checked="[[timeZoneAutoDetect_]]"
          disabled="[[hasTimeZoneAutoDetectPolicy_]]"
          on-change="onTimeZoneAutoDetectCheckboxChange_">
        $i18n{timeZoneGeolocation}
      </paper-checkbox>
      <template is="dom-if" if="[[hasTimeZoneAutoDetectPolicy_]]">
        <cr-policy-pref-indicator pref="[[timeZonePolicyPref_]]">
        </cr-policy-pref-indicator>
      </template>
    </div>
    <div class="settings-box continuation">
      <settings-checkbox pref="{{prefs.settings.clock.use_24hour_clock}}"
          label="$i18n{use24HourClock}">
      </settings-checkbox>
    </div>
    <div class="settings-box" id="setDateTime" actionable
        on-tap="onSetDateTimeTap_" hidden$="[[!canSetDateTime_]]">
      <div class="start">
        <div>$i18n{setDateTime}</div>
      </div>
      <button class="subpage-arrow" is="paper-icon-button-light"></button>
    </div>
  </template>
  <script src="/date_time_page/date_time_page.js"></script>
</dom-module>
