Home | History | Annotate | Download | only in search_engines
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 // This file is used by json_to_struct.py to generate prepopulated_engine.h/cc.
      6 // Any time you modify this file regenerate the .h/.cc. See
      7 // prepopulated_engines.json for details.
      8 
      9 {
     10   "type_name": "PrepopulatedEngine",
     11   "headers": [
     12     "chrome/browser/search_engines/search_engine_type.h"
     13   ],
     14   "schema": [
     15     { "field": "name", "type": "string16" },
     16     { "field": "keyword", "type": "string16" },
     17     { "field": "favicon_url", "type": "string" },
     18     { "field": "search_url", "type": "string" },
     19     {
     20       "field": "encoding",
     21       "type": "string",
     22       "default": "UTF-8",
     23       "optional": true
     24     },
     25     // If omitted, this engine does not support suggestions.
     26     { "field": "suggest_url", "type": "string", "optional": true },
     27     // If omitted, this engine does not support instant.
     28     { "field": "instant_url", "type": "string", "optional": true },
     29     // If omitted, this engine does not support image search.
     30     { "field": "image_url", "type": "string", "optional": true },
     31     // The followings are post parameters for the corresponding search URL.
     32     // If omitted, a GET request will be sent when using the corresponding
     33     // search URL. Otherwise, a POST request will be sent.
     34     // The string of post parameters consists of comma-separated name/value
     35     // pairs, e.g.:
     36     // "name1=value1,name2={template1},...".
     37     // In each name/value pair, the equal sign('=') must be delimiter between
     38     // name and value. In above example, the "value1" is the constant value for
     39     // "name1", which is not replaceable. The {template1} is a replaceable value
     40     // for name2, the actual value will be replaced with real search terms data.
     41     { "field": "search_url_post_params", "type": "string", "optional": true },
     42     { "field": "suggest_url_post_params", "type": "string", "optional": true },
     43     { "field": "instant_url_post_params", "type": "string", "optional": true },
     44     { "field": "image_url_post_params", "type": "string", "optional": true },
     45     // A list of URL patterns that can be used, in addition to |search_url|,
     46     // to extract search terms from a URL.
     47     // If "search_url_post_params" is not empty, then all alternate URLs are
     48     // sent using POST with using same post parameters as the search URL.
     49     {
     50       "field": "alternate_urls",
     51       "type": "array",
     52       "contents": { "type": "string" },
     53       "optional": true
     54     },
     55     // A parameter that, if present in the query or ref parameters of a
     56     // search_url or instant_url, causes Chrome to replace the URL with the
     57     // search term. This can be {google:instantExtendedEnabledKey}.
     58     {
     59       "field": "search_terms_replacement_key",
     60       "type": "string",
     61       "optional": true
     62     },
     63     {
     64       "field": "type",
     65       "type": "enum",
     66       "ctype": "SearchEngineType",
     67       "default": "SEARCH_ENGINE_OTHER",
     68       "optional": true
     69     },
     70     // Unique id for this prepopulate engine (corresponds to
     71     // TemplateURL::prepopulate_id). This ID must be greater than zero and must
     72     // remain the same for a particular site regardless of how the url changes;
     73     // the ID is used when modifying engine data in subsequent versions, so that
     74     // we can find the "old" entry to update even when the name or URL changes.
     75     //
     76     // This ID must be "unique" within one country's prepopulated data, but two
     77     // entries can share an ID if they represent the "same" engine (e.g. Yahoo!
     78     // US vs. Yahoo! UK) and will not appear in the same user-visible data set.
     79     // This facilitates changes like adding more specific per-country data in
     80     // the future; in such a case the localized engines will transparently
     81     // replace the previous, non-localized versions.  For engines where we need
     82     // two instances to appear for one country (e.g. Bing Search U.S. English
     83     // and Spanish), we must use two different unique IDs (and different
     84     // keywords).
     85     //
     86     // See prepopulated_engines.json for the list of available IDs.
     87     { "field": "id", "type": "int" }
     88   ]
     89 }
     90