Skip to content

Commit

Permalink
Updated default search provider in KR
Browse files Browse the repository at this point in the history
fix brave/brave-browser#18855

Default search provider list will include
Brave Search, Naver, Daum and Google.
And Naver will be set as a default provider.
  • Loading branch information
simonhong committed Jun 27, 2022
1 parent 99ffb05 commit fd50850
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
4 changes: 4 additions & 0 deletions browser/search_engines/search_engine_tracker.cc
Expand Up @@ -41,6 +41,10 @@ void RecordSearchEngineP3A(const GURL& search_engine_url,
answer = SearchEngineP3A::kYandex;
} else if (type == SEARCH_ENGINE_ECOSIA) {
answer = SearchEngineP3A::kEcosia;
} else if (type == SEARCH_ENGINE_DAUM) {
answer = SearchEngineP3A::kDaum;
} else if (type == SEARCH_ENGINE_NAVER) {
answer = SearchEngineP3A::kNaver;
} else if (type == SEARCH_ENGINE_OTHER) {
if (base::EndsWith(search_engine_url.host(), "startpage.com",
base::CompareCase::INSENSITIVE_ASCII)) {
Expand Down
4 changes: 3 additions & 1 deletion browser/search_engines/search_engine_tracker.h
Expand Up @@ -33,7 +33,9 @@ enum class SearchEngineP3A {
kYandex,
kEcosia,
kBrave,
kMaxValue = kBrave,
kDaum,
kNaver,
kMaxValue = kNaver,
};

// Note: append-only enumeration! Never remove any existing values, as this enum
Expand Down
Expand Up @@ -80,6 +80,13 @@ const std::vector<BravePrepopulatedEngineID> brave_engines_AU_IE = {
PREPOPULATED_ENGINE_ID_ECOSIA,
};

const std::vector<BravePrepopulatedEngineID> brave_engines_KR = {
PREPOPULATED_ENGINE_ID_BRAVE,
PREPOPULATED_ENGINE_ID_NAVER,
PREPOPULATED_ENGINE_ID_DAUM,
PREPOPULATED_ENGINE_ID_GOOGLE,
};

const std::vector<BravePrepopulatedEngineID> brave_engines_NZ = {
PREPOPULATED_ENGINE_ID_BRAVE, PREPOPULATED_ENGINE_ID_DUCKDUCKGO_AU_NZ_IE,
PREPOPULATED_ENGINE_ID_GOOGLE, PREPOPULATED_ENGINE_ID_QWANT,
Expand Down Expand Up @@ -126,6 +133,7 @@ const std::map<int, const std::vector<BravePrepopulatedEngineID>*>
&brave_engines_with_ecosia},
{country_codes::CountryCharsToCountryID('K', 'G'),
&brave_engines_with_yandex},
{country_codes::CountryCharsToCountryID('K', 'R'), &brave_engines_KR},
{country_codes::CountryCharsToCountryID('K', 'Z'),
&brave_engines_with_yandex},
{country_codes::CountryCharsToCountryID('L', 'U'),
Expand Down Expand Up @@ -248,6 +256,8 @@ BravePrepopulatedEngineID GetDefaultSearchEngine(int country_id, int version) {
PREPOPULATED_ENGINE_ID_BRAVE},
{country_codes::CountryCharsToCountryID('K', 'G'),
PREPOPULATED_ENGINE_ID_YANDEX},
{country_codes::CountryCharsToCountryID('K', 'R'),
PREPOPULATED_ENGINE_ID_NAVER},
{country_codes::CountryCharsToCountryID('K', 'Z'),
PREPOPULATED_ENGINE_ID_YANDEX},
{country_codes::CountryCharsToCountryID('M', 'D'),
Expand Down
4 changes: 3 additions & 1 deletion components/search_engines/brave_prepopulated_engines.cc
Expand Up @@ -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 = 19;
const int kBraveCurrentDataVersion = 20;
// DO NOT CHANGE THIS ONE. Used for backfilling kBraveDefaultSearchVersion.
const int kBraveFirstTrackedDataVersion = 6;

Expand All @@ -25,6 +25,8 @@ const std::map<BravePrepopulatedEngineID, const PrepopulatedEngine*>
{PREPOPULATED_ENGINE_ID_GOOGLE, &google},
{PREPOPULATED_ENGINE_ID_YANDEX, &brave_yandex},
{PREPOPULATED_ENGINE_ID_BING, &brave_bing},
{PREPOPULATED_ENGINE_ID_NAVER, &naver},
{PREPOPULATED_ENGINE_ID_DAUM, &daum},
{PREPOPULATED_ENGINE_ID_DUCKDUCKGO, &duckduckgo},
{PREPOPULATED_ENGINE_ID_DUCKDUCKGO_DE, &duckduckgo_de},
{PREPOPULATED_ENGINE_ID_DUCKDUCKGO_AU_NZ_IE, &duckduckgo_au_nz_ie},
Expand Down
2 changes: 2 additions & 0 deletions components/search_engines/brave_prepopulated_engines.h
Expand Up @@ -31,6 +31,8 @@ enum BravePrepopulatedEngineID : unsigned int {
PREPOPULATED_ENGINE_ID_GOOGLE = 1,
PREPOPULATED_ENGINE_ID_BING = 3,
PREPOPULATED_ENGINE_ID_YANDEX = 15,
PREPOPULATED_ENGINE_ID_NAVER = 67,
PREPOPULATED_ENGINE_ID_DAUM = 68,
PREPOPULATED_ENGINE_ID_ECOSIA = 101,
// These engine IDs are not defined in Chromium
BRAVE_PREPOPULATED_ENGINES_START = 500,
Expand Down

0 comments on commit fd50850

Please sign in to comment.