Commit 860af6f6 authored by Aayush Gupta's avatar Aayush Gupta
Browse files

Browser: Rework patches to adapt with upstream changes


Signed-off-by: Aayush Gupta's avatarAayush Gupta <theimpulson@e.email>
parent 4bf1a146
e-set-package-name.patch
e-set-app-name.patch
e-set-popular-sites.patch
e-enable-donottrack.patch
e-share-search-engine.patch
e-async-dns-disable.patch
e-set-search-engines.patch
e-set-informations.patch
e-disable-autofill.patch
e-rebrand-translations.patch
e-enable-custom-tabs-by-default.patch
e-Launcher-icon-updated.patch
e-enable-search-suggestion.patch
e-replaced-chrome-with-browser-in-strings-file.patch
e-remove-string-google-from-other-services.patch
e-help-and-feedback-url.patch
e-disable-touch-to-search.patch
e-replace-chrome-icon-with-browser.patch
0001-Browser-Change-app-and-package-name-to-browser.patch
0001-Browser-Use-our-custom-icon-instead-of-chromium.patch
0001-Browser-Rename-strings-to-browser.patch
0001-Browser-Point-to-our-default-popular-sites.patch
0001-Browser-Enable-do-not-track-by-default.patch
0001-Browser-Add-provider-to-share-default-search-engine.patch
0001-Browser-Disable-async-DNS-by-default-on-Android.patch
0001-Browser-Enable-custom-tabs-by-default.patch
0001-Browser-Enable-search-suggestion-by-default.patch
0001-Browser-Hide-and-disable-touch-to-search-option.patch
0001-Browser-Modify-default-search-engines.patch
0001-Revert-Bromite-auto-updater.patch
0001-Revert-Block-gateway-attacks-via-websockets.patch
0001-Revert-Disable-unified-autoplay-feature.patch
From baa3101381755a9a7a196c0483e4a7e42104d90d Mon Sep 17 00:00:00 2001
From 17bf90aaa75ab1d9143fd9cdc2701b6fb37f63ec Mon Sep 17 00:00:00 2001
From: Aayush Gupta <theimpulson@e.email>
Date: Thu, 18 Mar 2021 13:18:32 +0100
Subject: [PATCH] [PATCH] chrome: Share search engine
Date: Fri, 26 Nov 2021 08:03:13 +0000
Subject: [PATCH] Browser: Add provider to share default search engine
Signed-off-by: Aayush Gupta <theimpulson@e.email>
---
chrome/android/java/AndroidManifest.xml | 6 ++
.../provider/SearchEngineProvider.java | 79 +++++++++++++++++++
chrome/android/java_sources.gni | 2 +
3 files changed, 87 insertions(+)
chrome/android/java_sources.gni | 1 +
3 files changed, 86 insertions(+)
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/provider/SearchEngineProvider.java
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
index e4845fe382a0..3e6931aef72c 100644
index acc04d8b6857a..fd8b42667c778 100644
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -1151,6 +1151,12 @@ by a child template that "extends" this file.
android:readPermission="android.permission.GLOBAL_SEARCH" />
@@ -1284,6 +1284,12 @@ by a child template that "extends" this file.
tools:ignore="ExportedContentProvider">
</provider>
+ <!-- Provider for search engine data. -->
......@@ -30,7 +30,7 @@ index e4845fe382a0..3e6931aef72c 100644
{% block extra_application_definitions_for_test %}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/provider/SearchEngineProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/provider/SearchEngineProvider.java
new file mode 100644
index 000000000000..86b7d3fd1457
index 0000000000000..299562413fe05
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/provider/SearchEngineProvider.java
@@ -0,0 +1,79 @@
......@@ -114,15 +114,14 @@ index 000000000000..86b7d3fd1457
+ }
+}
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni
index 01620861902e..74905035fffe 100644
index ff99735e85056..4450b96d0b8d0 100644
--- a/chrome/android/java_sources.gni
+++ b/chrome/android/java_sources.gni
@@ -51,3 +51,5 @@ if (enable_arcore) {
"java/src/org/chromium/chrome/browser/vr/ArDelegateImpl.java",
]
@@ -63,3 +63,4 @@ if (enable_arcore) {
}
+
chrome_java_sources += userscripts_java_sources
+chrome_java_sources += [ "java/src/org/chromium/chrome/browser/provider/SearchEngineProvider.java" ]
--
2.17.1
2.25.1
From 951f672e7e7ff6d43a7c4a2e37fa5224c20c1312 Mon Sep 17 00:00:00 2001
From 9191f8e182bf92e882e9995e712960893f7a5b99 Mon Sep 17 00:00:00 2001
From: Aayush Gupta <theimpulson@e.email>
Date: Thu, 18 Mar 2021 12:34:29 +0100
Subject: [PATCH] BUILD: Set package name of the browser to
"foundation.e.browser"
Date: Fri, 26 Nov 2021 05:39:25 +0000
Subject: [PATCH] Browser: Change app and package name to browser
Signed-off-by: Aayush Gupta <theimpulson@e.email>
---
chrome/android/BUILD.gn | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
chrome/android/BUILD.gn | 13 ++-----------
.../res_chromium_base/values/channel_constants.xml | 10 +++++-----
2 files changed, 7 insertions(+), 16 deletions(-)
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
index a489d1a3b1e4..f4d241a379d3 100644
index d440e71a0d886..0cb4718753fe7 100644
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -34,16 +34,7 @@ import("java_sources.gni")
import("static_initializers.gni")
import("trichrome.gni")
@@ -44,16 +44,7 @@ if (android_64bit_target_cpu && skip_secondary_abi_for_cq) {
assert(current_toolchain != android_secondary_abi_toolchain)
}
-_default_package = "org.chromium.chrome"
-if (android_channel != "default") {
......@@ -24,14 +24,14 @@ index a489d1a3b1e4..f4d241a379d3 100644
- # AndroidManifest and its upstream target's .AndroidManifest.expected file
- # are as expected. Upstream targets having a "org.chromium.chrome" package
- # name will cause the comparison to output many unnecessary differences.
- # See https://source.chromium.org/chromium/chromium/src/+/master:chrome/android/java/README.md
- # See https://source.chromium.org/chromium/chromium/src/+/main:chrome/android/java/README.md
- _default_package += "." + android_channel
-}
+_default_package = "foundation.e.browser"
declare_args() {
# Android package name to use when compiling the public chrome targets
@@ -55,7 +46,7 @@ declare_args() {
@@ -65,7 +56,7 @@ declare_args() {
# for details.
chrome_public_manifest_package = _default_package
}
......@@ -40,6 +40,25 @@ index a489d1a3b1e4..f4d241a379d3 100644
chrome_public_jinja_variables =
default_chrome_public_jinja_variables +
diff --git a/chrome/android/java/res_chromium_base/values/channel_constants.xml b/chrome/android/java/res_chromium_base/values/channel_constants.xml
index 460cbd791f23b..5adce5db9d242 100644
--- a/chrome/android/java/res_chromium_base/values/channel_constants.xml
+++ b/chrome/android/java/res_chromium_base/values/channel_constants.xml
@@ -5,9 +5,9 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The application name displayed to the user. -->
- <string name="app_name" translatable="false">Chromium</string>
- <string name="bookmark_widget_title" translatable="false">Chromium bookmarks</string>
- <string name="search_widget_title" translatable="false">Chromium search</string>
- <string name="quick_action_search_widget_title" translatable="false">Chromium quick action search</string>
- <string name="dino_widget_title" translatable="false">Chromium dino</string>
+ <string name="app_name" translatable="false">Browser</string>
+ <string name="bookmark_widget_title" translatable="false">Browser bookmarks</string>
+ <string name="search_widget_title" translatable="false">Browser search</string>
+ <string name="quick_action_search_widget_title" translatable="false">Browser quick action search</string>
+ <string name="dino_widget_title" translatable="false">Browser dino</string>
</resources>
--
2.17.1
2.25.1
From f5f030cd86abc25ad8f53a7ce4ef308deda5ba78 Mon Sep 17 00:00:00 2001
From 26005fd02b8c03fc6ddd6c450ab766a522e6b53b Mon Sep 17 00:00:00 2001
From: Aayush Gupta <theimpulson@e.email>
Date: Thu, 18 Mar 2021 13:20:54 +0100
Subject: [PATCH] [PATCH] chrome_features: Use default DNS settings
Date: Fri, 26 Nov 2021 08:26:03 +0000
Subject: [PATCH] Browser: Disable async DNS by default on Android
Signed-off-by: Aayush Gupta <theimpulson@e.email>
---
......@@ -9,18 +9,18 @@ Signed-off-by: Aayush Gupta <theimpulson@e.email>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
index 9f76e03a491b..d8dc824ff652 100644
index aac450f4fee76..49f2559598d00 100644
--- a/chrome/common/chrome_features.cc
+++ b/chrome/common/chrome_features.cc
@@ -85,7 +85,7 @@ const base::Feature kAppShimNewCloseBehavior{"AppShimNewCloseBehavior",
@@ -80,7 +80,7 @@ const base::Feature kAppShimNewCloseBehavior{"AppShimNewCloseBehavior",
// Enables the built-in DNS resolver.
const base::Feature kAsyncDns {
"AsyncDns",
-#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_MAC) || defined(OS_ANDROID)
+#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_MAC)
-#if defined(OS_CHROMEOS) || defined(OS_MAC) || defined(OS_ANDROID)
+#if defined(OS_CHROMEOS) || defined(OS_MAC)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
--
2.17.1
2.25.1
From 37fdad5af9959318e10cef89aeda832a02e309e5 Mon Sep 17 00:00:00 2001
From: Aayush Gupta <theimpulson@e.email>
Date: Tue, 1 Jun 2021 05:56:26 +0200
Subject: [PATCH] privacy_preferences: Enable custom tabs by default
From 2e1722f561cd6c96af515feb8ff9486990981496 Mon Sep 17 00:00:00 2001
From: Aayush Gupta <aayushgupta219@gmail.com>
Date: Mon, 29 Nov 2021 03:37:37 +0000
Subject: [PATCH] Browser: Enable custom tabs by default
Signed-off-by: Aayush Gupta <theimpulson@e.email>
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
---
chrome/android/java/res/xml/privacy_preferences.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
index 4707305f789d..ab730db7d006 100644
index f6f21411b6a69..a0e31a8f34380 100644
--- a/chrome/android/java/res/xml/privacy_preferences.xml
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -51,7 +51,7 @@
@@ -64,7 +64,7 @@
android:key="allow_custom_tab_intents"
android:title="@string/allow_custom_tab_intents_title"
android:summary="@string/allow_custom_tab_intents_summary"
- android:defaultValue="false" />
+ android:defaultValue="true" />
<Preference
android:key="privacy_sandbox"
android:title="@string/prefs_privacy_sandbox"
<org.chromium.components.browser_ui.settings.ChromeSwitchPreference
android:key="open_external_links_incognito"
android:title="@string/open_external_links_incognito_title"
--
2.17.1
2.25.1
From b36210a77be1f5a8cb14fdbb96f11bc4679116df Mon Sep 17 00:00:00 2001
From 5a9b5acefb9cab0f42466624a90f14743567f02a Mon Sep 17 00:00:00 2001
From: Aayush Gupta <theimpulson@e.email>
Date: Thu, 18 Mar 2021 12:56:59 +0100
Subject: [PATCH] [PATCH] browser_ui_prefs: Enable DoNotTrack by default
Date: Fri, 26 Nov 2021 07:34:57 +0000
Subject: [PATCH] Browser: Enable do not track by default
Signed-off-by: Aayush Gupta <theimpulson@e.email>
---
......@@ -9,10 +9,10 @@ Signed-off-by: Aayush Gupta <theimpulson@e.email>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc
index 67ea0bf4a5c4..0aaf2ba9a356 100644
index 20bb8b5bd368b..c529edeea5f35 100644
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -80,7 +80,7 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
@@ -86,7 +86,7 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacementPopup);
registry->RegisterDictionaryPref(prefs::kAppWindowPlacement);
registry->RegisterBooleanPref(
......@@ -22,5 +22,5 @@ index 67ea0bf4a5c4..0aaf2ba9a356 100644
#if !BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OS_ANDROID)
registry->RegisterBooleanPref(prefs::kPrintPreviewUseSystemDefaultPrinter,
--
2.17.1
2.25.1
From 3c78ab25ac0491aa833903c37fa704be9aa3a974 Mon Sep 17 00:00:00 2001
From: Aayush Gupta <theimpulson@e.email>
Date: Fri, 19 Mar 2021 06:36:41 +0100
Subject: [PATCH] [PATCH] profile: Enable search suggestion by default
From b576939773355b9d851b0f0e9cdcfc14cdef961a Mon Sep 17 00:00:00 2001
From: Aayush Gupta <aayushgupta219@gmail.com>
Date: Mon, 29 Nov 2021 03:39:21 +0000
Subject: [PATCH] Browser: Enable search suggestion by default
Signed-off-by: Aayush Gupta <theimpulson@e.email>
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
---
chrome/browser/profiles/profile.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
index 1dc2756d97d2..1bda0ff8e253 100644
index c8a3976280250..f50da2ceba636 100644
--- a/chrome/browser/profiles/profile.cc
+++ b/chrome/browser/profiles/profile.cc
@@ -248,7 +248,7 @@ const char Profile::kProfileKey[] = "__PROFILE__";
@@ -281,7 +281,7 @@ const char Profile::kProfileKey[] = "__PROFILE__";
void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(
prefs::kSearchSuggestEnabled,
......@@ -22,5 +22,5 @@ index 1dc2756d97d2..1bda0ff8e253 100644
#if defined(OS_ANDROID)
registry->RegisterStringPref(
--
2.17.1
2.25.1
From c394b168c77497303f32771b44540ad6d7b16eb6 Mon Sep 17 00:00:00 2001
From: Aayush Gupta <theimpulson@e.email>
Date: Wed, 9 Jun 2021 08:11:12 +0200
Subject: [PATCH] contextualsearch: Disable and hide the preference
From 122f22149c1b037c5b3481aaf3a2fbcc4d606858 Mon Sep 17 00:00:00 2001
From: Aayush Gupta <aayushgupta219@gmail.com>
Date: Mon, 29 Nov 2021 03:54:44 +0000
Subject: [PATCH] Browser: Hide and disable touch to search option
Signed-off-by: Aayush Gupta <theimpulson@e.email>
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
---
chrome/android/java/res/xml/privacy_preferences.xml | 1 +
chrome/android/java/res/xml/privacy_preferences.xml | 3 ++-
.../contextualsearch/ContextualSearchPreferenceFragment.java | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
index ab730db7d006..1f682107026d 100644
index a0e31a8f34380..42d14f1980b10 100644
--- a/chrome/android/java/res/xml/privacy_preferences.xml
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -71,6 +71,7 @@
android:summary="@string/prefs_autofill_assistant_summary"
android:persistent="false"/>
@@ -91,7 +91,8 @@
<org.chromium.components.browser_ui.settings.ChromeBasePreference
+ app:isPreferenceVisible="false"
android:key="contextual_search"
android:title="@string/contextual_search_title"
android:fragment="org.chromium.chrome.browser.contextualsearch.ContextualSearchPreferenceFragment"/>
- android:fragment="org.chromium.chrome.browser.contextualsearch.ContextualSearchPreferenceFragment"/>
+ android:fragment="org.chromium.chrome.browser.contextualsearch.ContextualSearchPreferenceFragment"
+ app:isPreferenceVisible="false" />
</PreferenceCategory>
</PreferenceScreen>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchPreferenceFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchPreferenceFragment.java
index cbf437162aa4..88d12b734fa7 100644
index 27f7461a76ad7..58c41debb8450 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchPreferenceFragment.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchPreferenceFragment.java
@@ -39,8 +39,9 @@ public class ContextualSearchPreferenceFragment extends PreferenceFragmentCompat
ChromeSwitchPreference contextualSearchSwitch =
(ChromeSwitchPreference) findPreference(PREF_CONTEXTUAL_SEARCH_SWITCH);
@@ -44,8 +44,9 @@ public class ContextualSearchPreferenceFragment extends PreferenceFragmentCompat
ChromeSwitchPreference seeBetterResultsSwitch =
(ChromeSwitchPreference) findPreference(PREF_WAS_FULLY_ENABLED_SWITCH);
- boolean isContextualSearchEnabled = !ContextualSearchManager.isContextualSearchDisabled();
- boolean isContextualSearchEnabled = !ContextualSearchPolicy.isContextualSearchDisabled();
+ boolean isContextualSearchEnabled = false;
contextualSearchSwitch.setChecked(isContextualSearchEnabled);
+ contextualSearchSwitch.setEnabled(isContextualSearchEnabled);
contextualSearchSwitch.setOnPreferenceChangeListener((preference, newValue) -> {
ContextualSearchManager.setContextualSearchState((boolean) newValue);
ContextualSearchPolicy.setContextualSearchState((boolean) newValue);
--
2.17.1
2.25.1
From 377f4dfbd2b2df839a1bad3abeadbdeaa399fe2d Mon Sep 17 00:00:00 2001
From: Aayush Gupta <theimpulson@e.email>
Date: Thu, 18 Mar 2021 13:42:44 +0100
Subject: [PATCH] Browser: Modify default search engines
Signed-off-by: Aayush Gupta <theimpulson@e.email>
---
.../locale/locale_template_url_loader.cc | 35 ++-----------------
.../locale/locale_template_url_loader.h | 1 -
.../browser/locale/LocaleManagerDelegate.java | 1 -
.../locale/LocaleTemplateUrlLoader.java | 9 -----
.../search_engines/prepopulated_engines.json | 10 ++++++
.../search_engines/search_engine_type.h | 1 +
.../search_engines/search_engine_utils.cc | 12 +------
.../template_url_prepopulate_data.cc | 15 +++-----
8 files changed, 19 insertions(+), 65 deletions(-)
diff --git a/chrome/browser/android/locale/locale_template_url_loader.cc b/chrome/browser/android/locale/locale_template_url_loader.cc
index a9d8db3b69bd6..16298c4833ee2 100644
--- a/chrome/browser/android/locale/locale_template_url_loader.cc
+++ b/chrome/browser/android/locale/locale_template_url_loader.cc
@@ -64,19 +64,6 @@ jboolean LocaleTemplateUrlLoader::LoadTemplateUrls(JNIEnv* env) {
const TemplateURL* matching_url =
template_url_service_->GetTemplateURLForKeyword(data_url->keyword());
bool exists = matching_url != nullptr;
- if (!exists &&
- data_url->prepopulate_id == TemplateURLPrepopulateData::google.id) {
- auto existing_urls = template_url_service_->GetTemplateURLs();
-
- for (auto* existing_url : existing_urls) {
- if (existing_url->prepopulate_id() ==
- TemplateURLPrepopulateData::google.id) {
- matching_url = existing_url;
- exists = true;
- break;
- }
- }
- }
if (exists)
continue;
@@ -107,8 +94,7 @@ void LocaleTemplateUrlLoader::OverrideDefaultSearchProvider(JNIEnv* env) {
// If the user has changed their default search provider, no-op.
const TemplateURL* current_dsp =
template_url_service_->GetDefaultSearchProvider();
- if (!current_dsp ||
- current_dsp->prepopulate_id() != TemplateURLPrepopulateData::google.id) {
+ if (!current_dsp) {
return;
}
@@ -120,30 +106,13 @@ void LocaleTemplateUrlLoader::OverrideDefaultSearchProvider(JNIEnv* env) {
}
}
-void LocaleTemplateUrlLoader::SetGoogleAsDefaultSearch(JNIEnv* env) {
- // If the user has changed their default search provider, no-op.
- const TemplateURL* current_dsp =
- template_url_service_->GetDefaultSearchProvider();
- if (!current_dsp ||
- current_dsp->prepopulate_id() != GetDesignatedSearchEngineForChina()) {
- return;
- }
-
- TemplateURL* turl =
- FindURLByPrepopulateID(template_url_service_->GetTemplateURLs(),
- TemplateURLPrepopulateData::google.id);
- if (turl) {
- template_url_service_->SetUserSelectedDefaultSearchProvider(turl);
- }
-}
-
std::vector<std::unique_ptr<TemplateURLData>>
LocaleTemplateUrlLoader::GetLocalPrepopulatedEngines() {
return TemplateURLPrepopulateData::GetLocalPrepopulatedEngines(locale_);
}
int LocaleTemplateUrlLoader::GetDesignatedSearchEngineForChina() {
- return TemplateURLPrepopulateData::sogou.id;
+ return TemplateURLPrepopulateData::espot.id;
}
LocaleTemplateUrlLoader::~LocaleTemplateUrlLoader() {}
diff --git a/chrome/browser/android/locale/locale_template_url_loader.h b/chrome/browser/android/locale/locale_template_url_loader.h
index 5e5591cbf4a61..b662955807a2f 100644
--- a/chrome/browser/android/locale/locale_template_url_loader.h
+++ b/chrome/browser/android/locale/locale_template_url_loader.h
@@ -21,7 +21,6 @@ class LocaleTemplateUrlLoader {
jboolean LoadTemplateUrls(JNIEnv* env);
void RemoveTemplateUrls(JNIEnv* env);
void OverrideDefaultSearchProvider(JNIEnv* env);
- void SetGoogleAsDefaultSearch(JNIEnv* env);
virtual ~LocaleTemplateUrlLoader();
diff --git a/chrome/browser/locale/java/src/org/chromium/chrome/browser/locale/LocaleManagerDelegate.java b/chrome/browser/locale/java/src/org/chromium/chrome/browser/locale/LocaleManagerDelegate.java
index 8afdf8a188da6..91e38d859ded6 100644
--- a/chrome/browser/locale/java/src/org/chromium/chrome/browser/locale/LocaleManagerDelegate.java
+++ b/chrome/browser/locale/java/src/org/chromium/chrome/browser/locale/LocaleManagerDelegate.java
@@ -155,7 +155,6 @@ public class LocaleManagerDelegate {
*/
private void revertDefaultSearchEngineOverride() {
if (!isSearchEngineAutoSwitchEnabled() || isSpecialLocaleEnabled()) return;
- getLocaleTemplateUrlLoader().setGoogleAsDefaultSearch();
showSnackbar(ContextUtils.getApplicationContext().getString(R.string.using_google));
}
diff --git a/chrome/browser/locale/java/src/org/chromium/chrome/browser/locale/LocaleTemplateUrlLoader.java b/chrome/browser/locale/java/src/org/chromium/chrome/browser/locale/LocaleTemplateUrlLoader.java
index 85e8503b342da..5e40569d225fa 100644
--- a/chrome/browser/locale/java/src/org/chromium/chrome/browser/locale/LocaleTemplateUrlLoader.java
+++ b/chrome/browser/locale/java/src/org/chromium/chrome/browser/locale/LocaleTemplateUrlLoader.java
@@ -67,14 +67,6 @@ public class LocaleTemplateUrlLoader {
mNativeLocaleTemplateUrlLoader);
}
- /**
- * Sets the default search provider back to Google.
- */
- public void setGoogleAsDefaultSearch() {
- assert mNativeLocaleTemplateUrlLoader != 0;
- LocaleTemplateUrlLoaderJni.get().setGoogleAsDefaultSearch(mNativeLocaleTemplateUrlLoader);
- }
-
@NativeMethods
interface Natives {
long init(String localeId);
@@ -82,6 +74,5 @@ public class LocaleTemplateUrlLoader {
boolean loadTemplateUrls(long nativeLocaleTemplateUrlLoader);
void removeTemplateUrls(long nativeLocaleTemplateUrlLoader);
void overrideDefaultSearchProvider(long nativeLocaleTemplateUrlLoader);
- void setGoogleAsDefaultSearch(long nativeLocaleTemplateUrlLoader);
}
}
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json
index fc372523ff910..6d61f6ded662e 100644
--- a/components/search_engines/prepopulated_engines.json
+++ b/components/search_engines/prepopulated_engines.json
@@ -112,6 +112,16 @@
"id": 12
},
+ "espot": {
+ "name": "/e/ spot",
+ "keyword": "spot.ecloud.global",
+ "favicon_url": "https://spot.ecloud.global/favicon.ico",
+ "search_url": "https://spot.ecloud.global/?q={searchTerms}",
+ "suggest_url": "https://ac.duckduckgo.com/ac/?q={searchTerms}&type=list",
+ "type": "SEARCH_ENGINE_ESPOT",
+ "id": 11
+ },
+
"ecosia": {
"name": "Ecosia",
"keyword": "ecosia.org",
diff --git a/components/search_engines/search_engine_type.h b/components/search_engines/search_engine_type.h
index a0500e883f177..244b272ffe1a4 100644
--- a/components/search_engines/search_engine_type.h
+++ b/components/search_engines/search_engine_type.h
@@ -76,6 +76,7 @@ enum SearchEngineType {
SEARCH_ENGINE_PRIVACYWALL = 58,
SEARCH_ENGINE_ECOSIA = 59,
SEARCH_ENGINE_GOOGLE_EN,
+ SEARCH_ENGINE_ESPOT,
SEARCH_ENGINE_MAX // Bounding value needed for UMA histogram macro.
};
diff --git a/components/search_engines/search_engine_utils.cc b/components/search_engines/search_engine_utils.cc
index ecbd15614ef0a..20b6bc09e1029 100644
--- a/components/search_engines/search_engine_utils.cc
+++ b/components/search_engines/search_engine_utils.cc
@@ -27,17 +27,7 @@ bool SameDomain(const GURL& given_url, const GURL& prepopulated_url) {
SearchEngineType GetEngineType(const GURL& url) {
DCHECK(url.is_valid());
- // Check using TLD+1s, in order to more aggressively match search engine types
- // for data imported from other browsers.
- //
- // First special-case Google, because the prepopulate URL for it will not
- // convert to a GURL and thus won't have an origin. Instead see if the
- // incoming URL's host is "[*.]google.<TLD>".
- if (google_util::IsGoogleHostname(url.host(),
- google_util::DISALLOW_SUBDOMAIN))
- return TemplateURLPrepopulateData::google.type;
-
- // Now check the rest of the prepopulate data.
+ // Check the prepopulate data.
for (size_t i = 0; i < TemplateURLPrepopulateData::kAllEnginesLength; ++i) {
// First check the main search URL.
if (SameDomain(
diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc
index 17a446aaff46c..d68a3430ec7c4 100644
--- a/components/search_engines/template_url_prepopulate_data.cc
+++ b/components/search_engines/template_url_prepopulate_data.cc
@@ -29,9 +29,10 @@ namespace {
// Default (for countries with no better engine set)
const PrepopulatedEngine* const engines_default[] = {
- &googleen, &google,
- &bing,
- &yahoo,
+ &espot,
+ &qwant,
+ &duckduckgo,
+ &duckduckgo_light,
};
// Note, the below entries are sorted by country code, not the name in comment.
@@ -1403,13 +1404,7 @@ std::unique_ptr<TemplateURLData> GetPrepopulatedEngine(PrefService* prefs,
std::vector<std::unique_ptr<TemplateURLData>> GetLocalPrepopulatedEngines(
const std::string& locale) {
- int country_id = country_codes::CountryStringToCountryID(locale);
- if (country_id == country_codes::kCountryIDUnknown) {
- LOG(ERROR) << "Unknown country code specified: " << locale;
- return std::vector<std::unique_ptr<TemplateURLData>>();
- }
-
- return GetPrepopulationSetFromCountryID(country_id);
+ return std::vector<std::unique_ptr<TemplateURLData>>();
}
#endif
--
2.25.1
From dc58e5dfcc72d2ea3874d589cb6936bcf1e69ac1 Mon Sep 17 00:00:00 2001
From: Aayush Gupta <theimpulson@e.email>
Date: Fri, 26 Nov 2021 07:29:59 +0000
Subject: [PATCH] Browser: Point to our default popular sites
Signed-off-by: Aayush Gupta <theimpulson@e.email>
---
.../ntp_tiles/resources/foundation_e.json | 17 +++++++++++++++++
components/resources/ntp_tiles_resources.grdp | 2 +-
2 files changed, 18 insertions(+), 1 deletion(-)
create mode 100644 components/ntp_tiles/resources/foundation_e.json
diff --git a/components/ntp_tiles/resources/foundation_e.json b/components/ntp_tiles/resources/foundation_e.json
new file mode 100644