| OLD | NEW |
| (Empty) |
| 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 // If omitted, this engine does not support rendering a new tab page. | |
| 32 { "field": "new_tab_url", "type": "string", "optional": true }, | |
| 33 // The followings are post parameters for the corresponding search URL. | |
| 34 // If omitted, a GET request will be sent when using the corresponding | |
| 35 // search URL. Otherwise, a POST request will be sent. | |
| 36 // The string of post parameters consists of comma-separated name/value | |
| 37 // pairs, e.g.: | |
| 38 // "name1=value1,name2={template1},...". | |
| 39 // In each name/value pair, the equal sign('=') must be delimiter between | |
| 40 // name and value. In above example, the "value1" is the constant value for | |
| 41 // "name1", which is not replaceable. The {template1} is a replaceable value | |
| 42 // for name2, the actual value will be replaced with real search terms data. | |
| 43 { "field": "search_url_post_params", "type": "string", "optional": true }, | |
| 44 { "field": "suggest_url_post_params", "type": "string", "optional": true }, | |
| 45 { "field": "instant_url_post_params", "type": "string", "optional": true }, | |
| 46 { "field": "image_url_post_params", "type": "string", "optional": true }, | |
| 47 // A list of URL patterns that can be used, in addition to |search_url|, | |
| 48 // to extract search terms from a URL. | |
| 49 // If "search_url_post_params" is not empty, then all alternate URLs are | |
| 50 // sent using POST with using same post parameters as the search URL. | |
| 51 { | |
| 52 "field": "alternate_urls", | |
| 53 "type": "array", | |
| 54 "contents": { "type": "string" }, | |
| 55 "optional": true | |
| 56 }, | |
| 57 // A parameter that, if present in the query or ref parameters of a | |
| 58 // search_url or instant_url, causes Chrome to replace the URL with the | |
| 59 // search term. This can be {google:instantExtendedEnabledKey}. | |
| 60 { | |
| 61 "field": "search_terms_replacement_key", | |
| 62 "type": "string", | |
| 63 "optional": true | |
| 64 }, | |
| 65 { | |
| 66 "field": "type", | |
| 67 "type": "enum", | |
| 68 "ctype": "SearchEngineType", | |
| 69 "default": "SEARCH_ENGINE_OTHER", | |
| 70 "optional": true | |
| 71 }, | |
| 72 // Unique id for this prepopulate engine (corresponds to | |
| 73 // TemplateURL::prepopulate_id). This ID must be greater than zero and must | |
| 74 // remain the same for a particular site regardless of how the url changes; | |
| 75 // the ID is used when modifying engine data in subsequent versions, so that | |
| 76 // we can find the "old" entry to update even when the name or URL changes. | |
| 77 // | |
| 78 // This ID must be "unique" within one country's prepopulated data, but two | |
| 79 // entries can share an ID if they represent the "same" engine (e.g. Yahoo! | |
| 80 // US vs. Yahoo! UK) and will not appear in the same user-visible data set. | |
| 81 // This facilitates changes like adding more specific per-country data in | |
| 82 // the future; in such a case the localized engines will transparently | |
| 83 // replace the previous, non-localized versions. For engines where we need | |
| 84 // two instances to appear for one country (e.g. Bing Search U.S. English | |
| 85 // and Spanish), we must use two different unique IDs (and different | |
| 86 // keywords). | |
| 87 // | |
| 88 // See prepopulated_engines.json for the list of available IDs. | |
| 89 { "field": "id", "type": "int" } | |
| 90 ] | |
| 91 } | |
| OLD | NEW |