Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update search engines (uplift to 1.27.x) #9428

Merged
merged 3 commits into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions android/brave_java_resources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,6 @@ brave_java_resources = [
"java/res/layout/brave_bookmark_toolbar.xml",
"java/res/layout/brave_bottom_new_tab_button.xml",
"java/res/layout/brave_custom_tabs_toolbar.xml",
"java/res/layout/brave_ddg_offer_link.xml",
"java/res/layout/brave_dialog_preference.xml",
"java/res/layout/brave_rewards_auto_contrib.xml",
"java/res/layout/brave_rewards_donation_sent.xml",
Expand Down Expand Up @@ -771,7 +770,6 @@ brave_java_resources = [
"java/res/layout/brave_webrtc_policy_preference.xml",
"java/res/layout/bre_bottom_banner.xml",
"java/res/layout/crypto_widget_layout.xml",
"java/res/layout/ddg_offer_layout.xml",
"java/res/layout/fragment_add_account_onboarding_dialog.xml",
"java/res/layout/fragment_backup_wallet.xml",
"java/res/layout/fragment_binance_buy.xml",
Expand Down
1 change: 0 additions & 1 deletion android/brave_java_sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ brave_java_sources = [
"../../brave/android/java/org/chromium/chrome/browser/notifications/retention/RetentionNotification.java",
"../../brave/android/java/org/chromium/chrome/browser/notifications/retention/RetentionNotificationPublisher.java",
"../../brave/android/java/org/chromium/chrome/browser/notifications/retention/RetentionNotificationUtil.java",
"../../brave/android/java/org/chromium/chrome/browser/ntp/BraveDuckDuckGoOfferView.java",
"../../brave/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPage.java",
"../../brave/android/java/org/chromium/chrome/browser/ntp/BraveNewTabPageLayout.java",
"../../brave/android/java/org/chromium/chrome/browser/ntp/IncognitoNewTabPageView.java",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -935,9 +935,7 @@ public void onUrlFocusChange(boolean hasFocus) {
&& BraveActivity.getBraveActivity().getActivityTab() != null
&& UrlUtilities.isNTPUrl(
BraveActivity.getBraveActivity().getActivityTab().getUrlString())
&& !OnboardingPrefManager.getInstance().hasSearchEngineOnboardingShown()
&& !BraveSearchEngineUtils.getDSEShortName(true).equals(
OnboardingPrefManager.DUCKDUCKGO)) {
&& !OnboardingPrefManager.getInstance().hasSearchEngineOnboardingShown()) {
Intent searchActivityIntent = new Intent(context, SearchActivity.class);
context.startActivity(searchActivityIntent);
}
Expand Down
27 changes: 0 additions & 27 deletions android/java/res/layout/brave_ddg_offer_link.xml

This file was deleted.

40 changes: 0 additions & 40 deletions android/java/res/layout/ddg_offer_layout.xml

This file was deleted.

6 changes: 0 additions & 6 deletions android/java/res/layout/new_tab_page_incognito.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@
android:text="@string/learn_more"
android:visibility = "gone" />

<org.chromium.chrome.browser.ntp.BraveDuckDuckGoOfferView android:id="@+id/brave_duck_duck_go_offer_view"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<include layout="@layout/brave_ddg_offer_link" />
</org.chromium.chrome.browser.ntp.BraveDuckDuckGoOfferView>

</LinearLayout>

</org.chromium.chrome.browser.ntp.NewTabPageScrollView>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "chrome/browser/profiles/profile.h"
#include "components/prefs/pref_service.h"
#include "components/search_engines/search_engines_pref_names.h"
#include "components/search_engines/template_url_data_util.h"
#include "components/search_engines/template_url_prepopulate_data.h"
#include "components/search_engines/template_url_service.h"

Expand Down Expand Up @@ -54,26 +55,14 @@ void TorWindowSearchEngineProviderService::OnTemplateURLServiceChanged() {
std::unique_ptr<TemplateURLData>
TorWindowSearchEngineProviderService::GetInitialSearchEngineProvider(
PrefService* prefs) const {
std::unique_ptr<TemplateURLData> provider_data;

int initial_id = TemplateURLPrepopulateData::GetPrepopulatedDefaultSearch(
otr_profile_->GetPrefs())
->prepopulate_id;
switch (initial_id) {
case TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_QWANT:
case TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_DUCKDUCKGO:
case TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_DUCKDUCKGO_DE:
case TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_DUCKDUCKGO_AU_NZ_IE:
break;

default:
initial_id =
TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_DUCKDUCKGO;
break;
std::unique_ptr<TemplateURLData> provider_data =
TemplateURLPrepopulateData::GetPrepopulatedDefaultSearch(
otr_profile_->GetPrefs());
if (provider_data->prepopulate_id ==
TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_QWANT) {
return provider_data;
}
provider_data =
TemplateURLPrepopulateData::GetPrepopulatedEngine(prefs, initial_id);

DCHECK(provider_data);
return provider_data;
return TemplateURLDataFromPrepopulatedEngine(
TemplateURLPrepopulateData::duckduckgo);
}
15 changes: 0 additions & 15 deletions browser/ui/android/strings/android_brave_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -406,21 +406,6 @@ This file contains all "about" strings. It is set to NOT be translated, in tran
<message name="IDS_MENU_BRAVE_REWARDS" desc="Title for brave rewards menu item">
Brave Rewards
</message>
<message name="IDS_DDG_OFFER_TITLE" desc="Title for DDG offer.">
Private search with DuckDuckGo?
</message>
<message name="IDS_DDG_OFFER_TEXT" desc="Text for DDG offer.">
With private search, Brave will use DuckDuckGo to answer your searches while you are in this private tab. DuckDuckGo is a search engine that does not track your search history, enabling you to search privately.
</message>
<message name="IDS_DDG_OFFER_POSITIVE" desc="Positive button text for DDG offer.">
Yes
</message>
<message name="IDS_DDG_OFFER_NEGATIVE" desc="Negative button text for DDG offer.">
No
</message>
<message name="IDS_DDG_OFFER_LINK" desc="Text for DDG offer link.">
Learn about private search with DuckDuckGo
</message>
<message name="IDS_BRAVE_UI_THANK_YOU" desc="A message that appears after tipping">
Thank you
</message>
Expand Down
1 change: 0 additions & 1 deletion browser/ui/webui/brave_webui_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,6 @@ void CustomizeWebUIHTMLSource(const std::string &name,
{ "setDefaultSearchEngine", IDS_BRAVE_WELCOME_PAGE_SEARCH_TITLE },
{ "chooseSearchEngine", IDS_BRAVE_WELCOME_PAGE_SEARCH_DESC },
{ "selectSearchEngine", IDS_BRAVE_WELCOME_PAGE_SEARCH_SELECT },
{ "privateExperience", IDS_BRAVE_WELCOME_PAGE_PRIVATE_EXPERIENCE_DESC },
{ "skipWelcomeTour", IDS_BRAVE_WELCOME_PAGE_SKIP_BUTTON },
{ "next", IDS_BRAVE_WELCOME_PAGE_NEXT_BUTTON },
{ "done", IDS_BRAVE_WELCOME_PAGE_DONE_BUTTON },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ TEST_F(BraveTemplateURLPrepopulateDataTest, DefaultSearchProvidersForUSA) {
}

TEST_F(BraveTemplateURLPrepopulateDataTest, DefaultSearchProvidersForGermany) {
CheckForCountry('D', 'E', "DuckDuckGo");
CheckForCountry('D', 'E', "Google");
}

TEST_F(BraveTemplateURLPrepopulateDataTest, DefaultSearchProvidersForFrance) {
Expand All @@ -166,16 +166,16 @@ TEST_F(BraveTemplateURLPrepopulateDataTest, DefaultSearchProvidersForFrance) {

TEST_F(BraveTemplateURLPrepopulateDataTest,
DefaultSearchProvidersForAustralia) {
CheckForCountry('A', 'U', "DuckDuckGo");
CheckForCountry('A', 'U', "Google");
}

TEST_F(BraveTemplateURLPrepopulateDataTest,
DefaultSearchProvidersForNewZealand) {
CheckForCountry('N', 'Z', "DuckDuckGo");
CheckForCountry('N', 'Z', "Google");
}

TEST_F(BraveTemplateURLPrepopulateDataTest, DefaultSearchProvidersForIreland) {
CheckForCountry('I', 'E', "DuckDuckGo");
CheckForCountry('I', 'E', "Google");
}

TEST_F(BraveTemplateURLPrepopulateDataTest,
Expand Down
Loading