diff --git a/chromium_src/components/search_engines/template_url_prepopulate_data.cc b/chromium_src/components/search_engines/template_url_prepopulate_data.cc index 11a62a8aa936..ea16b08d02c9 100644 --- a/chromium_src/components/search_engines/template_url_prepopulate_data.cc +++ b/chromium_src/components/search_engines/template_url_prepopulate_data.cc @@ -38,6 +38,41 @@ namespace { const std::map brave_engines_map = { {PREPOPULATED_ENGINE_ID_GOOGLE, &google}, + {PREPOPULATED_ENGINE_ID_YAHOO, &brave_yahoo}, + {PREPOPULATED_ENGINE_ID_YAHOO_AR, &brave_yahoo_ar}, + {PREPOPULATED_ENGINE_ID_YAHOO_AT, &brave_yahoo_at}, + {PREPOPULATED_ENGINE_ID_YAHOO_AU, &brave_yahoo_au}, + {PREPOPULATED_ENGINE_ID_YAHOO_BR, &brave_yahoo_br}, + {PREPOPULATED_ENGINE_ID_YAHOO_CA, &brave_yahoo_ca}, + {PREPOPULATED_ENGINE_ID_YAHOO_CH, &brave_yahoo_ch}, + {PREPOPULATED_ENGINE_ID_YAHOO_CL, &brave_yahoo_cl}, + {PREPOPULATED_ENGINE_ID_YAHOO_CO, &brave_yahoo_co}, + {PREPOPULATED_ENGINE_ID_YAHOO_DE, &brave_yahoo_de}, + {PREPOPULATED_ENGINE_ID_YAHOO_DK, &brave_yahoo_dk}, + {PREPOPULATED_ENGINE_ID_YAHOO_ES, &brave_yahoo_es}, + {PREPOPULATED_ENGINE_ID_YAHOO_FI, &brave_yahoo_fi}, + {PREPOPULATED_ENGINE_ID_YAHOO_FR, &brave_yahoo_fr}, + {PREPOPULATED_ENGINE_ID_YAHOO_HK, &brave_yahoo_hk}, + {PREPOPULATED_ENGINE_ID_YAHOO_ID, &brave_yahoo_id}, + {PREPOPULATED_ENGINE_ID_YAHOO_IN, &brave_yahoo_in}, + {PREPOPULATED_ENGINE_ID_YAHOO_IT, &brave_yahoo_it}, + {PREPOPULATED_ENGINE_ID_YAHOO_JP, &brave_yahoo_jp}, + {PREPOPULATED_ENGINE_ID_YAHOO_MX, &brave_yahoo_mx}, + {PREPOPULATED_ENGINE_ID_YAHOO_MY, &brave_yahoo_my}, + {PREPOPULATED_ENGINE_ID_YAHOO_NL, &brave_yahoo_nl}, + {PREPOPULATED_ENGINE_ID_YAHOO_NO, &brave_yahoo_no}, + {PREPOPULATED_ENGINE_ID_YAHOO_NZ, &brave_yahoo_nz}, + {PREPOPULATED_ENGINE_ID_YAHOO_PE, &brave_yahoo_pe}, + {PREPOPULATED_ENGINE_ID_YAHOO_PH, &brave_yahoo_ph}, + {PREPOPULATED_ENGINE_ID_YAHOO_QC, &brave_yahoo_qc}, + {PREPOPULATED_ENGINE_ID_YAHOO_SE, &brave_yahoo_se}, + {PREPOPULATED_ENGINE_ID_YAHOO_SG, &brave_yahoo_sg}, + {PREPOPULATED_ENGINE_ID_YAHOO_TH, &brave_yahoo_th}, + {PREPOPULATED_ENGINE_ID_YAHOO_TR, &brave_yahoo_tr}, + {PREPOPULATED_ENGINE_ID_YAHOO_TW, &brave_yahoo_tw}, + {PREPOPULATED_ENGINE_ID_YAHOO_UK, &brave_yahoo_uk}, + {PREPOPULATED_ENGINE_ID_YAHOO_VE, &brave_yahoo_ve}, + {PREPOPULATED_ENGINE_ID_YAHOO_VN, &brave_yahoo_vn}, {PREPOPULATED_ENGINE_ID_BING, &bing}, {PREPOPULATED_ENGINE_ID_DUCKDUCKGO, &duckduckgo}, {PREPOPULATED_ENGINE_ID_DUCKDUCKGO_DE, &duckduckgo_de}, @@ -52,6 +87,7 @@ const std::map // Default order in which engines will appear in the UI. std::vector brave_engines_default = { PREPOPULATED_ENGINE_ID_GOOGLE, + PREPOPULATED_ENGINE_ID_YAHOO, PREPOPULATED_ENGINE_ID_DUCKDUCKGO, #if defined(OS_ANDROID) PREPOPULATED_ENGINE_ID_DUCKDUCKGO_LITE, @@ -64,6 +100,7 @@ std::vector brave_engines_default = { // Germany - DDG appears on top. std::vector brave_engines_DE = { PREPOPULATED_ENGINE_ID_DUCKDUCKGO_DE, + PREPOPULATED_ENGINE_ID_YAHOO, #if defined(OS_ANDROID) PREPOPULATED_ENGINE_ID_DUCKDUCKGO_LITE, #endif @@ -76,6 +113,7 @@ std::vector brave_engines_DE = { // France - Qwant appears on top. std::vector brave_engines_FR = { PREPOPULATED_ENGINE_ID_QWANT, + PREPOPULATED_ENGINE_ID_YAHOO, PREPOPULATED_ENGINE_ID_GOOGLE, PREPOPULATED_ENGINE_ID_DUCKDUCKGO, #if defined(OS_ANDROID) @@ -88,6 +126,7 @@ std::vector brave_engines_FR = { // Australia / NZ / IE - DDG appears on top. std::vector brave_engines_AU_NZ_IE = { PREPOPULATED_ENGINE_ID_DUCKDUCKGO_AU_NZ_IE, + PREPOPULATED_ENGINE_ID_YAHOO, #if defined(OS_ANDROID) PREPOPULATED_ENGINE_ID_DUCKDUCKGO_LITE, #endif @@ -109,6 +148,77 @@ const std::map> {country_codes::CountryCharsToCountryID('I', 'E'), brave_engines_AU_NZ_IE}}; +const std::map + yahoo_engines_by_country_id_map = { + {country_codes::CountryCharsToCountryID('A', 'R'), + PREPOPULATED_ENGINE_ID_YAHOO_AR}, + {country_codes::CountryCharsToCountryID('A', 'T'), + PREPOPULATED_ENGINE_ID_YAHOO_AT}, + {country_codes::CountryCharsToCountryID('A', 'U'), + PREPOPULATED_ENGINE_ID_YAHOO_AU}, + {country_codes::CountryCharsToCountryID('B', 'R'), + PREPOPULATED_ENGINE_ID_YAHOO_BR}, + {country_codes::CountryCharsToCountryID('C', 'A'), + PREPOPULATED_ENGINE_ID_YAHOO_CA}, + {country_codes::CountryCharsToCountryID('C', 'H'), + PREPOPULATED_ENGINE_ID_YAHOO_CH}, + {country_codes::CountryCharsToCountryID('C', 'L'), + PREPOPULATED_ENGINE_ID_YAHOO_CL}, + {country_codes::CountryCharsToCountryID('C', 'O'), + PREPOPULATED_ENGINE_ID_YAHOO_CO}, + {country_codes::CountryCharsToCountryID('D', 'E'), + PREPOPULATED_ENGINE_ID_YAHOO_DE}, + {country_codes::CountryCharsToCountryID('D', 'K'), + PREPOPULATED_ENGINE_ID_YAHOO_DK}, + {country_codes::CountryCharsToCountryID('E', 'S'), + PREPOPULATED_ENGINE_ID_YAHOO_ES}, + {country_codes::CountryCharsToCountryID('F', 'I'), + PREPOPULATED_ENGINE_ID_YAHOO_FI}, + {country_codes::CountryCharsToCountryID('F', 'R'), + PREPOPULATED_ENGINE_ID_YAHOO_FR}, + {country_codes::CountryCharsToCountryID('H', 'K'), + PREPOPULATED_ENGINE_ID_YAHOO_HK}, + {country_codes::CountryCharsToCountryID('I', 'D'), + PREPOPULATED_ENGINE_ID_YAHOO_ID}, + {country_codes::CountryCharsToCountryID('I', 'N'), + PREPOPULATED_ENGINE_ID_YAHOO_IN}, + {country_codes::CountryCharsToCountryID('I', 'T'), + PREPOPULATED_ENGINE_ID_YAHOO_IT}, + {country_codes::CountryCharsToCountryID('J', 'P'), + PREPOPULATED_ENGINE_ID_YAHOO_JP}, + {country_codes::CountryCharsToCountryID('M', 'X'), + PREPOPULATED_ENGINE_ID_YAHOO_MX}, + {country_codes::CountryCharsToCountryID('M', 'Y'), + PREPOPULATED_ENGINE_ID_YAHOO_MY}, + {country_codes::CountryCharsToCountryID('N', 'L'), + PREPOPULATED_ENGINE_ID_YAHOO_NL}, + {country_codes::CountryCharsToCountryID('N', 'O'), + PREPOPULATED_ENGINE_ID_YAHOO_NO}, + {country_codes::CountryCharsToCountryID('N', 'Z'), + PREPOPULATED_ENGINE_ID_YAHOO_NZ}, + {country_codes::CountryCharsToCountryID('P', 'E'), + PREPOPULATED_ENGINE_ID_YAHOO_PE}, + {country_codes::CountryCharsToCountryID('P', 'H'), + PREPOPULATED_ENGINE_ID_YAHOO_PH}, + {country_codes::CountryCharsToCountryID('Q', 'C'), + PREPOPULATED_ENGINE_ID_YAHOO_QC}, + {country_codes::CountryCharsToCountryID('S', 'E'), + PREPOPULATED_ENGINE_ID_YAHOO_SE}, + {country_codes::CountryCharsToCountryID('S', 'G'), + PREPOPULATED_ENGINE_ID_YAHOO_SG}, + {country_codes::CountryCharsToCountryID('T', 'H'), + PREPOPULATED_ENGINE_ID_YAHOO_TH}, + {country_codes::CountryCharsToCountryID('T', 'R'), + PREPOPULATED_ENGINE_ID_YAHOO_TR}, + {country_codes::CountryCharsToCountryID('T', 'W'), + PREPOPULATED_ENGINE_ID_YAHOO_TW}, + {country_codes::CountryCharsToCountryID('U', 'K'), + PREPOPULATED_ENGINE_ID_YAHOO_UK}, + {country_codes::CountryCharsToCountryID('V', 'E'), + PREPOPULATED_ENGINE_ID_YAHOO_VE}, + {country_codes::CountryCharsToCountryID('V', 'N'), + PREPOPULATED_ENGINE_ID_YAHOO_VN}}; + // Builds a vector of PrepulatedEngine objects from the given array of // |engine_ids|. Fills in the default engine index for the given |country_id|, // if asked. @@ -144,6 +254,15 @@ void UpdateTemplateURLDataKeyword( } } +// TODO(bsclifton): finish me +// void LocalizeEngineList(std::vector engines) { +// const auto& it = engines.find(PREPOPULATED_ENGINE_ID_YAHOO); +// if (it != engines.end()) { +// //.. +// // replace +// } +// } + // Uses brave_engines_XX localized arrays of engine IDs instead of Chromium's // localized arrays of PrepopulatedEngines to construct the vector of // TemplateURLData. Also, fills in the default engine index for the given @@ -157,6 +276,7 @@ GetBravePrepopulatedEnginesForCountryID( // Check for exceptions from the default list of engines const auto& it = default_engines_by_country_id_map.find(country_id); if (it != default_engines_by_country_id_map.end()) { + // brave_engines = LocalizeEngineList(it->second); brave_engines = it->second; } else { brave_engines = brave_engines_default; diff --git a/components/search_engines/brave_prepopulated_engines.cc b/components/search_engines/brave_prepopulated_engines.cc index 610e99effdf1..f2af94796af3 100644 --- a/components/search_engines/brave_prepopulated_engines.cc +++ b/components/search_engines/brave_prepopulated_engines.cc @@ -14,6 +14,32 @@ namespace TemplateURLPrepopulateData { // engines below or add/remove engines. const int kBraveCurrentDataVersion = 5; +PrepopulatedEngine ModifyEngineParams(const PrepopulatedEngine& engine, + const wchar_t* const name, + const wchar_t* const keyword, const char* const search_url, + const char* const suggest_url, int id) { + return { + name ? name : engine.name, + keyword ? keyword : engine.keyword, + engine.favicon_url, + search_url ? search_url : engine.search_url, + engine.encoding, + suggest_url ? suggest_url : engine.suggest_url, + engine.image_url, + engine.new_tab_url, + engine.contextual_search_url, + engine.logo_url, + engine.doodle_url, + engine.search_url_post_params, + engine.suggest_url_post_params, + engine.image_url_post_params, + engine.alternate_urls, + engine.alternate_urls_size, + engine.type, + id > 0 ? id : engine.id + }; +} + const PrepopulatedEngine duckduckgo = { L"DuckDuckGo", L":d", @@ -35,47 +61,21 @@ const PrepopulatedEngine duckduckgo = { PREPOPULATED_ENGINE_ID_DUCKDUCKGO, }; -const PrepopulatedEngine duckduckgo_de = { - L"DuckDuckGo", - L":d", - "https://duckduckgo.com/favicon.ico", - "https://duckduckgo.com/?q={searchTerms}&t=bravened", - "UTF-8", - "https://ac.duckduckgo.com/ac/?q={searchTerms}&type=list", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, +const PrepopulatedEngine duckduckgo_de = ModifyEngineParams( + duckduckgo, NULL, NULL, + "https://duckduckgo.com/?q={searchTerms}&t=bravened", NULL, - 0, - SEARCH_ENGINE_DUCKDUCKGO, - PREPOPULATED_ENGINE_ID_DUCKDUCKGO_DE, -}; + PREPOPULATED_ENGINE_ID_DUCKDUCKGO_DE); -const PrepopulatedEngine duckduckgo_au_nz_ie = { - L"DuckDuckGo", - L":d", - "https://duckduckgo.com/favicon.ico", - "https://duckduckgo.com/?q={searchTerms}&t=braveed", - "UTF-8", - "https://ac.duckduckgo.com/ac/?q={searchTerms}&type=list", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, +const PrepopulatedEngine duckduckgo_au_nz_ie = ModifyEngineParams( + duckduckgo, NULL, NULL, + "https://duckduckgo.com/?q={searchTerms}&t=braveed", NULL, - 0, - SEARCH_ENGINE_DUCKDUCKGO, - PREPOPULATED_ENGINE_ID_DUCKDUCKGO_AU_NZ_IE, -}; + PREPOPULATED_ENGINE_ID_DUCKDUCKGO_AU_NZ_IE); #if defined(OS_ANDROID) const PrepopulatedEngine duckduckgo_lite = { @@ -144,4 +144,317 @@ const PrepopulatedEngine startpage = { PREPOPULATED_ENGINE_ID_STARTPAGE, }; +#define BRAVE_YAHOO_NAME L"Yahoo" +#define BRAVE_YAHOO_KEYWORD L":y" +#define BRAVE_YAHOO_SEARCH_URL(PREFIX) "https://" PREFIX ".search.yahoo.com" \ + "/search?p={searchTerms}&fr=brave_yset" +#define BRAVE_YAHOO_SUGGEST_URL(PREFIX) "https://" PREFIX ".search.yahoo.com" \ + "/sugg/chrome?output=fxjson&appid=brave_yset&command={searchTerms}" + +const PrepopulatedEngine brave_yahoo = ModifyEngineParams( + yahoo, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + "https://search.yahoo.com/search?p={searchTerms}&fr=brave_yset", + "https://search.yahoo.com/sugg/chrome?output=fxjson&appid=brave_yset&command={searchTerms}", + PREPOPULATED_ENGINE_ID_YAHOO); + +const PrepopulatedEngine brave_yahoo_ar = ModifyEngineParams( + yahoo_ar, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("ar"), + BRAVE_YAHOO_SUGGEST_URL("ar"), + PREPOPULATED_ENGINE_ID_YAHOO_AR); + +const PrepopulatedEngine brave_yahoo_at = ModifyEngineParams( + yahoo_at, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("at"), + BRAVE_YAHOO_SUGGEST_URL("at"), + PREPOPULATED_ENGINE_ID_YAHOO_AT); + +const PrepopulatedEngine brave_yahoo_au = ModifyEngineParams( + yahoo_au, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("au"), + BRAVE_YAHOO_SUGGEST_URL("au"), + PREPOPULATED_ENGINE_ID_YAHOO_AU); + +const PrepopulatedEngine brave_yahoo_br = ModifyEngineParams( + yahoo_br, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("br"), + BRAVE_YAHOO_SUGGEST_URL("br"), + PREPOPULATED_ENGINE_ID_YAHOO_BR); + +const PrepopulatedEngine brave_yahoo_ca = ModifyEngineParams( + yahoo_ca, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("ca"), + BRAVE_YAHOO_SUGGEST_URL("ca"), + PREPOPULATED_ENGINE_ID_YAHOO_CA); + +const PrepopulatedEngine brave_yahoo_ch = ModifyEngineParams( + yahoo_ch, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("ch"), + BRAVE_YAHOO_SUGGEST_URL("ch"), + PREPOPULATED_ENGINE_ID_YAHOO_CH); + +const PrepopulatedEngine brave_yahoo_cl = ModifyEngineParams( + yahoo_cl, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("cl"), + BRAVE_YAHOO_SUGGEST_URL("cl"), + PREPOPULATED_ENGINE_ID_YAHOO_CL); + +const PrepopulatedEngine brave_yahoo_co = ModifyEngineParams( + yahoo_co, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("co"), + BRAVE_YAHOO_SUGGEST_URL("co"), + PREPOPULATED_ENGINE_ID_YAHOO_CO); + +const PrepopulatedEngine brave_yahoo_de = ModifyEngineParams( + yahoo_de, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("de"), + BRAVE_YAHOO_SUGGEST_URL("de"), + PREPOPULATED_ENGINE_ID_YAHOO_DE); + +const PrepopulatedEngine brave_yahoo_dk = ModifyEngineParams( + yahoo_dk, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("dk"), + BRAVE_YAHOO_SUGGEST_URL("dk"), + PREPOPULATED_ENGINE_ID_YAHOO_DK); + +const PrepopulatedEngine brave_yahoo_es = ModifyEngineParams( + yahoo_es, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("es"), + BRAVE_YAHOO_SUGGEST_URL("es"), + PREPOPULATED_ENGINE_ID_YAHOO_ES); + +const PrepopulatedEngine brave_yahoo_fi = ModifyEngineParams( + yahoo_fi, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("fi"), + BRAVE_YAHOO_SUGGEST_URL("fi"), + PREPOPULATED_ENGINE_ID_YAHOO_FI); + +const PrepopulatedEngine brave_yahoo_fr = ModifyEngineParams( + yahoo_fr, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("fr"), + BRAVE_YAHOO_SUGGEST_URL("fr"), + PREPOPULATED_ENGINE_ID_YAHOO_FR); + +const PrepopulatedEngine brave_yahoo_hk = ModifyEngineParams( + yahoo_hk, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("hk"), + BRAVE_YAHOO_SUGGEST_URL("hk"), + PREPOPULATED_ENGINE_ID_YAHOO_HK); + +const PrepopulatedEngine brave_yahoo_id = ModifyEngineParams( + yahoo_id, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("id"), + BRAVE_YAHOO_SUGGEST_URL("id"), + PREPOPULATED_ENGINE_ID_YAHOO_ID); + +const PrepopulatedEngine brave_yahoo_in = ModifyEngineParams( + yahoo_in, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("in"), + BRAVE_YAHOO_SUGGEST_URL("in"), + PREPOPULATED_ENGINE_ID_YAHOO_IN); + +const PrepopulatedEngine brave_yahoo_it = { + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + "https://it.search.yahoo.com/favicon.ico", + BRAVE_YAHOO_SEARCH_URL("it"), + "UTF-8", + BRAVE_YAHOO_SUGGEST_URL("it"), + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + 0, + SEARCH_ENGINE_YAHOO, + PREPOPULATED_ENGINE_ID_YAHOO_IT +}; + +const PrepopulatedEngine brave_yahoo_jp = ModifyEngineParams( + yahoo_jp, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("jp"), + BRAVE_YAHOO_SUGGEST_URL("jp"), + PREPOPULATED_ENGINE_ID_YAHOO_JP); + +const PrepopulatedEngine brave_yahoo_mx = ModifyEngineParams( + yahoo_mx, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("mx"), + BRAVE_YAHOO_SUGGEST_URL("mx"), + PREPOPULATED_ENGINE_ID_YAHOO_MX); + +const PrepopulatedEngine brave_yahoo_my = ModifyEngineParams( + yahoo_my, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("my"), + BRAVE_YAHOO_SUGGEST_URL("my"), + PREPOPULATED_ENGINE_ID_YAHOO_MY); + +const PrepopulatedEngine brave_yahoo_nl = ModifyEngineParams( + yahoo_nl, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("nl"), + BRAVE_YAHOO_SUGGEST_URL("nl"), + PREPOPULATED_ENGINE_ID_YAHOO_NL); + +const PrepopulatedEngine brave_yahoo_no = { + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + "https://no.search.yahoo.com/favicon.ico", + BRAVE_YAHOO_SEARCH_URL("no"), + "UTF-8", + BRAVE_YAHOO_SUGGEST_URL("no"), + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + 0, + SEARCH_ENGINE_YAHOO, + PREPOPULATED_ENGINE_ID_YAHOO_NO +}; + +const PrepopulatedEngine brave_yahoo_nz = ModifyEngineParams( + yahoo_nz, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("nz"), + BRAVE_YAHOO_SUGGEST_URL("nz"), + PREPOPULATED_ENGINE_ID_YAHOO_NZ); + +const PrepopulatedEngine brave_yahoo_pe = ModifyEngineParams( + yahoo_pe, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("pe"), + BRAVE_YAHOO_SUGGEST_URL("pe"), + PREPOPULATED_ENGINE_ID_YAHOO_PE); + +const PrepopulatedEngine brave_yahoo_ph = ModifyEngineParams( + yahoo_ph, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("ph"), + BRAVE_YAHOO_SUGGEST_URL("ph"), + PREPOPULATED_ENGINE_ID_YAHOO_PH); + +const PrepopulatedEngine brave_yahoo_qc = ModifyEngineParams( + yahoo_qc, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("qc"), + BRAVE_YAHOO_SUGGEST_URL("qc"), + PREPOPULATED_ENGINE_ID_YAHOO_QC); + +const PrepopulatedEngine brave_yahoo_se = ModifyEngineParams( + yahoo_se, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("se"), + BRAVE_YAHOO_SUGGEST_URL("se"), + PREPOPULATED_ENGINE_ID_YAHOO_SE); + +const PrepopulatedEngine brave_yahoo_sg = ModifyEngineParams( + yahoo_sg, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("sg"), + BRAVE_YAHOO_SUGGEST_URL("sg"), + PREPOPULATED_ENGINE_ID_YAHOO_SG); + +const PrepopulatedEngine brave_yahoo_th = ModifyEngineParams( + yahoo_th, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("th"), + BRAVE_YAHOO_SUGGEST_URL("th"), + PREPOPULATED_ENGINE_ID_YAHOO_TH); + +const PrepopulatedEngine brave_yahoo_tr = ModifyEngineParams( + yahoo_tr, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("tr"), + BRAVE_YAHOO_SUGGEST_URL("tr"), + PREPOPULATED_ENGINE_ID_YAHOO_TR); + +const PrepopulatedEngine brave_yahoo_tw = ModifyEngineParams( + yahoo_tw, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("tw"), + BRAVE_YAHOO_SUGGEST_URL("tw"), + PREPOPULATED_ENGINE_ID_YAHOO_TW); + +const PrepopulatedEngine brave_yahoo_uk = ModifyEngineParams( + yahoo_uk, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("uk"), + BRAVE_YAHOO_SUGGEST_URL("uk"), + PREPOPULATED_ENGINE_ID_YAHOO_UK); + +const PrepopulatedEngine brave_yahoo_ve = ModifyEngineParams( + yahoo_ve, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("ve"), + BRAVE_YAHOO_SUGGEST_URL("ve"), + PREPOPULATED_ENGINE_ID_YAHOO_VE); + +const PrepopulatedEngine brave_yahoo_vn = ModifyEngineParams( + yahoo_vn, + BRAVE_YAHOO_NAME, + BRAVE_YAHOO_KEYWORD, + BRAVE_YAHOO_SEARCH_URL("vn"), + BRAVE_YAHOO_SUGGEST_URL("vn"), + PREPOPULATED_ENGINE_ID_YAHOO_VN); + } // namespace TemplateURLPrepopulateData diff --git a/components/search_engines/brave_prepopulated_engines.h b/components/search_engines/brave_prepopulated_engines.h index 5bc4372e4134..fb40681200c8 100644 --- a/components/search_engines/brave_prepopulated_engines.h +++ b/components/search_engines/brave_prepopulated_engines.h @@ -51,15 +51,89 @@ enum BravePrepopulatedEngineID : unsigned int { PREPOPULATED_ENGINE_ID_YOUTUBE, // No longer in defaults (2/2019). PREPOPULATED_ENGINE_ID_DUCKDUCKGO_DE, PREPOPULATED_ENGINE_ID_DUCKDUCKGO_AU_NZ_IE, + PREPOPULATED_ENGINE_ID_YAHOO, + PREPOPULATED_ENGINE_ID_YAHOO_AR, + PREPOPULATED_ENGINE_ID_YAHOO_AT, + PREPOPULATED_ENGINE_ID_YAHOO_AU, + PREPOPULATED_ENGINE_ID_YAHOO_BR, + PREPOPULATED_ENGINE_ID_YAHOO_CA, + PREPOPULATED_ENGINE_ID_YAHOO_CH, + PREPOPULATED_ENGINE_ID_YAHOO_CL, + PREPOPULATED_ENGINE_ID_YAHOO_CO, + PREPOPULATED_ENGINE_ID_YAHOO_DE, + PREPOPULATED_ENGINE_ID_YAHOO_DK, + PREPOPULATED_ENGINE_ID_YAHOO_ES, + PREPOPULATED_ENGINE_ID_YAHOO_FI, + PREPOPULATED_ENGINE_ID_YAHOO_FR, + PREPOPULATED_ENGINE_ID_YAHOO_HK, + PREPOPULATED_ENGINE_ID_YAHOO_ID, + PREPOPULATED_ENGINE_ID_YAHOO_IN, + PREPOPULATED_ENGINE_ID_YAHOO_IT, + PREPOPULATED_ENGINE_ID_YAHOO_JP, + PREPOPULATED_ENGINE_ID_YAHOO_MX, + PREPOPULATED_ENGINE_ID_YAHOO_MY, + PREPOPULATED_ENGINE_ID_YAHOO_NL, + PREPOPULATED_ENGINE_ID_YAHOO_NO, + PREPOPULATED_ENGINE_ID_YAHOO_NZ, + PREPOPULATED_ENGINE_ID_YAHOO_PE, + PREPOPULATED_ENGINE_ID_YAHOO_PH, + PREPOPULATED_ENGINE_ID_YAHOO_QC, + PREPOPULATED_ENGINE_ID_YAHOO_SE, + PREPOPULATED_ENGINE_ID_YAHOO_SG, + PREPOPULATED_ENGINE_ID_YAHOO_TH, + PREPOPULATED_ENGINE_ID_YAHOO_TR, + PREPOPULATED_ENGINE_ID_YAHOO_TW, + PREPOPULATED_ENGINE_ID_YAHOO_UK, + PREPOPULATED_ENGINE_ID_YAHOO_VE, + PREPOPULATED_ENGINE_ID_YAHOO_VN, }; extern const PrepopulatedEngine duckduckgo; +extern const PrepopulatedEngine duckduckgo_de; +extern const PrepopulatedEngine duckduckgo_au_nz_ie; #if defined(OS_ANDROID) extern const PrepopulatedEngine duckduckgo_lite; #endif extern const PrepopulatedEngine qwant; extern const PrepopulatedEngine startpage; +// Yahoo has unique URLs per region +extern const PrepopulatedEngine brave_yahoo; +extern const PrepopulatedEngine brave_yahoo_ar; +extern const PrepopulatedEngine brave_yahoo_at; +extern const PrepopulatedEngine brave_yahoo_au; +extern const PrepopulatedEngine brave_yahoo_br; +extern const PrepopulatedEngine brave_yahoo_ca; +extern const PrepopulatedEngine brave_yahoo_ch; +extern const PrepopulatedEngine brave_yahoo_cl; +extern const PrepopulatedEngine brave_yahoo_co; +extern const PrepopulatedEngine brave_yahoo_de; +extern const PrepopulatedEngine brave_yahoo_dk; +extern const PrepopulatedEngine brave_yahoo_es; +extern const PrepopulatedEngine brave_yahoo_fi; +extern const PrepopulatedEngine brave_yahoo_fr; +extern const PrepopulatedEngine brave_yahoo_hk; +extern const PrepopulatedEngine brave_yahoo_id; +extern const PrepopulatedEngine brave_yahoo_in; +extern const PrepopulatedEngine brave_yahoo_it; +extern const PrepopulatedEngine brave_yahoo_jp; +extern const PrepopulatedEngine brave_yahoo_mx; +extern const PrepopulatedEngine brave_yahoo_my; +extern const PrepopulatedEngine brave_yahoo_nl; +extern const PrepopulatedEngine brave_yahoo_no; +extern const PrepopulatedEngine brave_yahoo_nz; +extern const PrepopulatedEngine brave_yahoo_pe; +extern const PrepopulatedEngine brave_yahoo_ph; +extern const PrepopulatedEngine brave_yahoo_qc; +extern const PrepopulatedEngine brave_yahoo_se; +extern const PrepopulatedEngine brave_yahoo_sg; +extern const PrepopulatedEngine brave_yahoo_th; +extern const PrepopulatedEngine brave_yahoo_tr; +extern const PrepopulatedEngine brave_yahoo_tw; +extern const PrepopulatedEngine brave_yahoo_uk; +extern const PrepopulatedEngine brave_yahoo_ve; +extern const PrepopulatedEngine brave_yahoo_vn; + } // namespace TemplateURLPrepopulateData #endif // BRAVE_COMPONENTS_SEARCH_ENGINES_BRAVE_PREPOPULATED_ENGINES_H_