diff --git a/browser/importer/brave_profile_writer.cc b/browser/importer/brave_profile_writer.cc index 1b71ce9f4123..10c25ee43e9c 100644 --- a/browser/importer/brave_profile_writer.cc +++ b/browser/importer/brave_profile_writer.cc @@ -1,8 +1,16 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* Copyright (c) 2019 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "brave/browser/importer/brave_profile_writer.h" + +#include +#include +#include +#include +#include + #include "brave/common/importer/brave_stats.h" #include "brave/common/importer/brave_referral.h" #include "brave/common/importer/imported_browser_window.h" @@ -43,8 +51,6 @@ #include "services/network/public/mojom/cookie_manager.mojom.h" #include "ui/base/ui_base_types.h" -#include - BraveProfileWriter::BraveProfileWriter(Profile* profile) : ProfileWriter(profile), task_runner_(base::CreateSequencedTaskRunnerWithTraits({ @@ -119,7 +125,8 @@ void BraveProfileWriter::BackupWallet() { const base::FilePath profile_default_directory = profile_->GetPath(); std::ostringstream backup_filename; backup_filename << "ledger_import_backup_" - << base::NumberToString((unsigned long long)base::Time::Now().ToJsTime()); + << base::NumberToString(static_cast( + base::Time::Now().ToJsTime())); LOG(INFO) << "Making backup of current \"ledger_state\" as " << "\"" << backup_filename.str() << "\""; @@ -244,8 +251,9 @@ void BraveProfileWriter::SetWalletProperties(brave_rewards::RewardsService* pinned_item_count_ = 0; for (const auto& publisher : ledger_.pinned_publishers) { // NOTE: this will truncate (ex: 0.90 would be 0, not 1) - const int amount_in_bat = (int)((publisher.pin_percentage / 100.0) * - ledger_.settings.payments.contribution_amount); + const int amount_in_bat = + static_cast((publisher.pin_percentage / 100.0) * + ledger_.settings.payments.contribution_amount); if (amount_in_bat > 0) { pinned_item_count_++; sum_of_monthly_tips += amount_in_bat; @@ -400,7 +408,6 @@ void OpenImportedBrowserTabs(Browser* browser, "", false, pinned, true, base::TimeTicks::UnixEpoch(), nullptr, "", true /* from_session_restore */); - } } @@ -408,7 +415,7 @@ int GetSelectedTabIndex(const ImportedBrowserWindow& window) { // The window has an activeFrameKey, which may be equal to the key for one of // its tabs. Find the matching tab, if one exists, and return its index in // the tabs vector. - for (int i = 0; i < (int)window.tabs.size(); i++) { + for (int i = 0; i < static_cast(window.tabs.size()); i++) { if (window.activeFrameKey == window.tabs[i].key) return i; } @@ -455,28 +462,16 @@ void BraveProfileWriter::UpdateWindows( // NOTE: the strings used as keys match the values found in Muon: // browser-laptop/js/data/searchProviders.js +// Providers that aren't in this map are no longer prepopulated (Amazon, +// Ecosia, GitHub, etc.) and the current default provider won't be changed. const std::map importable_engines = { - {"Amazon", TemplateURLPrepopulateData::amazon}, {"Bing", TemplateURLPrepopulateData::bing}, {"DuckDuckGo", TemplateURLPrepopulateData::duckduckgo}, - {"Ecosia", TemplateURLPrepopulateData::ecosia}, - {"GitHub", TemplateURLPrepopulateData::github}, {"Google", TemplateURLPrepopulateData::google}, - {"Infogalactic", TemplateURLPrepopulateData::infogalactic}, - {"MDN Web Docs", TemplateURLPrepopulateData::mdnwebdocs}, {"Qwant", TemplateURLPrepopulateData::qwant}, - {"searx", TemplateURLPrepopulateData::searx}, - {"Semantic Scholar", TemplateURLPrepopulateData::semanticscholar}, - {"Stack Overflow", TemplateURLPrepopulateData::stackoverflow}, {"StartPage", TemplateURLPrepopulateData::startpage}, - {"Twitter", TemplateURLPrepopulateData::twitter}, - {"Wikipedia", TemplateURLPrepopulateData::wikipedia}, - {"Wolfram Alpha", TemplateURLPrepopulateData::wolframalpha}, - {"Yahoo", TemplateURLPrepopulateData::yahoo}, - {"Yandex", TemplateURLPrepopulateData::yandex}, - {"YouTube", TemplateURLPrepopulateData::youtube} }; void BraveProfileWriter::UpdateSettings(const SessionStoreSettings& settings) { diff --git a/chromium_src/components/search_engines/brave_template_url_prepopulate_data_unittest.cc b/chromium_src/components/search_engines/brave_template_url_prepopulate_data_unittest.cc index 61fb7b0239dd..4425036adf98 100644 --- a/chromium_src/components/search_engines/brave_template_url_prepopulate_data_unittest.cc +++ b/chromium_src/components/search_engines/brave_template_url_prepopulate_data_unittest.cc @@ -5,6 +5,8 @@ #include #include +#include +#include #include #include "base/command_line.h" @@ -39,11 +41,12 @@ std::string GetHostFromTemplateURLData(const TemplateURLData& data) { using namespace TemplateURLPrepopulateData; // NOLINT const PrepopulatedEngine* const kBraveAddedEngines[] = { - &amazon, &ecosia, &github, &mdnwebdocs, &searx, - &semanticscholar, &stackoverflow, &startpage, &twitter, - &wikipedia, &wolframalpha, &yandex, &youtube, + &startpage, }; +const std::unordered_set kOverriddenEnginesNames = {L"DuckDuckGo", + L"Qwant"}; + std::vector GetAllPrepopulatedEngines() { std::vector engines = TemplateURLPrepopulateData::GetAllPrepopulatedEngines(); @@ -78,11 +81,22 @@ TEST_F(BraveTemplateURLPrepopulateDataTest, UniqueKeywords) { } } +// Verifies that engines we override are used and not the original engines. +TEST_F(BraveTemplateURLPrepopulateDataTest, OverriddenEngines) { + using PrepopulatedEngine = TemplateURLPrepopulateData::PrepopulatedEngine; + const std::vector all_engines = + ::GetAllPrepopulatedEngines(); + for (const PrepopulatedEngine* engine : all_engines) { + if (kOverriddenEnginesNames.count(engine->name) > 0) + ASSERT_GE(static_cast(engine->id), + TemplateURLPrepopulateData::BRAVE_PREPOPULATED_ENGINES_START); + } +} + // Verifies that the set of prepopulate data for each locale // doesn't contain entries with duplicate ids. TEST_F(BraveTemplateURLPrepopulateDataTest, UniqueIDs) { const int kCountryIds[] = { - 'C' << 8 | 'A', 'D' << 8 | 'E', 'F' << 8 | 'R', 'U' << 8 | 'S', diff --git a/chromium_src/components/search_engines/brave_template_url_service_util_unittest.cc b/chromium_src/components/search_engines/brave_template_url_service_util_unittest.cc index 1646dd763e5c..0a215d9276e2 100644 --- a/chromium_src/components/search_engines/brave_template_url_service_util_unittest.cc +++ b/chromium_src/components/search_engines/brave_template_url_service_util_unittest.cc @@ -1,6 +1,7 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +/* Copyright (c) 2019 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include @@ -47,30 +48,24 @@ class BraveTemplateURLServiceUtilTest : public testing::Test { TEST_F(BraveTemplateURLServiceUtilTest, GetSearchProvidersUsingKeywordResult) { std::vector local_turls; // Create a sets of TURLs in order different from prepopulated TURLs. - local_turls.push_back(*CreatePrepopulateTemplateURLData(508, ":x", 1)); - local_turls.push_back( - *CreatePrepopulateTemplateURLData(502, ":e", 2)); - local_turls.push_back(*CreatePrepopulateTemplateURLData(15, ":ya", 3)); - local_turls.push_back( - *CreatePrepopulateTemplateURLData(511, ":sp", 4)); - local_turls.push_back(*CreatePrepopulateTemplateURLData(505, ":i", 5)); - local_turls.push_back(*CreatePrepopulateTemplateURLData(3, ":b", 6)); - local_turls.push_back(*CreatePrepopulateTemplateURLData(507, ":q", 7)); - local_turls.push_back( - *CreatePrepopulateTemplateURLData(501, ":d", 8)); - local_turls.push_back(*CreatePrepopulateTemplateURLData(1, ":g", 9)); + local_turls.push_back(*CreatePrepopulateTemplateURLData(511, ":sp", 1)); + local_turls.push_back(*CreatePrepopulateTemplateURLData(15, ":ya", 2)); + local_turls.push_back(*CreatePrepopulateTemplateURLData(3, ":b", 3)); + local_turls.push_back(*CreatePrepopulateTemplateURLData(507, ":q", 4)); + local_turls.push_back(*CreatePrepopulateTemplateURLData(501, ":d", 5)); + local_turls.push_back(*CreatePrepopulateTemplateURLData(1, ":g", 6)); std::unique_ptr default_turl = std::make_unique(local_turls.back()); // Add TURLs with PrepopulateID that doesn't exist in prepopulated TURLs. - local_turls.push_back(*CreatePrepopulateTemplateURLData(0, "random1", 10)); - local_turls.push_back(*CreatePrepopulateTemplateURLData(1004, "random2", 11)); + local_turls.push_back(*CreatePrepopulateTemplateURLData(0, "random1", 7)); + local_turls.push_back(*CreatePrepopulateTemplateURLData(1004, "random2", 8)); // Prepare call arguments WDKeywordsResult kwResult; kwResult.builtin_keyword_version = TemplateURLPrepopulateData::GetDataVersion(&prefs_); - kwResult.default_search_provider_id = 9; + kwResult.default_search_provider_id = 2; kwResult.keywords = local_turls; WDResult result(KEYWORDS_RESULT, kwResult); @@ -88,13 +83,10 @@ TEST_F(BraveTemplateURLServiceUtilTest, GetSearchProvidersUsingKeywordResult) { EXPECT_EQ(template_urls[1]->keyword(), base::ASCIIToUTF16(":d")); EXPECT_EQ(template_urls[2]->keyword(), base::ASCIIToUTF16(":q")); EXPECT_EQ(template_urls[3]->keyword(), base::ASCIIToUTF16(":b")); - EXPECT_EQ(template_urls[4]->keyword(), base::ASCIIToUTF16(":e")); - EXPECT_EQ(template_urls[5]->keyword(), base::ASCIIToUTF16(":i")); - EXPECT_EQ(template_urls[6]->keyword(), base::ASCIIToUTF16(":x")); - EXPECT_EQ(template_urls[7]->keyword(), base::ASCIIToUTF16(":sp")); - EXPECT_EQ(template_urls[8]->keyword(), base::ASCIIToUTF16(":ya")); - EXPECT_EQ(template_urls[9]->keyword(), base::ASCIIToUTF16("random1")); - EXPECT_EQ(template_urls[10]->keyword(), base::ASCIIToUTF16("random2")); + EXPECT_EQ(template_urls[4]->keyword(), base::ASCIIToUTF16(":sp")); + EXPECT_EQ(template_urls[5]->keyword(), base::ASCIIToUTF16(":ya")); + EXPECT_EQ(template_urls[6]->keyword(), base::ASCIIToUTF16("random1")); + EXPECT_EQ(template_urls[7]->keyword(), base::ASCIIToUTF16("random2")); // Reset template_urls.clear(); @@ -114,11 +106,8 @@ TEST_F(BraveTemplateURLServiceUtilTest, GetSearchProvidersUsingKeywordResult) { EXPECT_EQ(template_urls[1]->keyword(), base::ASCIIToUTF16(":g")); EXPECT_EQ(template_urls[2]->keyword(), base::ASCIIToUTF16(":d")); EXPECT_EQ(template_urls[3]->keyword(), base::ASCIIToUTF16(":b")); - EXPECT_EQ(template_urls[4]->keyword(), base::ASCIIToUTF16(":e")); - EXPECT_EQ(template_urls[5]->keyword(), base::ASCIIToUTF16(":i")); - EXPECT_EQ(template_urls[6]->keyword(), base::ASCIIToUTF16(":x")); - EXPECT_EQ(template_urls[7]->keyword(), base::ASCIIToUTF16(":sp")); - EXPECT_EQ(template_urls[8]->keyword(), base::ASCIIToUTF16(":ya")); - EXPECT_EQ(template_urls[9]->keyword(), base::ASCIIToUTF16("random1")); - EXPECT_EQ(template_urls[10]->keyword(), base::ASCIIToUTF16("random2")); + EXPECT_EQ(template_urls[4]->keyword(), base::ASCIIToUTF16(":sp")); + EXPECT_EQ(template_urls[5]->keyword(), base::ASCIIToUTF16(":ya")); + EXPECT_EQ(template_urls[6]->keyword(), base::ASCIIToUTF16("random1")); + EXPECT_EQ(template_urls[7]->keyword(), base::ASCIIToUTF16("random2")); } 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 f13775feea0c..bc8ce10cbff3 100644 --- a/chromium_src/components/search_engines/template_url_prepopulate_data.cc +++ b/chromium_src/components/search_engines/template_url_prepopulate_data.cc @@ -36,31 +36,10 @@ namespace { const std::map brave_engines_map = { {PREPOPULATED_ENGINE_ID_GOOGLE, &google}, - {PREPOPULATED_ENGINE_ID_YAHOO, &yahoo}, - {PREPOPULATED_ENGINE_ID_YAHOO_QC, &yahoo_qc}, {PREPOPULATED_ENGINE_ID_BING, &bing}, - {PREPOPULATED_ENGINE_ID_YANDEX, &yandex}, - {PREPOPULATED_ENGINE_ID_AMAZON, &amazon}, {PREPOPULATED_ENGINE_ID_DUCKDUCKGO, &duckduckgo}, - {PREPOPULATED_ENGINE_ID_ECOSIA, &ecosia}, - {PREPOPULATED_ENGINE_ID_GITHUB, &github}, - {PREPOPULATED_ENGINE_ID_INFOGALACTIC, &infogalactic}, - {PREPOPULATED_ENGINE_ID_MDNWEBDOCS, &mdnwebdocs}, {PREPOPULATED_ENGINE_ID_QWANT, &qwant}, - {PREPOPULATED_ENGINE_ID_SEARX, &searx}, - {PREPOPULATED_ENGINE_ID_SEMANTICSCHOLAR, &semanticscholar}, - {PREPOPULATED_ENGINE_ID_STACKOVERFLOW, &stackoverflow}, {PREPOPULATED_ENGINE_ID_STARTPAGE, &startpage}, - {PREPOPULATED_ENGINE_ID_TWITTER, &twitter}, - {PREPOPULATED_ENGINE_ID_WIKIPEDIA, &wikipedia}, - {PREPOPULATED_ENGINE_ID_WOLFRAMALPHA, &wolframalpha}, - {PREPOPULATED_ENGINE_ID_YOUTUBE, &youtube}, -}; - -// Engines that have localized versions -const BravePrepopulatedEngineID localized_engines[] = { - PREPOPULATED_ENGINE_ID_YAHOO, - PREPOPULATED_ENGINE_ID_YANDEX, }; // Engine ID to use as the default engine. @@ -82,46 +61,8 @@ const BravePrepopulatedEngineID brave_engines_default[] = { PREPOPULATED_ENGINE_ID_GOOGLE, PREPOPULATED_ENGINE_ID_DUCKDUCKGO, PREPOPULATED_ENGINE_ID_QWANT, - PREPOPULATED_ENGINE_ID_AMAZON, - PREPOPULATED_ENGINE_ID_BING, - PREPOPULATED_ENGINE_ID_ECOSIA, - PREPOPULATED_ENGINE_ID_GITHUB, - PREPOPULATED_ENGINE_ID_INFOGALACTIC, - PREPOPULATED_ENGINE_ID_MDNWEBDOCS, - PREPOPULATED_ENGINE_ID_SEARX, - PREPOPULATED_ENGINE_ID_SEMANTICSCHOLAR, - PREPOPULATED_ENGINE_ID_STACKOVERFLOW, - PREPOPULATED_ENGINE_ID_STARTPAGE, - PREPOPULATED_ENGINE_ID_TWITTER, - PREPOPULATED_ENGINE_ID_WIKIPEDIA, - PREPOPULATED_ENGINE_ID_WOLFRAMALPHA, - PREPOPULATED_ENGINE_ID_YAHOO, - PREPOPULATED_ENGINE_ID_YANDEX, - PREPOPULATED_ENGINE_ID_YOUTUBE, -}; - -// Canada - adds Yahoo QC. -const BravePrepopulatedEngineID brave_engines_CA[] = { - PREPOPULATED_ENGINE_ID_GOOGLE, - PREPOPULATED_ENGINE_ID_DUCKDUCKGO, - PREPOPULATED_ENGINE_ID_QWANT, - PREPOPULATED_ENGINE_ID_AMAZON, PREPOPULATED_ENGINE_ID_BING, - PREPOPULATED_ENGINE_ID_ECOSIA, - PREPOPULATED_ENGINE_ID_GITHUB, - PREPOPULATED_ENGINE_ID_INFOGALACTIC, - PREPOPULATED_ENGINE_ID_MDNWEBDOCS, - PREPOPULATED_ENGINE_ID_SEARX, - PREPOPULATED_ENGINE_ID_SEMANTICSCHOLAR, - PREPOPULATED_ENGINE_ID_STACKOVERFLOW, PREPOPULATED_ENGINE_ID_STARTPAGE, - PREPOPULATED_ENGINE_ID_TWITTER, - PREPOPULATED_ENGINE_ID_WIKIPEDIA, - PREPOPULATED_ENGINE_ID_WOLFRAMALPHA, - PREPOPULATED_ENGINE_ID_YAHOO, - PREPOPULATED_ENGINE_ID_YAHOO_QC, - PREPOPULATED_ENGINE_ID_YANDEX, - PREPOPULATED_ENGINE_ID_YOUTUBE, }; // Germany - Qwant appears on top. @@ -129,22 +70,8 @@ const BravePrepopulatedEngineID brave_engines_DE[] = { PREPOPULATED_ENGINE_ID_QWANT, PREPOPULATED_ENGINE_ID_GOOGLE, PREPOPULATED_ENGINE_ID_DUCKDUCKGO, - PREPOPULATED_ENGINE_ID_AMAZON, PREPOPULATED_ENGINE_ID_BING, - PREPOPULATED_ENGINE_ID_ECOSIA, - PREPOPULATED_ENGINE_ID_GITHUB, - PREPOPULATED_ENGINE_ID_INFOGALACTIC, - PREPOPULATED_ENGINE_ID_MDNWEBDOCS, - PREPOPULATED_ENGINE_ID_SEARX, - PREPOPULATED_ENGINE_ID_SEMANTICSCHOLAR, - PREPOPULATED_ENGINE_ID_STACKOVERFLOW, PREPOPULATED_ENGINE_ID_STARTPAGE, - PREPOPULATED_ENGINE_ID_TWITTER, - PREPOPULATED_ENGINE_ID_WIKIPEDIA, - PREPOPULATED_ENGINE_ID_WOLFRAMALPHA, - PREPOPULATED_ENGINE_ID_YAHOO, - PREPOPULATED_ENGINE_ID_YANDEX, - PREPOPULATED_ENGINE_ID_YOUTUBE, }; // France - Qwant appears on top. @@ -152,191 +79,13 @@ const BravePrepopulatedEngineID brave_engines_FR[] = { PREPOPULATED_ENGINE_ID_QWANT, PREPOPULATED_ENGINE_ID_GOOGLE, PREPOPULATED_ENGINE_ID_DUCKDUCKGO, - PREPOPULATED_ENGINE_ID_AMAZON, PREPOPULATED_ENGINE_ID_BING, - PREPOPULATED_ENGINE_ID_ECOSIA, - PREPOPULATED_ENGINE_ID_GITHUB, - PREPOPULATED_ENGINE_ID_INFOGALACTIC, - PREPOPULATED_ENGINE_ID_MDNWEBDOCS, - PREPOPULATED_ENGINE_ID_SEARX, - PREPOPULATED_ENGINE_ID_SEMANTICSCHOLAR, - PREPOPULATED_ENGINE_ID_STACKOVERFLOW, PREPOPULATED_ENGINE_ID_STARTPAGE, - PREPOPULATED_ENGINE_ID_TWITTER, - PREPOPULATED_ENGINE_ID_WIKIPEDIA, - PREPOPULATED_ENGINE_ID_WOLFRAMALPHA, - PREPOPULATED_ENGINE_ID_YAHOO, - PREPOPULATED_ENGINE_ID_YANDEX, - PREPOPULATED_ENGINE_ID_YOUTUBE, }; -// Retrieves appropriate to the |country_id| localized version of Yahoo -// engine. -const PrepopulatedEngine* GetLocalizedYahooEngineForCountryID(int country_id) { - switch (country_id) { - UNHANDLED_COUNTRY(A, R) // Argentina - return &yahoo_ar; - UNHANDLED_COUNTRY(A, T) // Austria - return &yahoo_at; - UNHANDLED_COUNTRY(A, U) // Australia and countries that default to it - UNHANDLED_COUNTRY(C, C) // Cocos Islands - UNHANDLED_COUNTRY(C, X) // Christmas Island - UNHANDLED_COUNTRY(H, M) // Heard Island and McDonald Islands - UNHANDLED_COUNTRY(N, F) // Norfolk Island - return &yahoo_au; - UNHANDLED_COUNTRY(B, R) // Brazil - return &yahoo_br; - UNHANDLED_COUNTRY(C, A) // Canada - return &yahoo_ca; - UNHANDLED_COUNTRY(C, H) // Switzerland - return &yahoo_ch; - UNHANDLED_COUNTRY(C, L) // Chile - return &yahoo_cl; - UNHANDLED_COUNTRY(D, E) // Germany - return &yahoo_de; - UNHANDLED_COUNTRY(D, K) // Denmark and countries that default to it - UNHANDLED_COUNTRY(G, L) // Greenland - return &yahoo_dk; - UNHANDLED_COUNTRY(E, S) // Spain and countries that default to it - UNHANDLED_COUNTRY(A, D) // Andorra - return &yahoo_es; - UNHANDLED_COUNTRY(F, I) // Finland and countries that default to it - UNHANDLED_COUNTRY(A, X) // Aland Islands - return &yahoo_fi; - UNHANDLED_COUNTRY(F, R) // France and countries that default to it - UNHANDLED_COUNTRY(M, L) // Mali - UNHANDLED_COUNTRY(M, Q) // Martinique - UNHANDLED_COUNTRY(N, C) // New Caledonia - UNHANDLED_COUNTRY(N, E) // Niger - UNHANDLED_COUNTRY(P, F) // French Polynesia - UNHANDLED_COUNTRY(P, M) // Saint Pierre and Miquelon - UNHANDLED_COUNTRY(R, E) // Reunion - UNHANDLED_COUNTRY(S, N) // Senegal - UNHANDLED_COUNTRY(T, D) // Chad - UNHANDLED_COUNTRY(T, F) // French Southern Territories - UNHANDLED_COUNTRY(T, G) // Togo - UNHANDLED_COUNTRY(W, F) // Wallis and Futuna - UNHANDLED_COUNTRY(Y, T) // Mayotte - return &yahoo_fr; - UNHANDLED_COUNTRY(H, K) // Hong Kong - return &yahoo_hk; - UNHANDLED_COUNTRY(I, D) // Indonesia - return &yahoo_id; - UNHANDLED_COUNTRY(I, N) // India - return &yahoo_in; - UNHANDLED_COUNTRY(J, P) // Japan - return &yahoo_jp; - UNHANDLED_COUNTRY(M, X) // Mexico - return &yahoo_mx; - UNHANDLED_COUNTRY(M, Y) // Malaysia - return &yahoo_my; - UNHANDLED_COUNTRY(N, L) // Netherlands and countries that default to it - UNHANDLED_COUNTRY(A, N) // Netherlands Antilles - UNHANDLED_COUNTRY(A, W) // Aruba - return &yahoo_nl; - UNHANDLED_COUNTRY(N, Z) // New Zealand and countries that default to it - UNHANDLED_COUNTRY(C, K) // Cook Islands - UNHANDLED_COUNTRY(N, U) // Niue - UNHANDLED_COUNTRY(T, K) // Tokelau - return &yahoo_nz; - UNHANDLED_COUNTRY(P, E) // Peru - return &yahoo_pe; - UNHANDLED_COUNTRY(P, H) // Philippines - return &yahoo_ph; - UNHANDLED_COUNTRY(S, E) // Sweden - return &yahoo_se; - UNHANDLED_COUNTRY(S, G) // Singapore - return &yahoo_sg; - UNHANDLED_COUNTRY(T, H) // Thailand - return &yahoo_th; - UNHANDLED_COUNTRY(T, R) // Turkey - return &yahoo_tr; - UNHANDLED_COUNTRY(T, W) // Taiwan - return &yahoo_tw; - UNHANDLED_COUNTRY(G, B) // United Kingdom and countries that default to it - UNHANDLED_COUNTRY(B, M) // Bermuda - UNHANDLED_COUNTRY(F, K) // Falkland Islands - UNHANDLED_COUNTRY(G, G) // Guernsey - UNHANDLED_COUNTRY(G, I) // Gibraltar - UNHANDLED_COUNTRY(G, S) // South Georgia and the South Sandwich - // Islands - UNHANDLED_COUNTRY(I, E) // Ireland - UNHANDLED_COUNTRY(I, M) // Isle of Man - UNHANDLED_COUNTRY(I, O) // British Indian Ocean Territory - UNHANDLED_COUNTRY(J, E) // Jersey - UNHANDLED_COUNTRY(K, Y) // Cayman Islands - UNHANDLED_COUNTRY(M, S) // Montserrat - UNHANDLED_COUNTRY(M, T) // Malta - UNHANDLED_COUNTRY(P, N) // Pitcairn Islands - UNHANDLED_COUNTRY(S, H) // Saint Helena, Ascension Island, and Tristan da - // Cunha - UNHANDLED_COUNTRY(T, C) // Turks and Caicos Islands - UNHANDLED_COUNTRY(V, G) // British Virgin Islands - return &yahoo_uk; - UNHANDLED_COUNTRY(V, E) // Venezuela - return &yahoo_ve; - UNHANDLED_COUNTRY(V, N) // Vietnam - return &yahoo_vn; - default: - return &yahoo; - } -} - -// Retrieves appropriate to the |country_id| localized version of Yandex -// engine. -const PrepopulatedEngine* GetLocalizedYandexEngineForCountryID(int country_id) { - switch (country_id) { - UNHANDLED_COUNTRY(B, Y) // Belarus - return &yandex_by; - UNHANDLED_COUNTRY(K, Z) // Kazakhstan - return &yandex_kz; - UNHANDLED_COUNTRY(R, U) // Russia and countries that default to it - UNHANDLED_COUNTRY(A, M) // Armenia - UNHANDLED_COUNTRY(A, Z) // Azerbaijan - UNHANDLED_COUNTRY(K, G) // Kyrgyzstan - UNHANDLED_COUNTRY(L, T) // Lithuania - UNHANDLED_COUNTRY(L, V) // Latvia - UNHANDLED_COUNTRY(T, J) // Tajikistan - UNHANDLED_COUNTRY(T, M) // Turkmenistan - UNHANDLED_COUNTRY(U, Z) // Uzbekistan - return &yandex_ru; - default: - return &yandex; - } -} - -// Retrieves appropriate to the |country_id| localized version of a localized -// engine with the given |engine_id|. -const PrepopulatedEngine* GetLocalizedEngineForCountryID( - BravePrepopulatedEngineID engine_id, - int country_id) { - switch (engine_id) { - case PREPOPULATED_ENGINE_ID_YAHOO: - return GetLocalizedYahooEngineForCountryID(country_id); - case PREPOPULATED_ENGINE_ID_YANDEX: - return GetLocalizedYandexEngineForCountryID(country_id); - default: - // Only engines that have localized versions (as listed in - // localized_engines) should be passed in here. If you want to add a new - // localized engine then add it into the localized_engines and add a - // function to get the localized engine for that engine id. - DCHECK(false); - LOG(ERROR) << "No localized prepopulated engines defined for engine ID: " - << engine_id; - return nullptr; - } -} - -// Checks if the engine with the given |engine_id| has a localized version -bool EngineHasLocalizedVersion(BravePrepopulatedEngineID engine_id) { - return std::find(std::begin(localized_engines), std::end(localized_engines), - engine_id) != std::end(localized_engines); -} - // Builds a vector of PrepulatedEngine objects from the given array of -// |engine_ids|. Takes into account localized engines and finds localized -// engine for the given |country id|. Also, fills in the default engine -// index for the given |country_id|, if asked. +// |engine_ids|. Fills in the default engine index for the given |country_id|, +// if asked. std::vector GetEnginesFromEngineIDs( const BravePrepopulatedEngineID engine_ids[], size_t num_ids, @@ -347,12 +96,7 @@ std::vector GetEnginesFromEngineIDs( DCHECK(num_ids); std::vector engines; for (size_t i = 0; i < num_ids; ++i) { - const PrepopulatedEngine* engine = nullptr; - if (EngineHasLocalizedVersion(engine_ids[i])) - engine = GetLocalizedEngineForCountryID(engine_ids[i], country_id); - else - engine = brave_engines_map.at(engine_ids[i]); - + const PrepopulatedEngine* engine = brave_engines_map.at(engine_ids[i]); DCHECK(engine); if (engine) { engines.push_back(engine); @@ -370,18 +114,9 @@ void UpdateTemplateURLDataKeyword( case PREPOPULATED_ENGINE_ID_GOOGLE: t_urld->SetKeyword(base::ASCIIToUTF16(":g")); break; - case PREPOPULATED_ENGINE_ID_YAHOO: - t_urld->SetKeyword(base::ASCIIToUTF16(":y")); - break; - case PREPOPULATED_ENGINE_ID_YAHOO_QC: - t_urld->SetKeyword(base::ASCIIToUTF16(":yq")); - break; case PREPOPULATED_ENGINE_ID_BING: t_urld->SetKeyword(base::ASCIIToUTF16(":b")); break; - case PREPOPULATED_ENGINE_ID_YANDEX: - t_urld->SetKeyword(base::ASCIIToUTF16(":ya")); - break; } } @@ -396,10 +131,7 @@ GetBravePrepopulatedEnginesForCountryID( const BravePrepopulatedEngineID* brave_engines; size_t num_brave_engines; // Check for exceptions from the default list of engines - if (country_codes::CountryCharsToCountryID('C', 'A') == country_id) { - brave_engines = brave_engines_CA; - num_brave_engines = base::size(brave_engines_CA); - } else if (country_codes::CountryCharsToCountryID('D', 'E') == country_id) { + if (country_codes::CountryCharsToCountryID('D', 'E') == country_id) { brave_engines = brave_engines_DE; num_brave_engines = base::size(brave_engines_DE); } else if (country_codes::CountryCharsToCountryID('F', 'R') == country_id) { diff --git a/components/search_engines/brave_prepopulated_engines.cc b/components/search_engines/brave_prepopulated_engines.cc index 2967f55a4d20..295ef60487fd 100644 --- a/components/search_engines/brave_prepopulated_engines.cc +++ b/components/search_engines/brave_prepopulated_engines.cc @@ -1,351 +1,81 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "brave/components/search_engines/brave_prepopulated_engines.h" -#include "components/search_engines/prepopulated_engines.h" -#include "components/search_engines/search_engine_type.h" - -namespace TemplateURLPrepopulateData { - -// IMPORTANT! Make sure to bump this value if you make changes to the -// engines below or add/remove engines. -const int kBraveCurrentDataVersion = 2; - -const PrepopulatedEngine amazon = { - L"Amazon", - L":a", - "https://www.amazon.com/favicon.ico", - "https://www.amazon.com/exec/obidos/external-search/?field-keywords={searchTerms}&mode=blended", - "UTF-8", - "https://completion.amazon.com/search/complete?method=completion&q={searchTerms}&search-alias=aps&client=amazon-search-ui&mkt=1", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - SEARCH_ENGINE_OTHER, - PREPOPULATED_ENGINE_ID_AMAZON, -}; - -const PrepopulatedEngine duckduckgo = { - L"DuckDuckGo", - L":d", - "https://duckduckgo.com/favicon.ico", - "https://duckduckgo.com/?q={searchTerms}&t=brave", - "UTF-8", - "https://ac.duckduckgo.com/ac/?q={searchTerms}&type=list", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - SEARCH_ENGINE_OTHER, - PREPOPULATED_ENGINE_ID_DUCKDUCKGO, -}; - -const PrepopulatedEngine ecosia = { - L"Ecosia", - L":e", - "https://cdn.ecosia.org/assets/images/ico/favicon.ico", - "https://www.ecosia.org/search?q={searchTerms}", - "UTF-8", - "https://ac.ecosia.org/autocomplete?q={searchTerms}&type=list", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - SEARCH_ENGINE_OTHER, - PREPOPULATED_ENGINE_ID_ECOSIA, -}; - -const PrepopulatedEngine github = { - L"GitHub", - L":gh", - "https://www.github.com/favicon.ico", - "https://github.com/search?q={searchTerms}", - "UTF-8", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - SEARCH_ENGINE_OTHER, - PREPOPULATED_ENGINE_ID_GITHUB, -}; - -const PrepopulatedEngine infogalactic = { - L"Infogalactic", - L":i", - "https://www.infogalactic.com/favicon.ico", - "https://infogalactic.com/w/index.php?title=Special:Search&search={searchTerms}", - "UTF-8", - "https://infogalactic.com/w/api.php?action=opensearch&search={searchTerms}&namespace=0", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - SEARCH_ENGINE_OTHER, - PREPOPULATED_ENGINE_ID_INFOGALACTIC, -}; - -const PrepopulatedEngine mdnwebdocs = { - L"MDN Web Docs", - L":m", - "https://developer.mozilla.org/favicon.ico", - "https://developer.mozilla.org/search?q={searchTerms}", - "UTF-8", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - SEARCH_ENGINE_OTHER, - PREPOPULATED_ENGINE_ID_MDNWEBDOCS, -}; - -const PrepopulatedEngine qwant = { - L"Qwant", - L":q", - "https://www.qwant.com/favicon.ico", - "https://www.qwant.com/?q={searchTerms}&client=brz-brave", - "UTF-8", - "https://api.qwant.com/api/suggest/?q={searchTerms}&client=opensearch", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - SEARCH_ENGINE_OTHER, - PREPOPULATED_ENGINE_ID_QWANT, -}; - -const PrepopulatedEngine searx = { - L"searx", - L":x", - "https://searx.me/favicon.ico", - "https://searx.me/?q={searchTerms}&categories=general", - "UTF-8", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - SEARCH_ENGINE_OTHER, - PREPOPULATED_ENGINE_ID_SEARX, -}; - -const PrepopulatedEngine semanticscholar = { - L"Semantic Scholar", - L":ss", - "https://www.semanticscholar.org/img/favicon.png", - "https://www.semanticscholar.org/search?q={searchTerms}", - "UTF-8", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - SEARCH_ENGINE_OTHER, - PREPOPULATED_ENGINE_ID_SEMANTICSCHOLAR, -}; - -const PrepopulatedEngine stackoverflow = { - L"Stack Overflow", - L":s", - "https://cdn.sstatic.net/Sites/stackoverflow/img/favicon.ico", - "https://stackoverflow.com/search?q={searchTerms}", - "UTF-8", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - SEARCH_ENGINE_OTHER, - PREPOPULATED_ENGINE_ID_STACKOVERFLOW, -}; - -const PrepopulatedEngine startpage = { - L"StartPage", - L":sp", - "https://www.startpage.com/favicon.ico", - "https://www.startpage.com/do/dsearch?query={searchTerms}&cat=web&pl=opensearch", - "UTF-8", - "https://www.startpage.com/cgi-bin/csuggest?query={searchTerms}&limit=10&format=json", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - SEARCH_ENGINE_OTHER, - PREPOPULATED_ENGINE_ID_STARTPAGE, -}; - -const PrepopulatedEngine twitter = { - L"Twitter", - L":t", - "https://twitter.com/favicon.ico", - "https://twitter.com/search?q={searchTerms}&source=desktop-search", - "UTF-8", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - SEARCH_ENGINE_OTHER, - PREPOPULATED_ENGINE_ID_TWITTER, -}; - -const PrepopulatedEngine wikipedia = { - L"Wikipedia", - L":w", - "https://en.wikipedia.org/favicon.ico", - "https://en.wikipedia.org/wiki/Special:Search?search={searchTerms}", - "UTF-8", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - SEARCH_ENGINE_OTHER, - PREPOPULATED_ENGINE_ID_WIKIPEDIA, -}; - -const PrepopulatedEngine wolframalpha = { - L"Wolfram Alpha", - L":wa", - "https://www.wolframalpha.com/favicon.ico", - "https://www.wolframalpha.com/input/?i={searchTerms}", - "UTF-8", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - SEARCH_ENGINE_OTHER, - PREPOPULATED_ENGINE_ID_WOLFRAMALPHA, -}; - -const PrepopulatedEngine yandex = { - L"Yandex", - L":ya", - "https://yandex.st/lego/_/rBTjd6UOPk5913OSn5ZQVYMTQWQ.ico", - "https://yandex.com/search/?text={searchTerms}&clid=2274777", - "UTF-8", - "https://suggest.yandex.com/suggest-ff.cgi?part={searchTerms}", - "https://yandex.com/images/search/?rpt=imageview", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1", - NULL, - 0, - SEARCH_ENGINE_YANDEX, - 15, -}; - -const PrepopulatedEngine youtube = { - L"YouTube", - L":yt", - "https://www.youtube.com/favicon.ico", - "https://www.youtube.com/results?search_type=search_videos&search_query={searchTerms}&search_sort=relevance&search_category=0&page=", - "UTF-8", - "https://suggestqueries.google.com/complete/search?output=chrome&client=chrome&hl=it&q={searchTerms}&ds=yt", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - SEARCH_ENGINE_OTHER, - PREPOPULATED_ENGINE_ID_YOUTUBE, -}; - -} // namespace TemplateURLPrepopulateData +/* Copyright (c) 2019 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "brave/components/search_engines/brave_prepopulated_engines.h" +#include "components/search_engines/prepopulated_engines.h" +#include "components/search_engines/search_engine_type.h" + +namespace TemplateURLPrepopulateData { + +// IMPORTANT! Make sure to bump this value if you make changes to the +// engines below or add/remove engines. +const int kBraveCurrentDataVersion = 3; + +const PrepopulatedEngine duckduckgo = { + L"DuckDuckGo", + L":d", + "https://duckduckgo.com/favicon.ico", + "https://duckduckgo.com/?q={searchTerms}&t=brave", + "UTF-8", + "https://ac.duckduckgo.com/ac/?q={searchTerms}&type=list", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + 0, + SEARCH_ENGINE_OTHER, + PREPOPULATED_ENGINE_ID_DUCKDUCKGO, +}; + +const PrepopulatedEngine qwant = { + L"Qwant", + L":q", + "https://www.qwant.com/favicon.ico", + "https://www.qwant.com/?q={searchTerms}&client=brz-brave", + "UTF-8", + "https://api.qwant.com/api/suggest/?q={searchTerms}&client=opensearch", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + 0, + SEARCH_ENGINE_OTHER, + PREPOPULATED_ENGINE_ID_QWANT, +}; + +const PrepopulatedEngine startpage = { + L"StartPage", + L":sp", + "https://www.startpage.com/favicon.ico", + "https://www.startpage.com/do/" + "dsearch?query={searchTerms}&cat=web&pl=opensearch", + "UTF-8", + "https://www.startpage.com/cgi-bin/" + "csuggest?query={searchTerms}&limit=10&format=json", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + 0, + SEARCH_ENGINE_OTHER, + PREPOPULATED_ENGINE_ID_STARTPAGE, +}; + +} // namespace TemplateURLPrepopulateData diff --git a/components/search_engines/brave_prepopulated_engines.h b/components/search_engines/brave_prepopulated_engines.h index e9ea55bf1173..00e457aa8d62 100644 --- a/components/search_engines/brave_prepopulated_engines.h +++ b/components/search_engines/brave_prepopulated_engines.h @@ -1,72 +1,56 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef BRAVE_COMPONENTS_SEARCH_ENGINES_BRAVE_PREPOPULATED_ENGINES_H_ -#define BRAVE_COMPONENTS_SEARCH_ENGINES_BRAVE_PREPOPULATED_ENGINES_H_ - -#include - -#include "components/search_engines/prepopulated_engines.h" - -namespace TemplateURLPrepopulateData { - -extern const int kBraveCurrentDataVersion; - -// See comments on prepopulated engines ids in -// components/search_engines/prepopulated_engines_schema.json above the -// definition of the id field and in -// components/search_engines/prepopulated_engines.json at the top of the file. -// Currently taken ids range under 90, but we'd want to leave room for -// additions by Chromium, so starting our ids from 500. Potential problem: -// Chromium adds one of these engines to their list with a different id. -enum BravePrepopulatedEngineID : unsigned int { - PREPOPULATED_ENGINE_ID_INVALID = 0, - - // These engine IDs are already defined in prepopulated_engines.json - PREPOPULATED_ENGINE_ID_GOOGLE = 1, - PREPOPULATED_ENGINE_ID_YAHOO = 2, - PREPOPULATED_ENGINE_ID_YAHOO_QC = 5, - PREPOPULATED_ENGINE_ID_BING = 3, - PREPOPULATED_ENGINE_ID_YANDEX = 15, - // These engine IDs are not defined in Chromium - PREPOPULATED_ENGINE_ID_AMAZON = 500, - PREPOPULATED_ENGINE_ID_DUCKDUCKGO, - PREPOPULATED_ENGINE_ID_ECOSIA, - PREPOPULATED_ENGINE_ID_FINDX, // No longer in use (11/2018). - PREPOPULATED_ENGINE_ID_GITHUB, - PREPOPULATED_ENGINE_ID_INFOGALACTIC, - PREPOPULATED_ENGINE_ID_MDNWEBDOCS, - PREPOPULATED_ENGINE_ID_QWANT, - PREPOPULATED_ENGINE_ID_SEARX, - PREPOPULATED_ENGINE_ID_SEMANTICSCHOLAR, - PREPOPULATED_ENGINE_ID_STACKOVERFLOW, - PREPOPULATED_ENGINE_ID_STARTPAGE, - PREPOPULATED_ENGINE_ID_TWITTER, - PREPOPULATED_ENGINE_ID_WIKIPEDIA, - PREPOPULATED_ENGINE_ID_WOLFRAMALPHA, - PREPOPULATED_ENGINE_ID_YOUTUBE, -}; - -extern const PrepopulatedEngine amazon; -extern const PrepopulatedEngine duckduckgo; -extern const PrepopulatedEngine ecosia; -extern const PrepopulatedEngine github; -extern const PrepopulatedEngine infogalactic; -extern const PrepopulatedEngine mdnwebdocs; -extern const PrepopulatedEngine qwant; -extern const PrepopulatedEngine searx; -extern const PrepopulatedEngine semanticscholar; -extern const PrepopulatedEngine stackoverflow; -extern const PrepopulatedEngine startpage; -extern const PrepopulatedEngine twitter; -extern const PrepopulatedEngine wikipedia; -extern const PrepopulatedEngine wolframalpha; -// Yandex is already defined in chromium's prepopulated engines, but -// only as yandex_ua, _tr, _by, _ru, and _kz. Adding a generic one here. -extern const PrepopulatedEngine yandex; -extern const PrepopulatedEngine youtube; - -} // namespace TemplateURLPrepopulateData - -#endif // BRAVE_COMPONENTS_SEARCH_ENGINES_BRAVE_PREPOPULATED_ENGINES_H_ +/* Copyright (c) 2019 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef BRAVE_COMPONENTS_SEARCH_ENGINES_BRAVE_PREPOPULATED_ENGINES_H_ +#define BRAVE_COMPONENTS_SEARCH_ENGINES_BRAVE_PREPOPULATED_ENGINES_H_ + +#include + +#include "components/search_engines/prepopulated_engines.h" + +namespace TemplateURLPrepopulateData { + +extern const int kBraveCurrentDataVersion; + +// See comments on prepopulated engines ids in +// components/search_engines/prepopulated_engines_schema.json above the +// definition of the id field and in +// components/search_engines/prepopulated_engines.json at the top of the file. +// Currently taken ids range under 90, but we'd want to leave room for +// additions by Chromium, so starting our ids from 500. Potential problem: +// Chromium adds one of these engines to their list with a different id. +enum BravePrepopulatedEngineID : unsigned int { + PREPOPULATED_ENGINE_ID_INVALID = 0, + + // These engine IDs are already defined in prepopulated_engines.json + PREPOPULATED_ENGINE_ID_GOOGLE = 1, + PREPOPULATED_ENGINE_ID_BING = 3, + // These engine IDs are not defined in Chromium + BRAVE_PREPOPULATED_ENGINES_START = 500, + PREPOPULATED_ENGINE_ID_AMAZON = 500, // No longer in defaults (2/2019). + PREPOPULATED_ENGINE_ID_DUCKDUCKGO, + PREPOPULATED_ENGINE_ID_ECOSIA, // No longer in defaults (2/2019). + PREPOPULATED_ENGINE_ID_FINDX, // No longer exists (11/2018). + PREPOPULATED_ENGINE_ID_GITHUB, // No longer in defaults (2/2019). + PREPOPULATED_ENGINE_ID_INFOGALACTIC, // No longer in defaults (2/2019). + PREPOPULATED_ENGINE_ID_MDNWEBDOCS, // No longer in defaults (2/2019). + PREPOPULATED_ENGINE_ID_QWANT, + PREPOPULATED_ENGINE_ID_SEARX, // No longer in defaults (2/2019). + PREPOPULATED_ENGINE_ID_SEMANTICSCHOLAR, // No longer in defaults (2/2019). + PREPOPULATED_ENGINE_ID_STACKOVERFLOW, // No longer in defaults (2/2019). + PREPOPULATED_ENGINE_ID_STARTPAGE, + PREPOPULATED_ENGINE_ID_TWITTER, // No longer in defaults (2/2019). + PREPOPULATED_ENGINE_ID_WIKIPEDIA, // No longer in defaults (2/2019). + PREPOPULATED_ENGINE_ID_WOLFRAMALPHA, // No longer in defaults (2/2019). + PREPOPULATED_ENGINE_ID_YOUTUBE, // No longer in defaults (2/2019). +}; + +extern const PrepopulatedEngine duckduckgo; +extern const PrepopulatedEngine qwant; +extern const PrepopulatedEngine startpage; + +} // namespace TemplateURLPrepopulateData + +#endif // BRAVE_COMPONENTS_SEARCH_ENGINES_BRAVE_PREPOPULATED_ENGINES_H_