Index: chrome/browser/search_engines/template_url_prepopulate_data.cc |
diff --git a/chrome/browser/search_engines/template_url_prepopulate_data.cc b/chrome/browser/search_engines/template_url_prepopulate_data.cc |
index c89a3f0ba8e87bb5ef328af118b2caebba37423d..144e75fb5b47216f0ff23cc4fb2719ca0e374179 100644 |
--- a/chrome/browser/search_engines/template_url_prepopulate_data.cc |
+++ b/chrome/browser/search_engines/template_url_prepopulate_data.cc |
@@ -9,6 +9,7 @@ |
#endif |
#include "base/command_line.h" |
+#include "base/json/json_reader.h" |
#include "base/logging.h" |
#include "base/memory/scoped_vector.h" |
#include "base/string16.h" |
@@ -54,6 +55,9 @@ struct PrepopulatedEngine { |
// suggestions. |
const char* const instant_url; // If NULL, this engine does not support |
// instant. |
+ // A JSON array containing a list of URL patterns that can be used, in |
+ // addition to |search_url|, to extract search terms from a URL. Can be NULL. |
+ const char* const alternate_urls; |
// SEARCH_ENGINE_OTHER if there is no matching type. |
const SearchEngineType type; |
// Unique id for this prepopulate engine (corresponds to |
@@ -97,6 +101,7 @@ const PrepopulatedEngine abcsok = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_ABCSOK, |
72, |
}; |
@@ -109,6 +114,7 @@ const PrepopulatedEngine altavista = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_ALTAVISTA, |
89, |
}; |
@@ -121,6 +127,7 @@ const PrepopulatedEngine altavista_ar = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_ALTAVISTA, |
89, |
}; |
@@ -133,6 +140,7 @@ const PrepopulatedEngine altavista_se = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_ALTAVISTA, |
89, |
}; |
@@ -145,6 +153,7 @@ const PrepopulatedEngine aol = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
35, |
}; |
@@ -157,6 +166,7 @@ const PrepopulatedEngine araby = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
12, |
}; |
@@ -169,6 +179,7 @@ const PrepopulatedEngine ask = { |
"UTF-8", |
"http://ss.ask.com/query?q={searchTerms}&li=ff", |
NULL, |
+ NULL, |
SEARCH_ENGINE_ASK, |
4, |
}; |
@@ -181,6 +192,7 @@ const PrepopulatedEngine ask_de = { |
"UTF-8", |
"http://ss.de.ask.com/query?q={searchTerms}&li=ff", |
NULL, |
+ NULL, |
SEARCH_ENGINE_ASK, |
4, |
}; |
@@ -193,6 +205,7 @@ const PrepopulatedEngine ask_es = { |
"UTF-8", |
"http://ss.es.ask.com/query?q={searchTerms}&li=ff", |
NULL, |
+ NULL, |
SEARCH_ENGINE_ASK, |
4, |
}; |
@@ -205,6 +218,7 @@ const PrepopulatedEngine ask_it = { |
"UTF-8", |
"http://ss.it.ask.com/query?q={searchTerms}&li=ff", |
NULL, |
+ NULL, |
SEARCH_ENGINE_ASK, |
4, |
}; |
@@ -217,6 +231,7 @@ const PrepopulatedEngine ask_nl = { |
"UTF-8", |
"http://ss.nl.ask.com/query?q={searchTerms}&li=ff", |
NULL, |
+ NULL, |
SEARCH_ENGINE_ASK, |
4, |
}; |
@@ -229,6 +244,7 @@ const PrepopulatedEngine ask_uk = { |
"UTF-8", |
"http://ss.uk.ask.com/query?q={searchTerms}&li=ff", |
NULL, |
+ NULL, |
SEARCH_ENGINE_ASK, |
4, |
}; |
@@ -241,6 +257,7 @@ const PrepopulatedEngine atlas_cz = { |
"windows-1250", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
27, |
}; |
@@ -253,6 +270,7 @@ const PrepopulatedEngine atlas_sk = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
27, |
}; |
@@ -265,6 +283,7 @@ const PrepopulatedEngine baidu = { |
"GB2312", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_BAIDU, |
21, |
}; |
@@ -277,6 +296,7 @@ const PrepopulatedEngine bing = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -289,6 +309,7 @@ const PrepopulatedEngine bing_ar_XA = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
7, // Can't be 3 as this has to appear in the Arabian countries' lists |
// alongside bing_en_XA. |
@@ -302,6 +323,7 @@ const PrepopulatedEngine bing_bg_BG = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -314,6 +336,7 @@ const PrepopulatedEngine bing_cs_CZ = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -326,6 +349,7 @@ const PrepopulatedEngine bing_da_DK = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -338,6 +362,7 @@ const PrepopulatedEngine bing_de_AT = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -350,6 +375,7 @@ const PrepopulatedEngine bing_de_CH = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -362,6 +388,7 @@ const PrepopulatedEngine bing_de_DE = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -374,6 +401,7 @@ const PrepopulatedEngine bing_el_GR = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -386,6 +414,7 @@ const PrepopulatedEngine bing_en_AU = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -398,6 +427,7 @@ const PrepopulatedEngine bing_en_CA = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -410,6 +440,7 @@ const PrepopulatedEngine bing_en_GB = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -422,6 +453,7 @@ const PrepopulatedEngine bing_en_ID = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -434,6 +466,7 @@ const PrepopulatedEngine bing_en_IE = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -446,6 +479,7 @@ const PrepopulatedEngine bing_en_IN = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -458,6 +492,7 @@ const PrepopulatedEngine bing_en_MY = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -470,6 +505,7 @@ const PrepopulatedEngine bing_en_NZ = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -482,6 +518,7 @@ const PrepopulatedEngine bing_en_PH = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -494,6 +531,7 @@ const PrepopulatedEngine bing_en_SG = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -506,6 +544,7 @@ const PrepopulatedEngine bing_en_US = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -518,6 +557,7 @@ const PrepopulatedEngine bing_en_XA = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -530,6 +570,7 @@ const PrepopulatedEngine bing_en_ZA = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -542,6 +583,7 @@ const PrepopulatedEngine bing_es_AR = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -554,6 +596,7 @@ const PrepopulatedEngine bing_es_CL = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -566,6 +609,7 @@ const PrepopulatedEngine bing_es_ES = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -578,6 +622,7 @@ const PrepopulatedEngine bing_es_MX = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -590,6 +635,7 @@ const PrepopulatedEngine bing_es_XL = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -602,6 +648,7 @@ const PrepopulatedEngine bing_et_EE = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -614,6 +661,7 @@ const PrepopulatedEngine bing_fi_FI = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -626,6 +674,7 @@ const PrepopulatedEngine bing_fr_BE = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
7, |
}; |
@@ -638,6 +687,7 @@ const PrepopulatedEngine bing_fr_CA = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
7, |
}; |
@@ -650,6 +700,7 @@ const PrepopulatedEngine bing_fr_CH = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
7, |
}; |
@@ -662,6 +713,7 @@ const PrepopulatedEngine bing_fr_FR = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -674,6 +726,7 @@ const PrepopulatedEngine bing_he_IL = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -686,6 +739,7 @@ const PrepopulatedEngine bing_hr_HR = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -698,6 +752,7 @@ const PrepopulatedEngine bing_hu_HU = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -710,6 +765,7 @@ const PrepopulatedEngine bing_it_IT = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -722,6 +778,7 @@ const PrepopulatedEngine bing_ja_JP = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -734,6 +791,7 @@ const PrepopulatedEngine bing_ko_KR = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -746,6 +804,7 @@ const PrepopulatedEngine bing_lt_LT = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -758,6 +817,7 @@ const PrepopulatedEngine bing_lv_LV = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -770,6 +830,7 @@ const PrepopulatedEngine bing_nb_NO = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -782,6 +843,7 @@ const PrepopulatedEngine bing_nl_BE = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -794,6 +856,7 @@ const PrepopulatedEngine bing_nl_NL = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -806,6 +869,7 @@ const PrepopulatedEngine bing_pl_PL = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -818,6 +882,7 @@ const PrepopulatedEngine bing_pt_BR = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -830,6 +895,7 @@ const PrepopulatedEngine bing_pt_PT = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -842,6 +908,7 @@ const PrepopulatedEngine bing_ro_RO = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -854,6 +921,7 @@ const PrepopulatedEngine bing_ru_RU = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -866,6 +934,7 @@ const PrepopulatedEngine bing_sl_SI = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -878,6 +947,7 @@ const PrepopulatedEngine bing_sk_SK = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -890,6 +960,7 @@ const PrepopulatedEngine bing_sv_SE = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -902,6 +973,7 @@ const PrepopulatedEngine bing_th_TH = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -914,6 +986,7 @@ const PrepopulatedEngine bing_tr_TR = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -926,6 +999,7 @@ const PrepopulatedEngine bing_uk_UA = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -938,6 +1012,7 @@ const PrepopulatedEngine bing_zh_CN = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -950,6 +1025,7 @@ const PrepopulatedEngine bing_zh_HK = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -962,6 +1038,7 @@ const PrepopulatedEngine bing_zh_TW = { |
"UTF-8", |
"http://api.bing.com/osjson.aspx?query={searchTerms}&language={language}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_BING, |
3, |
}; |
@@ -974,6 +1051,7 @@ const PrepopulatedEngine centrum_cz = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_CENTRUM, |
26, |
}; |
@@ -986,6 +1064,7 @@ const PrepopulatedEngine centrum_sk = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_CENTRUM, |
26, |
}; |
@@ -999,6 +1078,7 @@ const PrepopulatedEngine daum = { |
"http://sug.search.daum.net/search_nsuggest?mod=fxjson&code=utf_in_out&" |
"q={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_DAUM, |
68, |
}; |
@@ -1011,6 +1091,7 @@ const PrepopulatedEngine delfi_lt = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_DELFI, |
45, |
}; |
@@ -1023,6 +1104,7 @@ const PrepopulatedEngine delfi_lv = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_DELFI, |
45, |
}; |
@@ -1035,6 +1117,7 @@ const PrepopulatedEngine diri = { |
"windows-1251", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_DIRI, |
32, |
}; |
@@ -1047,6 +1130,7 @@ const PrepopulatedEngine eniro_fi = { |
"ISO-8859-1", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
29, |
}; |
@@ -1059,6 +1143,7 @@ const PrepopulatedEngine eniro_se = { |
"ISO-8859-1", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
29, |
}; |
@@ -1071,6 +1156,7 @@ const PrepopulatedEngine fonecta_02_fi = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
46, |
}; |
@@ -1083,6 +1169,7 @@ const PrepopulatedEngine goo = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_GOO, |
23, |
}; |
@@ -1101,6 +1188,8 @@ const PrepopulatedEngine google = { |
"sugkey={google:suggestAPIKeyParameter}", |
"{google:baseURL}webhp?sourceid=chrome-instant&{google:RLZ}" |
"{google:instantEnabledParameter}ie={inputEncoding}", |
+ "[\"{google:baseURL}#q={searchTerms}\", " |
+ "\"{google:baseURL}search#q={searchTerms}\"]", |
SEARCH_ENGINE_GOOGLE, |
1, |
}; |
@@ -1113,6 +1202,7 @@ const PrepopulatedEngine guruji = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
38, |
}; |
@@ -1125,6 +1215,7 @@ const PrepopulatedEngine hispavista = { |
"iso-8859-1", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
18, |
}; |
@@ -1137,6 +1228,7 @@ const PrepopulatedEngine in = { |
"ISO-8859-7", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_IN, |
54, |
}; |
@@ -1149,6 +1241,7 @@ const PrepopulatedEngine jabse = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
19, |
}; |
@@ -1161,6 +1254,7 @@ const PrepopulatedEngine jubii = { |
"ISO-8859-1", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
28, |
}; |
@@ -1173,6 +1267,7 @@ const PrepopulatedEngine kvasir = { |
"ISO-8859-1", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
73, |
}; |
@@ -1185,6 +1280,7 @@ const PrepopulatedEngine latne = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
71, |
}; |
@@ -1197,6 +1293,7 @@ const PrepopulatedEngine leit = { |
"ISO-8859-1", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
59, |
}; |
@@ -1209,6 +1306,7 @@ const PrepopulatedEngine libero = { |
"ISO-8859-1", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
63, |
}; |
@@ -1221,6 +1319,7 @@ const PrepopulatedEngine mail_ru = { |
"windows-1251", |
"http://suggests.go.mail.ru/chrome?q={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_MAILRU, |
83, |
}; |
@@ -1233,6 +1332,7 @@ const PrepopulatedEngine maktoob = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
13, |
}; |
@@ -1245,6 +1345,7 @@ const PrepopulatedEngine masrawy = { |
"windows-1256", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
14, |
}; |
@@ -1257,6 +1358,7 @@ const PrepopulatedEngine mynet = { |
"windows-1254", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
101, |
}; |
@@ -1269,6 +1371,7 @@ const PrepopulatedEngine najdi = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_NAJDI, |
87, |
}; |
@@ -1281,6 +1384,7 @@ const PrepopulatedEngine nate = { |
"EUC-KR", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
69, |
}; |
@@ -1294,6 +1398,7 @@ const PrepopulatedEngine naver = { |
"http://ac.search.naver.com/autocompl?m=s&ie={inputEncoding}&oe=utf-8&" |
"q={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_NAVER, |
67, |
}; |
@@ -1306,6 +1411,7 @@ const PrepopulatedEngine neti = { |
"ISO-8859-1", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_NETI, |
44, |
}; |
@@ -1318,6 +1424,7 @@ const PrepopulatedEngine netsprint = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_NETSPRINT, |
30, |
}; |
@@ -1330,6 +1437,7 @@ const PrepopulatedEngine nur_kz = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
20, |
}; |
@@ -1342,6 +1450,7 @@ const PrepopulatedEngine ok = { |
"ISO-8859-2", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OK, |
6, |
}; |
@@ -1354,6 +1463,7 @@ const PrepopulatedEngine onet = { |
"ISO-8859-2", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
75, |
}; |
@@ -1366,6 +1476,7 @@ const PrepopulatedEngine pogodak_rs = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_POGODAK, |
24, |
}; |
@@ -1378,6 +1489,7 @@ const PrepopulatedEngine rambler = { |
"windows-1251", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_RAMBLER, |
16, |
}; |
@@ -1390,6 +1502,7 @@ const PrepopulatedEngine rediff = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
37, |
}; |
@@ -1402,6 +1515,7 @@ const PrepopulatedEngine rednano = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
41, |
}; |
@@ -1414,6 +1528,7 @@ const PrepopulatedEngine sanook = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_SANOOK, |
100, |
}; |
@@ -1426,6 +1541,7 @@ const PrepopulatedEngine sapo = { |
"UTF-8", |
"http://pesquisa.sapo.pt/livesapo?q={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_SAPO, |
77, |
}; |
@@ -1438,6 +1554,7 @@ const PrepopulatedEngine search_de_CH = { |
"ISO-8859-1", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
51, |
}; |
@@ -1450,6 +1567,7 @@ const PrepopulatedEngine search_fr_CH = { |
"ISO-8859-1", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
22, |
}; |
@@ -1463,6 +1581,7 @@ const PrepopulatedEngine seznam = { |
"http:///suggest.fulltext.seznam.cz/?dict=fulltext_ff&phrase={searchTerms}&" |
"encoding={inputEncoding}&response_encoding=utf-8", |
NULL, |
+ NULL, |
SEARCH_ENGINE_SEZNAM, |
25, |
}; |
@@ -1475,6 +1594,7 @@ const PrepopulatedEngine terra_ar = { |
"ISO-8859-1", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
90, |
}; |
@@ -1487,6 +1607,7 @@ const PrepopulatedEngine terra_es = { |
"ISO-8859-1", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
90, |
}; |
@@ -1499,6 +1620,7 @@ const PrepopulatedEngine tut = { |
"windows-1251", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_TUT, |
17, |
}; |
@@ -1511,6 +1633,7 @@ const PrepopulatedEngine uol = { |
"ISO-8859-1", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
82, |
}; |
@@ -1523,6 +1646,7 @@ const PrepopulatedEngine virgilio = { |
"ISO-8859-1", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_VIRGILIO, |
62, |
}; |
@@ -1535,6 +1659,7 @@ const PrepopulatedEngine walla = { |
"windows-1255", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_WALLA, |
55, |
}; |
@@ -1547,6 +1672,7 @@ const PrepopulatedEngine wp = { |
"ISO-8859-2", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
76, |
}; |
@@ -1559,6 +1685,7 @@ const PrepopulatedEngine yahoo = { |
"UTF-8", |
"http://ff.search.yahoo.com/gossip?output=fxjson&command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1576,6 +1703,7 @@ const PrepopulatedEngine yahoo_ar = { |
"http://ar-sayt.ff.search.yahoo.com/gossip-ar-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1589,6 +1717,7 @@ const PrepopulatedEngine yahoo_at = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1603,6 +1732,7 @@ const PrepopulatedEngine yahoo_au = { |
"http://aue-sayt.ff.search.yahoo.com/gossip-au-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1617,6 +1747,7 @@ const PrepopulatedEngine yahoo_br = { |
"http://br-sayt.ff.search.yahoo.com/gossip-br-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1631,6 +1762,7 @@ const PrepopulatedEngine yahoo_ca = { |
"http://gossip.ca.yahoo.com/gossip-ca-sayt?output=fxjsonp&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1644,6 +1776,7 @@ const PrepopulatedEngine yahoo_ch = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1658,6 +1791,7 @@ const PrepopulatedEngine yahoo_cl = { |
"http://gossip.telemundo.yahoo.com/gossip-e1-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1671,6 +1805,7 @@ const PrepopulatedEngine yahoo_cn = { |
"GB2312", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1685,6 +1820,7 @@ const PrepopulatedEngine yahoo_co = { |
"http://gossip.telemundo.yahoo.com/gossip-e1-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1699,6 +1835,7 @@ const PrepopulatedEngine yahoo_de = { |
"http://de-sayt.ff.search.yahoo.com/gossip-de-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1712,6 +1849,7 @@ const PrepopulatedEngine yahoo_dk = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1726,6 +1864,7 @@ const PrepopulatedEngine yahoo_es = { |
"http://es-sayt.ff.search.yahoo.com/gossip-es-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1739,6 +1878,7 @@ const PrepopulatedEngine yahoo_fi = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1753,6 +1893,7 @@ const PrepopulatedEngine yahoo_fr = { |
"http://fr-sayt.ff.search.yahoo.com/gossip-fr-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1766,6 +1907,7 @@ const PrepopulatedEngine yahoo_hk = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1780,6 +1922,7 @@ const PrepopulatedEngine yahoo_id = { |
"http://id-sayt.ff.search.yahoo.com/gossip-id-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1794,6 +1937,7 @@ const PrepopulatedEngine yahoo_in = { |
"http://in-sayt.ff.search.yahoo.com/gossip-in-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1808,6 +1952,7 @@ const PrepopulatedEngine yahoo_it = { |
"http://it-sayt.ff.search.yahoo.com/gossip-it-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1821,6 +1966,7 @@ const PrepopulatedEngine yahoo_jp = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOOJP, |
2, |
}; |
@@ -1835,6 +1981,7 @@ const PrepopulatedEngine yahoo_kr = { |
"http://kr.atc.search.yahoo.com/atcx.php?property=main&ot=fxjson&" |
"ei=utf8&eo=utf8&command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1849,6 +1996,7 @@ const PrepopulatedEngine yahoo_malaysia = { |
"http://my-sayt.ff.search.yahoo.com/gossip-my-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1863,6 +2011,7 @@ const PrepopulatedEngine yahoo_mx = { |
"http://gossip.mx.yahoo.com/gossip-mx-sayt?output=fxjsonp&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1876,6 +2025,7 @@ const PrepopulatedEngine yahoo_nl = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1889,6 +2039,7 @@ const PrepopulatedEngine yahoo_no = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1903,6 +2054,7 @@ const PrepopulatedEngine yahoo_nz = { |
"http://aue-sayt.ff.search.yahoo.com/gossip-nz-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1917,6 +2069,7 @@ const PrepopulatedEngine yahoo_pe = { |
"http://gossip.telemundo.yahoo.com/gossip-e1-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1931,6 +2084,7 @@ const PrepopulatedEngine yahoo_ph = { |
"http://ph-sayt.ff.search.yahoo.com/gossip-ph-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1944,6 +2098,7 @@ const PrepopulatedEngine yahoo_qc = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOOQC, |
5, // Can't be 2 as this has to appear in the Canada list alongside yahoo_ca. |
}; |
@@ -1957,6 +2112,7 @@ const PrepopulatedEngine yahoo_ru = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1970,6 +2126,7 @@ const PrepopulatedEngine yahoo_se = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1984,6 +2141,7 @@ const PrepopulatedEngine yahoo_sg = { |
"http://sg-sayt.ff.search.yahoo.com/gossip-sg-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -1998,6 +2156,7 @@ const PrepopulatedEngine yahoo_th = { |
"http://th-sayt.ff.search.yahoo.com/gossip-th-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -2011,6 +2170,7 @@ const PrepopulatedEngine yahoo_tw = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -2025,6 +2185,7 @@ const PrepopulatedEngine yahoo_uk = { |
"http://uk-sayt.ff.search.yahoo.com/gossip-uk-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -2039,6 +2200,7 @@ const PrepopulatedEngine yahoo_ve = { |
"http://gossip.telemundo.yahoo.com/gossip-e1-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -2053,6 +2215,7 @@ const PrepopulatedEngine yahoo_vn = { |
"http://vn-sayt.ff.search.yahoo.com/gossip-vn-sayt?output=fxjson&" |
"command={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YAHOO, |
2, |
}; |
@@ -2065,6 +2228,7 @@ const PrepopulatedEngine yamli = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_OTHER, |
11, |
}; |
@@ -2077,6 +2241,7 @@ const PrepopulatedEngine yandex_ru = { |
"UTF-8", |
"http://suggest.yandex.net/suggest-ff.cgi?part={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YANDEX, |
15, |
}; |
@@ -2089,6 +2254,7 @@ const PrepopulatedEngine yandex_ua = { |
"UTF-8", |
"http://suggest.yandex.net/suggest-ff.cgi?part={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YANDEX, |
15, |
}; |
@@ -2101,6 +2267,7 @@ const PrepopulatedEngine zoznam = { |
"windows-1250", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_ZOZNAM, |
85, |
}; |
@@ -2119,6 +2286,7 @@ const PrepopulatedEngine all_by = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_ALL_BY, |
33, |
}; |
@@ -2131,6 +2299,7 @@ const PrepopulatedEngine aport = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_APORT, |
34, |
}; |
@@ -2143,6 +2312,7 @@ const PrepopulatedEngine avg = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_AVG, |
50, |
}; |
@@ -2155,6 +2325,7 @@ const PrepopulatedEngine avg_i = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_AVG, |
52, |
}; |
@@ -2167,6 +2338,7 @@ const PrepopulatedEngine conduit = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_CONDUIT, |
36, |
}; |
@@ -2179,6 +2351,7 @@ const PrepopulatedEngine icq = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_ICQ, |
39, |
}; |
@@ -2191,6 +2364,7 @@ const PrepopulatedEngine meta_ua = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_META_UA, |
40, |
}; |
@@ -2203,6 +2377,7 @@ const PrepopulatedEngine metabot_ru = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_METABOT_RU, |
42, |
}; |
@@ -2215,6 +2390,7 @@ const PrepopulatedEngine nigma = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_NIGMA, |
43, |
}; |
@@ -2227,6 +2403,7 @@ const PrepopulatedEngine qip = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_QIP, |
47, |
}; |
@@ -2239,6 +2416,7 @@ const PrepopulatedEngine ukr_net = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_UKR_NET, |
48, |
}; |
@@ -2251,6 +2429,7 @@ const PrepopulatedEngine webalta = { |
"UTF-8", |
NULL, |
NULL, |
+ NULL, |
SEARCH_ENGINE_WEBALTA, |
49, |
}; |
@@ -2263,6 +2442,7 @@ const PrepopulatedEngine yandex_tr = { |
"UTF-8", |
"http://suggest.yandex.net/suggest-ff.cgi?part={searchTerms}", |
NULL, |
+ NULL, |
SEARCH_ENGINE_YANDEX, |
15, |
}; |
@@ -3329,28 +3509,40 @@ void RegisterUserPrefs(PrefService* prefs) { |
int GetDataVersion(PrefService* prefs) { |
// Increment this if you change the above data in ways that mean users with |
// existing data should get a new version. |
- const int kCurrentDataVersion = 43; |
+ const int kCurrentDataVersion = 44; |
// Allow tests to override the local version. |
return (prefs && prefs->HasPrefPath(prefs::kSearchProviderOverridesVersion)) ? |
prefs->GetInteger(prefs::kSearchProviderOverridesVersion) : |
kCurrentDataVersion; |
} |
-TemplateURL* MakePrepopulatedTemplateURL(Profile* profile, |
- const string16& name, |
- const string16& keyword, |
- const base::StringPiece& search_url, |
- const base::StringPiece& suggest_url, |
- const base::StringPiece& instant_url, |
- const base::StringPiece& favicon_url, |
- const base::StringPiece& encoding, |
- int id) { |
+TemplateURL* MakePrepopulatedTemplateURL( |
+ Profile* profile, |
Peter Kasting
2012/10/02 21:47:59
Nit: Why did you change the indenting here? The o
beaudoin
2012/10/03 22:46:52
I was using base::ListValue at some point which we
|
+ const string16& name, |
+ const string16& keyword, |
+ const base::StringPiece& search_url, |
+ const base::StringPiece& suggest_url, |
+ const base::StringPiece& instant_url, |
+ const ListValue& alternate_urls, |
+ const base::StringPiece& favicon_url, |
+ const base::StringPiece& encoding, |
+ int id) { |
+ |
TemplateURLData data; |
+ std::string alternate_url; |
+ |
data.short_name = name; |
data.SetKeyword(keyword); |
data.SetURL(search_url.as_string()); |
data.suggestions_url = suggest_url.as_string(); |
data.instant_url = instant_url.as_string(); |
+ for (size_t i = 0; i < alternate_urls.GetSize(); ++i) { |
+ if (alternate_urls.GetString(i, &alternate_url)) { |
+ data.alternate_urls.push_back(alternate_url); |
+ } else { |
+ LOG(ERROR) << "Invalid alternate url, expected a string."; |
Peter Kasting
2012/10/02 21:47:59
Nit: Rather than log, let's just DCHECK (or not ch
beaudoin
2012/10/03 22:46:52
No longer checking for GetString. The check would
|
+ } |
+ } |
data.favicon_url = GURL(favicon_url.as_string()); |
data.show_in_default_list = true; |
data.safe_for_autoreplace = true; |
@@ -3376,6 +3568,7 @@ void GetPrepopulatedTemplateFromPrefs(Profile* profile, |
std::string search_url; |
std::string suggest_url; |
std::string instant_url; |
+ const ListValue* alternate_urls; |
std::string favicon_url; |
std::string encoding; |
int id; |
@@ -3389,6 +3582,7 @@ void GetPrepopulatedTemplateFromPrefs(Profile* profile, |
engine->GetString("search_url", &search_url) && |
engine->GetString("suggest_url", &suggest_url) && |
engine->GetString("instant_url", &instant_url) && |
+ engine->GetList("alternate_urls", &alternate_urls) && |
engine->GetString("favicon_url", &favicon_url) && |
engine->GetString("encoding", &encoding) && |
engine->GetInteger("id", &id)) { |
@@ -3401,7 +3595,8 @@ void GetPrepopulatedTemplateFromPrefs(Profile* profile, |
continue; |
} |
t_urls->push_back(MakePrepopulatedTemplateURL(profile, name, keyword, |
- search_url, suggest_url, instant_url, favicon_url, encoding, id)); |
+ search_url, suggest_url, instant_url, *alternate_urls, favicon_url, |
+ encoding, id)); |
} |
} |
@@ -3409,9 +3604,23 @@ void GetPrepopulatedTemplateFromPrefs(Profile* profile, |
TemplateURL* MakePrepopulatedTemplateURLFromPrepopulateEngine( |
Profile* profile, |
const PrepopulatedEngine& engine) { |
+ |
+ // Use an empty list if there are no alternate_urls. |
+ ListValue empty_list; |
+ ListValue* alternate_urls = &empty_list; |
+ // Will hold the result of |ReadToValue|, which we own. |
+ scoped_ptr<Value> value; |
+ if (engine.alternate_urls) { |
+ base::JSONReader json_reader; |
+ value.reset(json_reader.ReadToValue(std::string(engine.alternate_urls))); |
+ if (!value.get() || !value->GetAsList(&alternate_urls)) |
+ LOG(ERROR) << "Cannot parse alternate_urls as JSON list."; |
Peter Kasting
2012/10/02 21:47:59
Nit: Again, let's either DCHECK or not check.
beaudoin
2012/10/03 22:46:52
No longer checking for GetAsList. The check would
|
+ } |
+ |
return MakePrepopulatedTemplateURL(profile, WideToUTF16(engine.name), |
WideToUTF16(engine.keyword), engine.search_url, engine.suggest_url, |
- engine.instant_url, engine.favicon_url, engine.encoding, engine.id); |
+ engine.instant_url, *alternate_urls, |
+ engine.favicon_url, engine.encoding, engine.id); |
} |
void GetPrepopulatedEngines(Profile* profile, |