<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/html/polymer.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-input/paper-input.html">
<link rel="import" href="/i18n_setup.html">
<link rel="import" href="/search_engines_page/search_engines_browser_proxy.html">

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