<link rel="import" href="chrome://resources/html/polymer.html">

<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="search_engines_browser_proxy.html">

<dom-module id="settings-search-engine-dialog">
  <template>
    <style include="settings-shared">
    </style>
    <cr-dialog id="dialog" close-text="$i18n{close}">
      <div slot="title">[[dialogTitle_]]</div>
      <div slot="body" spellcheck="false">
         <cr-input id="searchEngine"
            label="$i18n{searchEnginesSearchEngine}"
            error-message="$i18n{notValid}"
            value="{{searchEngine_}}" on-input="validate_"
            autofocus>
        </cr-input>
        <cr-input id="keyword"
            label="$i18n{searchEnginesKeyword}"
            error-message="$i18n{notValid}"
            value="{{keyword_}}" on-focus="validate_" on-input="validate_">
        </cr-input>
        <cr-input id="queryUrl"
            label="$i18n{searchEnginesQueryURLExplanation}"
            error-message="$i18n{notValid}"
            value="{{queryUrl_}}" on-focus="validate_" on-input="validate_"
            disabled$="[[model.urlLocked]]">
        </cr-input>
      </div>
      <div slot="button-container">
        <paper-button class="cancel-button" on-click="cancel_" id="cancel">
            $i18n{cancel}</paper-button>
        <paper-button id="actionButton" class="action-button"
            on-click="onActionButtonTap_">
          [[actionButtonText_]]
        </paper-button>
      </div>
    </cr-dialog>
  </template>
  <script src="search_engine_dialog.js"></script>
</dom-module>
