Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Unified Diff: chrome/browser/search_engines/prepopulated_engines_schema.json

Issue 11377049: Moving prepopulated search engines to a JSON file. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/search_engines/prepopulated_engines_schema.json
diff --git a/chrome/browser/search_engines/prepopulated_engines_schema.json b/chrome/browser/search_engines/prepopulated_engines_schema.json
new file mode 100644
index 0000000000000000000000000000000000000000..3d366c14a03e4704c5bd13884963fc34c17e5ce7
--- /dev/null
+++ b/chrome/browser/search_engines/prepopulated_engines_schema.json
@@ -0,0 +1,64 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// 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_engined.h/cc.
+
+
+{
+ "type_name": "PrepopulatedEngine",
+ "headers": [
+ "chrome/browser/search_engines/search_engine_type.h"
+ ],
+ "schema": [
+ { "field": "name", "type": "string16" },
+ { "field": "keyword", "type" : "string16" },
+ // If omitted, there is no favicon.
+ { "field": "favicon_url", "type" : "string" },
+ { "field": "search_url", "type" : "string" },
+ { "field": "encoding", "type" : "string" },
+ // If omitted, this engine does not support suggestions.
+ { "field": "suggest_url", "type" : "string" },
+ // If omitted, this engine does not support instant.
+ { "field": "instant_url", "type" : "string" },
+
+ // A list of URL patterns that can be used, in addition to |search_url|,
+ // to extract search terms from a URL.
+ { "field": "alternate_urls", "type": "string" },
+ // Use SEARCH_ENGINE_OTHER if there is no matching type.
+ {
+ "field": "type",
+ "type": "enum",
+ "ctype": "SearchEngineType",
+ "default": "SEARCH_ENGINE_OTHER"
+ },
+ // 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).
+ //
+ // The following unique IDs are available:
+ // 53, 56, 58, 60, 61, 64, 65, 66, 70, 74, 78, 79, 80, 81, 84, 86, 88,
+ // 91, 92, 93, 94, 95, 96, 97, 98, 99, 102+
Peter Kasting 2012/11/08 19:02:25 Seems like this list should be in the other JSON f
beaudoin 2012/11/09 04:16:53 Done.
+ //
+ // IDs > 1000 are reserved for distribution custom engines.
+ //
+ // NOTES:
+ // CHANGE THE ABOVE NUMBERS IF YOU ADD A NEW ENGINE; ID conflicts = bad!
+ // CHANGE kMaxPrepopulatedEngineID in template_url_prepopulate_data.cc if
+ // you add new engine outside of the current range or it will not be
+ // counted in stats.
+ { "field": "id", "type": "int" }
+ ]
+}

Powered by Google App Engine
This is Rietveld 408576698