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

<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.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="../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">
        <cr-button class="cancel-button" on-click="cancel_" id="cancel">
            $i18n{cancel}</cr-button>
        <cr-button id="actionButton" class="action-button"
            on-click="onActionButtonTap_">
          [[actionButtonText_]]
        </cr-button>
      </div>
    </cr-dialog>
  </template>
  <script src="search_engine_dialog.js"></script>
</dom-module>
