Skip to content

Commit fb78fd5

Browse files
committed
Set brave search as a default search provider in AU
fix brave/brave-browser#41451
1 parent 4768a4a commit fb78fd5

File tree

3 files changed

+65
-2
lines changed

3 files changed

+65
-2
lines changed

chromium_src/components/search_engines/brave_template_url_prepopulate_data_unittest.cc

+5
Original file line numberDiff line numberDiff line change
@@ -268,3 +268,8 @@ TEST_F(BraveTemplateURLPrepopulateDataTest,
268268
TEST_F(BraveTemplateURLPrepopulateDataTest, DefaultSearchProvidersForItaly) {
269269
CheckForCountry('I', 'T', PREPOPULATED_ENGINE_ID_BRAVE);
270270
}
271+
272+
TEST_F(BraveTemplateURLPrepopulateDataTest,
273+
DefaultSearchProvidersForAustrailia) {
274+
CheckForCountry('A', 'U', PREPOPULATED_ENGINE_ID_BRAVE);
275+
}

chromium_src/components/search_engines/template_url_prepopulate_data.cc

+59-1
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,66 @@ BravePrepopulatedEngineID GetDefaultSearchEngine(int country_id, int version) {
521521
{country_codes::CountryCharsToCountryID('U', 'Z'),
522522
PREPOPULATED_ENGINE_ID_YANDEX},
523523
});
524+
// Updated default for AU.
525+
static constexpr auto kContentV30 =
526+
base::MakeFixedFlatMap<int, BravePrepopulatedEngineID>({
527+
{country_codes::CountryCharsToCountryID('A', 'M'),
528+
PREPOPULATED_ENGINE_ID_YANDEX},
529+
{country_codes::CountryCharsToCountryID('A', 'R'),
530+
PREPOPULATED_ENGINE_ID_BRAVE},
531+
{country_codes::CountryCharsToCountryID('A', 'T'),
532+
PREPOPULATED_ENGINE_ID_BRAVE},
533+
{country_codes::CountryCharsToCountryID('A', 'U'),
534+
PREPOPULATED_ENGINE_ID_BRAVE},
535+
{country_codes::CountryCharsToCountryID('A', 'Z'),
536+
PREPOPULATED_ENGINE_ID_YANDEX},
537+
{country_codes::CountryCharsToCountryID('B', 'R'),
538+
PREPOPULATED_ENGINE_ID_BRAVE},
539+
{country_codes::CountryCharsToCountryID('B', 'Y'),
540+
PREPOPULATED_ENGINE_ID_YANDEX},
541+
{country_codes::CountryCharsToCountryID('C', 'A'),
542+
PREPOPULATED_ENGINE_ID_BRAVE},
543+
{country_codes::CountryCharsToCountryID('D', 'E'),
544+
PREPOPULATED_ENGINE_ID_BRAVE},
545+
{country_codes::CountryCharsToCountryID('E', 'S'),
546+
PREPOPULATED_ENGINE_ID_BRAVE},
547+
{country_codes::CountryCharsToCountryID('F', 'R'),
548+
PREPOPULATED_ENGINE_ID_BRAVE},
549+
{country_codes::CountryCharsToCountryID('G', 'B'),
550+
PREPOPULATED_ENGINE_ID_BRAVE},
551+
{country_codes::CountryCharsToCountryID('I', 'N'),
552+
PREPOPULATED_ENGINE_ID_BRAVE},
553+
{country_codes::CountryCharsToCountryID('I', 'T'),
554+
PREPOPULATED_ENGINE_ID_BRAVE},
555+
{country_codes::CountryCharsToCountryID('K', 'G'),
556+
PREPOPULATED_ENGINE_ID_YANDEX},
557+
{country_codes::CountryCharsToCountryID('K', 'R'),
558+
PREPOPULATED_ENGINE_ID_NAVER},
559+
{country_codes::CountryCharsToCountryID('K', 'Z'),
560+
PREPOPULATED_ENGINE_ID_YANDEX},
561+
{country_codes::CountryCharsToCountryID('M', 'D'),
562+
PREPOPULATED_ENGINE_ID_YANDEX},
563+
{country_codes::CountryCharsToCountryID('M', 'X'),
564+
PREPOPULATED_ENGINE_ID_BRAVE},
565+
{country_codes::CountryCharsToCountryID('R', 'U'),
566+
PREPOPULATED_ENGINE_ID_YANDEX},
567+
{country_codes::CountryCharsToCountryID('T', 'J'),
568+
PREPOPULATED_ENGINE_ID_YANDEX},
569+
{country_codes::CountryCharsToCountryID('T', 'M'),
570+
PREPOPULATED_ENGINE_ID_YANDEX},
571+
{country_codes::CountryCharsToCountryID('U', 'S'),
572+
PREPOPULATED_ENGINE_ID_BRAVE},
573+
{country_codes::CountryCharsToCountryID('U', 'Z'),
574+
PREPOPULATED_ENGINE_ID_YANDEX},
575+
});
524576

525-
if (version > 25) {
577+
if (version > 29) {
578+
const auto it = kContentV30.find(country_id);
579+
if (it == kContentV30.end()) {
580+
return default_v6;
581+
}
582+
return it->second;
583+
} else if (version > 25) {
526584
const auto it = kContentV26.find(country_id);
527585
if (it == kContentV26.end()) {
528586
return default_v6;

components/search_engines/brave_prepopulated_engines.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace TemplateURLPrepopulateData {
1313

1414
// IMPORTANT! Make sure to bump this value if you make changes to the
1515
// engines below or add/remove engines.
16-
const int kBraveCurrentDataVersion = 29;
16+
const int kBraveCurrentDataVersion = 30;
1717

1818
// The version is important to increment because Chromium will cache the list
1919
// of search engines that are shown. When the version is incremented, Chromium

0 commit comments

Comments
 (0)