Revert default search provider list in SK

re-open https://github.com/brave/brave-browser/issues/18855

Private search provider setting is not ready for default search provider list update.
When previous default private search provider is not in default list,
default provider is back to Brave on desktop(brave/brave-browser#28235) instead of using previous default provider.
On android, there is another issue when default list is upated(brave/brave-browser#28232).

We should update default provider list when default private search provider is handled properly.
This commit is contained in:
Simon Hong
2023-02-08 11:12:59 +09:00
parent 638353c988
commit c4eea01fff
3 changed files with 3 additions and 65 deletions
@@ -258,5 +258,5 @@ TEST_F(BraveTemplateURLPrepopulateDataTest,
TEST_F(BraveTemplateURLPrepopulateDataTest,
DefaultSearchProvidersForSouthKorea) {
CheckForCountry('K', 'R', PREPOPULATED_ENGINE_ID_NAVER);
CheckForCountry('K', 'R', PREPOPULATED_ENGINE_ID_GOOGLE);
}
@@ -81,13 +81,6 @@ constexpr BravePrepopulatedEngineID kBraveEnginesAUIE[] = {
PREPOPULATED_ENGINE_ID_ECOSIA,
};
constexpr BravePrepopulatedEngineID kBraveEnginesKR[] = {
PREPOPULATED_ENGINE_ID_BRAVE,
PREPOPULATED_ENGINE_ID_NAVER,
PREPOPULATED_ENGINE_ID_DAUM,
PREPOPULATED_ENGINE_ID_GOOGLE,
};
constexpr BravePrepopulatedEngineID kBraveEnginesNZ[] = {
PREPOPULATED_ENGINE_ID_BRAVE, PREPOPULATED_ENGINE_ID_DUCKDUCKGO_AU_NZ_IE,
PREPOPULATED_ENGINE_ID_GOOGLE, PREPOPULATED_ENGINE_ID_QWANT,
@@ -132,7 +125,6 @@ constexpr auto kDefaultEnginesByCountryIdMap =
kBraveEnginesWithEcosia},
{country_codes::CountryCharsToCountryID('K', 'G'),
kBraveEnginesWithYandex},
{country_codes::CountryCharsToCountryID('K', 'R'), kBraveEnginesKR},
{country_codes::CountryCharsToCountryID('K', 'Z'),
kBraveEnginesWithYandex},
{country_codes::CountryCharsToCountryID('L', 'U'),
@@ -398,62 +390,8 @@ BravePrepopulatedEngineID GetDefaultSearchEngine(int country_id, int version) {
{country_codes::CountryCharsToCountryID('I', 'N'),
PREPOPULATED_ENGINE_ID_BRAVE},
});
static constexpr auto kContentV23 =
base::MakeFixedFlatMap<int, BravePrepopulatedEngineID>({
{country_codes::CountryCharsToCountryID('A', 'M'),
PREPOPULATED_ENGINE_ID_YANDEX},
{country_codes::CountryCharsToCountryID('A', 'Z'),
PREPOPULATED_ENGINE_ID_YANDEX},
{country_codes::CountryCharsToCountryID('B', 'Y'),
PREPOPULATED_ENGINE_ID_YANDEX},
{country_codes::CountryCharsToCountryID('C', 'A'),
PREPOPULATED_ENGINE_ID_BRAVE},
{country_codes::CountryCharsToCountryID('D', 'E'),
PREPOPULATED_ENGINE_ID_BRAVE},
{country_codes::CountryCharsToCountryID('F', 'R'),
PREPOPULATED_ENGINE_ID_BRAVE},
{country_codes::CountryCharsToCountryID('G', 'B'),
PREPOPULATED_ENGINE_ID_BRAVE},
{country_codes::CountryCharsToCountryID('K', 'G'),
PREPOPULATED_ENGINE_ID_YANDEX},
{country_codes::CountryCharsToCountryID('K', 'Z'),
PREPOPULATED_ENGINE_ID_YANDEX},
{country_codes::CountryCharsToCountryID('M', 'D'),
PREPOPULATED_ENGINE_ID_YANDEX},
{country_codes::CountryCharsToCountryID('R', 'U'),
PREPOPULATED_ENGINE_ID_YANDEX},
{country_codes::CountryCharsToCountryID('T', 'J'),
PREPOPULATED_ENGINE_ID_YANDEX},
{country_codes::CountryCharsToCountryID('T', 'M'),
PREPOPULATED_ENGINE_ID_YANDEX},
{country_codes::CountryCharsToCountryID('U', 'S'),
PREPOPULATED_ENGINE_ID_BRAVE},
{country_codes::CountryCharsToCountryID('U', 'Z'),
PREPOPULATED_ENGINE_ID_YANDEX},
{country_codes::CountryCharsToCountryID('A', 'T'),
PREPOPULATED_ENGINE_ID_BRAVE},
{country_codes::CountryCharsToCountryID('E', 'S'),
PREPOPULATED_ENGINE_ID_BRAVE},
{country_codes::CountryCharsToCountryID('M', 'X'),
PREPOPULATED_ENGINE_ID_BRAVE},
{country_codes::CountryCharsToCountryID('A', 'R'),
PREPOPULATED_ENGINE_ID_BRAVE},
{country_codes::CountryCharsToCountryID('B', 'R'),
PREPOPULATED_ENGINE_ID_BRAVE},
{country_codes::CountryCharsToCountryID('I', 'N'),
PREPOPULATED_ENGINE_ID_BRAVE},
// Added values in this version bellow
{country_codes::CountryCharsToCountryID('K', 'R'),
PREPOPULATED_ENGINE_ID_NAVER},
});
if (version > 22) {
auto* it = kContentV23.find(country_id);
if (it == kContentV23.end()) {
return default_v6;
}
return it->second;
} else if (version > 21) {
if (version > 21) {
auto* it = kContentV22.find(country_id);
if (it == kContentV22.end()) {
return default_v6;
@@ -13,7 +13,7 @@ namespace TemplateURLPrepopulateData {
// IMPORTANT! Make sure to bump this value if you make changes to the
// engines below or add/remove engines.
const int kBraveCurrentDataVersion = 23;
const int kBraveCurrentDataVersion = 24;
// DO NOT CHANGE THIS ONE. Used for backfilling kBraveDefaultSearchVersion.
const int kBraveFirstTrackedDataVersion = 6;