<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.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/iron-icon/iron-icon.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-button/paper-radio-button.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html">
<link rel="import" href="chrome://md-settings/controls/settings_dropdown_menu.html">
<link rel="import" href="chrome://md-settings/controls/settings_input.html">
<link rel="import" href="chrome://md-settings/controls/settings_radio_group.html">
<link rel="import" href="chrome://md-settings/settings_page/settings_animated_pages.html">
<link rel="import" href="chrome://md-settings/settings_page/settings_subheader.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="appearance_fonts_page.html">

<dom-module id="settings-appearance-page">
  <link rel="import" type="css"
      href="chrome://md-settings/settings_shared.css">
  <link rel="import" type="css"
      href="chrome://md-settings/appearance_page/appearance_shared.css">
  <link rel="import" type="css" href="chrome://resources/css/widgets.css">
  <link rel="import" href="chrome://resources/html/action_link.html">
  <template>
    <settings-animated-pages id="pages" current-route="{{currentRoute}}"
        section="appearance">
      <neon-animatable id="main">
        <div class="settings-box split">
          <div class="start">
            <iron-icon icon="image:brightness-1"></iron-icon>
            <paper-button i18n-content="setWallpaper"></paper-button>
          </div>
          <iron-icon icon="exit-to-app" disabled></iron-icon>
        </div>
        <div class="settings-box split">
          <div class="start">
            <iron-icon icon="image:brightness-1"></iron-icon>
            <paper-button id="get-themes"
                on-tap="openThemesGallery_"
                >[[i18n('getThemes')]]</paper-button>
          </div>
          <template is="dom-if" if="[[!allowResetTheme_]]">
            <iron-icon icon="exit-to-app"></iron-icon>
          </template>
          <template is="dom-if" if="[[allowResetTheme_]]">
            <paper-button on-tap="resetTheme_"
                >[[i18n('resetToDefaultTheme')]]</paper-button>
          </template>
        </div>
        <div class="settings-box split two-line">
          <settings-checkbox class="start" i18n-values="label:showHomeButton"
              pref="{{prefs.browser.show_home_button}}">
          </settings-checkbox>
        </div>
        <template is="dom-if" if="[[prefs.browser.show_home_button.value]]">
          <settings-radio-group pref="{{prefs.homepage_is_newtabpage}}">
            <paper-radio-button name="true"
                >[[i18n('homePageNtp')]]</paper-radio-button>
            <paper-radio-button name="false"
                >[[i18n('other')]]</paper-radio-button>
          </settings-radio-group>
          <div class="radio-extended">
            <settings-input no-label-float pref="{{prefs.homepage}}"
                label="[[i18n('exampleDotCom')]]">
            </settings-input>
          </div>
        </template>
        <div class="settings-box split">
          <settings-checkbox class="start" i18n-values="label:showBookmarksBar"
              pref="{{prefs.bookmark_bar.show_on_all_tabs}}">
          </settings-checkbox>
        </div>
        <div class="settings-box split">
          <div class="start" i18n-content="fontSize"></div>
          <settings-dropdown-menu id="defaultFontSize"
              pref="{{prefs.webkit.webprefs.default_font_size}}"
              menu-options="[[fontSizeOptions_]]">
          </settings-dropdown-menu>
        </div>
        <div class="settings-box split">
          <div class="start" i18n-content="customizeFonts"></div>
          <paper-button on-tap="onCustomizeFontsTap_"
              i18n-content="customizeFonts"></paper-button>
        </div>
        <div class="settings-box split">
          <div class="start" i18n-content="pageZoom"></div>
          <settings-dropdown-menu id="pageZoom"
              pref="{{defaultZoomLevel_}}"
              menu-options="[[pageZoomOptions_]]">
          </settings-dropdown-menu>
        </div>
      </neon-animatable>
      <neon-animatable id="appearance-fonts">
        <settings-subheader i18n-values="page-title:customizeFonts">
        </settings-subheader>
        <template is="dom-if" if="[[showFontsPage_(currentRoute.subpage.*)]]"
            restamp>
          <settings-appearance-fonts-page prefs="{{prefs}}">
          </settings-appearance-fonts-page>
        </template>
      </neon-animatable>
    </settings-animated-pages>
  </template>
  <script src="appearance_page.js"></script>
</dom-module>
