<link rel="import" href="chrome://resources/html/polymer.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-icon-button/paper-icon-button-light.html">
<link rel="import" href="/printing_page/cloud_printers.html">
<link rel="import" href="/route.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">
<if expr="chromeos">
<link rel="import" href="/printing_page/cups_printer_details_page.html">
<link rel="import" href="/printing_page/cups_printers.html">
</if>

<dom-module id="settings-printing-page">
  <template>
    <style include="settings-shared"></style>
    <settings-animated-pages id="pages" section="printing">
      <array-selector id="arraySelector" items="{{cupsPrinters}}"
          selected="{{detailPrinter_}}">
      </array-selector>
      <neon-animatable route-path="default">
<if expr="chromeos">
        <template is="dom-if" if="[[showCupsPrintingFeatures_]]">
          <div id="cupsPrinters" class="settings-box first"
              on-tap="onTapCupsPrinters_" actionable>
            <div class="start">
              $i18n{cupsPrintersTitle}
            </div>
            <button class="subpage-arrow" is="paper-icon-button-light"></button>
          </div>
        </template>
</if>
        <div id="cloudPrinters" class="settings-box two-line"
            on-tap="onTapCloudPrinters_" actionable>
          <div class="start">
            $i18n{cloudPrintersTitle}
            <div class="secondary">$i18n{cloudPrintersTitleDescription}</div>
          </div>
          <button class="subpage-arrow" is="paper-icon-button-light"></button>
        </div>
      </neon-animatable>
<if expr="chromeos">
      <template is="dom-if" route-path="/cupsPrinters">
        <settings-subpage
            associated-control="[[$$('#cupsPrinters')]]"
            page-title="$i18n{cupsPrintersTitle}"
            search-label="$i18n{searchLabel}"
            search-term="{{searchTerm}}">
          <settings-cups-printers printers="{{cupsPrinters}}"
              search-term="{{searchTerm}}">
          </settings-cups-printers>
        </settings-subpage>
      </template>
      <template is="dom-if" route-path="/cupsPrinterDetails" restamp no-search>
        <settings-subpage page-title="$i18n{printerDetailsTitle}">
          <settings-cups-printer-details-page printer="{{detailPrinter_}}">
          </settings-cups-printer-details-page>
        </settings-subpage>
      </template>
</if>
      <template is="dom-if" route-path="/cloudPrinters">
        <settings-subpage
            associated-control="[[$$('#cloudPrinters')]]"
            page-title="$i18n{cloudPrintersTitle}">
          <settings-cloud-printers prefs="{{prefs}}">
          </settings-cloud-printers>
        </settings-subpage>
      </template>
    </settings-animated-pages>
  </template>
  <script src="printing_page.js"></script>
</dom-module>
