chromium/components/search_engines/prepopulated_engines_schema.json

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file is used by json_to_struct.py to generate prepopulated_engines.h/cc.
// Any time you modify this file regenerate the .h/.cc. See
// prepopulated_engines.json for details.

{
  "type_name": "PrepopulatedEngine",
  "headers": [
    "components/search_engines/search_engine_type.h",
    "components/search_engines/regulatory_extension_type.h"
  ],
  "schema": [
    { "field": "name", "type": "string16" },
    { "field": "keyword", "type": "string16" },
    { "field": "favicon_url", "type": "string" },
    { "field": "search_url", "type": "string" },
    {
      "field": "encoding",
      "type": "string",
      "default": "UTF-8",
      "optional": true
    },
    // If omitted, this engine does not support suggestions.
    { "field": "suggest_url", "type": "string", "optional": true },
    // If omitted, this engine does not support image search.
    { "field": "image_url", "type": "string", "optional": true },
    // If omitted, this engine does not support image translation.
    { "field": "image_translate_url", "type": "string", "optional": true },
    // If omitted, this engine does not support rendering a new tab page.
    { "field": "new_tab_url", "type": "string", "optional": true },
    // If omitted, this engine does not support contextual search.
    { "field": "contextual_search_url", "type": "string", "optional": true },
    // If omitted, this engine does not support a static logo.
    { "field": "logo_url", "type": "string", "optional": true },
    // If omitted, this engine does not support doodles. Note: Only at most one
    // of "doodle_url" and "logo_url" should be set.
    { "field": "doodle_url", "type": "string", "optional": true },
    // The followings are post parameters for the corresponding search URL.
    // If omitted, a GET request will be sent when using the corresponding
    // search URL. Otherwise, a POST request will be sent.
    // The string of post parameters consists of comma-separated name/value
    // pairs, e.g.:
    // "name1=value1,name2={template1},...".
    // In each name/value pair, the equal sign('=') must be delimiter between
    // name and value. In above example, the "value1" is the constant value for
    // "name1", which is not replaceable. The {template1} is a replaceable value
    // for name2, the actual value will be replaced with real search terms data.
    { "field": "search_url_post_params", "type": "string", "optional": true },
    { "field": "suggest_url_post_params", "type": "string", "optional": true },
    { "field": "image_url_post_params", "type": "string", "optional": true },
    // The parameter appended to the engine's search URL when constructing the
    // URL for the side search side panel.
    { "field": "side_search_param", "type": "string", "optional": true },
    // The parameter appended to the engine's |image_url| URL when constructing the
    // URL for the image search entry in the side panel.
    { "field": "side_image_search_param", "type": "string", "optional": true },
    // The key of the parameter identifying the source language for an image
    // translation. For example, if set to "sourcelang", the template parameter
    // "{imageTranslateSourceLocale}" would be replaced with "sourcelang=en"
    // for the language code "en". If left blank, the template parameter would
    // be replaced with simply "en".
    {
      "field": "image_translate_source_language_param_key",
      "type": "string",
      "optional": true
    },
    // The key of the parameter identifying the target language for an image
    // translation. For example, if set to "targetlang", the template parameter
    // "{imageTranslateTargetLocale}" would be replaced with "targetlang=en"
    // for the language code "en". If left blank, the template parameter would
    // be replaced with simply "en".
    {
      "field": "image_translate_target_language_param_key",
      "type": "string",
      "optional": true
    },
    // The label to use for image search related queries. If omitted, will use the
    // value under the "name" field for image search queries.
    { "field": "image_search_branding_label", "type": "string16", "optional": true},
    // The parameters making up the engine's canonical search URL in addition to
    // the search terms. These params disambiguate the search terms and
    // determine the fulfillment. For instance the same "Harry Potter" search
    // terms may refer to the novel series or the film series.
    {
      "field": "search_intent_params",
      "type": "array",
      "contents": { "type": "string" },
      "optional": true
    },
    // A list of URL patterns that can be used, in addition to |search_url|,
    // to extract search terms from a URL.
    // If "search_url_post_params" is not empty, then all alternate URLs are
    // sent using POST with using same post parameters as the search URL.
    {
      "field": "alternate_urls",
      "type": "array",
      "contents": { "type": "string" },
      "optional": true
    },
    {
      "field": "type",
      "type": "enum",
      "ctype": "SearchEngineType"
    },
    // Whether a connection to search_url should regularly be established when
    // the engine is set as the "default search engine". "ALLOWED" is the only
    // value that will enable the pre-connections.
    { "field": "preconnect_to_search_url", "type": "string", "optional": true },
    // Whether the client is allowed to prefetch Search queries that are likely
    // (in addition to queries that are recommended via suggestion server). This
    // is experimental.
    { "field": "prefetch_likely_navigations", "type": "string", "optional": true },
    // Unique id for this prepopulate engine (corresponds to
    // TemplateURL::prepopulate_id). This ID must be greater than zero and must
    // remain the same for a particular site regardless of how the url changes;
    // the ID is used when modifying engine data in subsequent versions, so that
    // we can find the "old" entry to update even when the name or URL changes.
    //
    // This ID must be "unique" within one country's prepopulated data, but two
    // entries can share an ID if they represent the "same" engine (e.g. Yahoo!
    // US vs. Yahoo! UK) and will not appear in the same user-visible data set.
    // This facilitates changes like adding more specific per-country data in
    // the future; in such a case the localized engines will transparently
    // replace the previous, non-localized versions.  For engines where we need
    // two instances to appear for one country (e.g. Bing Search U.S. English
    // and Spanish), we must use two different unique IDs (and different
    // keywords).
    //
    // See prepopulated_engines.json for the list of available IDs.
    { "field": "id", "type": "int" },

    // Regulatory specific extensions associated with this search engine.
    // Used to expand the {regulatory_extensions} keyword with parameters
    // appropriate for the regulatory program that triggered instantiation of
    // this definition.
    // Known options:
    // - "default" - the parameters to be used if the template url was not
    //   instantiated for any regulatory program.
    // - "android_eea" - the parameters to be used by TemplateUrl definitions
    //   instantiated in accordance with the EEA DMA.
    {
      "field": "regulatory_extensions",
      "type": "array",
      "contents": {
        "type": "struct",
        "type_name": "RegulatoryExtension",
        "fields": [
          { "field": "variant", "type": "enum", "ctype": "RegulatoryExtensionType" },
          { "field": "search_params", "type": "string" },
          { "field": "suggest_params", "type": "string" }
        ]
      },
      "optional": true
    }
  ]
}