Merge pull request #8 from import/chromium-browser-stable:rosa2016.1

Backports and update
This commit is contained in:
djam 2022-06-06 22:06:51 +00:00
commit 9b87a8d917
5 changed files with 205 additions and 14 deletions

View file

@ -1,4 +1,4 @@
From 2021de782f99d2276005d57b151f30759ab2c7f3 Mon Sep 17 00:00:00 2001
From 04d1d9b5e32defe38d9f55c13a70c6179aa6e13b Mon Sep 17 00:00:00 2001
From: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
Date: Thu, 26 May 2022 20:47:28 +0300
Subject: [PATCH] Functional new tab page with non-Google search engines
@ -6,9 +6,25 @@ Subject: [PATCH] Functional new tab page with non-Google search engines
If e.g Yandex is chosen as a search engine, chrome://new-tab-page is replaced with chrome://new-tab-page-third-party
which does not allow to add new items. Use chrome://new-tab-page.
---
chrome/browser/search/search.cc | 4 +---
chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
index 5b7e75599e..8302ba016e 100644
--- a/chrome/browser/search/search.cc
+++ b/chrome/browser/search/search.cc
@@ -179,9 +179,7 @@ struct NewTabURLDetails {
#if BUILDFLAG(IS_ANDROID)
const GURL local_url;
#else
- const GURL local_url(DefaultSearchProviderIsGoogle(profile)
- ? chrome::kChromeUINewTabPageURL
- : chrome::kChromeUINewTabPageThirdPartyURL);
+ const GURL local_url(chrome::kChromeUINewTabPageURL);
#endif
if (ShouldShowLocalNewTab(profile))
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
index d29dc6e3fb..8173d0fbbe 100644
--- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@ -23,5 +39,5 @@ index d29dc6e3fb..8173d0fbbe 100644
if (base::FeatureList::IsEnabled(features::kWebUIFeedback)) {
if (url.host_piece() == chrome::kChromeUIFeedbackHost)
--
2.33.2
2.35.2

View file

@ -1,4 +1,4 @@
From b6bcaa2f6f16d65e0fffaefc6de2e94ad5780f76 Mon Sep 17 00:00:00 2001
From 6681497319c9b7f8d5d27912284ca228408e3d9a Mon Sep 17 00:00:00 2001
From: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
Date: Sun, 29 May 2022 22:31:21 +0300
Subject: [PATCH] Yandex as default search engine
@ -8,15 +8,19 @@ Quality of google.ru search results seems to be degradating a bit.
I understand that Google develops Chromium, and so it would be fair if they got some money from adverstisment,
but, firstly, they have themselves stopped all ads in Russia,
secondly, influnce of Google is a bad thing because they take part in the information war.
secondly, influnce of Google is a bad thing because they have to take part in the information war.
The patch "Functional new tab page with non-Google search engines" makes chrome://new-tab-page work.
Yandex's URL which is patched here does not allow to add new items in to the quick access list
and shows advertisment of the proprietary Yandex browser. I do not want users to install it.
A simpler solution would be changing chromium-default-config.json like
http://git.osmesh.ru/MOS/mos-panel-desktop/src/commit/0f02deea4f7da5ee186433cc71a7ba0193a8f52d/kometa-std-desktop-1.1/chromium.json
but it would make Yandex.ru be the default even for not Russian users.
---
components/search_engines/prepopulated_engines.json | 9 +++++----
.../search_engines/template_url_prepopulate_data.cc | 11 ++++++-----
2 files changed, 11 insertions(+), 9 deletions(-)
.../search_engines/prepopulated_engines.json | 9 ++++---
.../template_url_prepopulate_data.cc | 27 ++++++++++---------
2 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json
index 13572d4355..cc449a1ccb 100644
@ -67,7 +71,7 @@ index 13572d4355..cc449a1ccb 100644
"id": 15
},
diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc
index e38343c221..8efd6fd2c5 100644
index e38343c221..4759cd6711 100644
--- a/components/search_engines/template_url_prepopulate_data.cc
+++ b/components/search_engines/template_url_prepopulate_data.cc
@@ -28,6 +28,7 @@ namespace {
@ -130,6 +134,29 @@ index e38343c221..8efd6fd2c5 100644
&yahoo_tr,
&bing,
&duckduckgo,
@@ -1381,13 +1382,15 @@ std::vector<std::unique_ptr<TemplateURLData>> GetPrepopulatedEngines(
t_urls = GetPrepopulationSetFromCountryID(
country_codes::GetCountryIDFromPrefs(prefs));
}
- if (default_search_provider_index) {
- const auto itr = std::find_if(
- t_urls.begin(), t_urls.end(),
- [](const auto& t_url) { return t_url->prepopulate_id == google.id; });
- *default_search_provider_index =
- itr == t_urls.end() ? 0 : std::distance(t_urls.begin(), itr);
- }
+ /* Making yandex_ru be the first in "const PrepopulatedEngine* const engines_RU[]"
+ * makes it be the first item in chrome://settings/search,
+ * but Google is still chosen by default.
+ * Removed code calculated the distance between 0 and Google's position
+ * and assign that position to default_search_provider_index,
+ * so that Google still was the default search engine.
+ * Instead, just use the first search engine as the default one.
+ */
+ if (default_search_provider_index) *default_search_provider_index = 0;
return t_urls;
}
--
2.35.2

View file

@ -0,0 +1,105 @@
From 91050333ece16bfa526d6f44bf2324f71a794220 Mon Sep 17 00:00:00 2001
From: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
Date: Sun, 5 Jun 2022 16:52:13 +0300
Subject: [PATCH] Hide sync with Google
Syncing with Google does not work noawadays because Google decided
to block it work other API keys than the ons used in Google Chrome.
Click "Turn on sync" does not turn it on.
Hiding:
* button in chrome://settings
* button when clicking on the user avatar on the right from the address bar
* button on the welcome page which is not shown by default in ROSA (?)
As code is just being commented out in chrome://settings, advanced users
probably can uncomemnt it in developer tools without recompiling Chromium
if they want to use their own API keys.
---
.../settings/people_page/sync_account_control.html | 2 ++
chrome/browser/resources/welcome/signin_view.html | 2 ++
chrome/browser/ui/views/profiles/profile_menu_view.cc | 9 ++++-----
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/chrome/browser/resources/settings/people_page/sync_account_control.html b/chrome/browser/resources/settings/people_page/sync_account_control.html
index 70b3128642..b91ea8675a 100644
--- a/chrome/browser/resources/settings/people_page/sync_account_control.html
+++ b/chrome/browser/resources/settings/people_page/sync_account_control.html
@@ -117,6 +117,7 @@
<!-- TODO(jamescook): Show the promo on Chrome OS if the user is signed-in
but has sync disabled. -->
<div id="banner" hidden="[[syncStatus.signedIn]]" part="banner"></div>
+ <!--
<div class="cr-row first"
id="promo-header" hidden="[[syncStatus.signedIn]]">
<div class="flex cr-padded-text">
@@ -135,6 +136,7 @@
$i18n{peopleSignIn}
</cr-button>
</div>
+ -->
<template is="dom-if" if="[[shouldShowAvatarRow_]]">
<div class="cr-row first two-line" id="avatar-row">
<div id="avatar-container">
diff --git a/chrome/browser/resources/welcome/signin_view.html b/chrome/browser/resources/welcome/signin_view.html
index b8ef23a4dc..b127c5b48a 100644
--- a/chrome/browser/resources/welcome/signin_view.html
+++ b/chrome/browser/resources/welcome/signin_view.html
@@ -10,6 +10,7 @@
outline: none;
}
</style>
+<!--
<div id="container">
<onboarding-background id="background" class="fade-in">
</onboarding-background>
@@ -24,3 +25,4 @@
</button>
</div>
</div>
+-->
diff --git a/chrome/browser/ui/views/profiles/profile_menu_view.cc b/chrome/browser/ui/views/profiles/profile_menu_view.cc
index 1d9b51a8ec..0c597d2e67 100644
--- a/chrome/browser/ui/views/profiles/profile_menu_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_menu_view.cc
@@ -180,9 +180,7 @@ gfx::ImageSkia ProfileMenuView::GetSyncIcon() const {
if (profile->IsOffTheRecord() || profile->IsGuestSession())
return gfx::ImageSkia();
- bool is_sync_feature_enabled =
- IdentityManagerFactory::GetForProfile(profile)->HasPrimaryAccount(
- signin::ConsentLevel::kSync);
+ bool is_sync_feature_enabled = false;
if (!is_sync_feature_enabled) {
// This is done regardless of GetAvatarSyncErrorType() because the icon
// should reflect that sync-the-feature is off. The error will still be
@@ -517,8 +515,7 @@ void ProfileMenuView::BuildSyncInfo() {
signin::IdentityManager* identity_manager =
IdentityManagerFactory::GetForProfile(profile);
- bool is_sync_feature_enabled =
- identity_manager->HasPrimaryAccount(signin::ConsentLevel::kSync);
+ bool is_sync_feature_enabled = false;
// First, check for sync errors. They may exist even if sync-the-feature is
// disabled and only sync-the-transport is running.
const absl::optional<AvatarSyncErrorType> error =
@@ -546,6 +543,7 @@ void ProfileMenuView::BuildSyncInfo() {
return;
}
+#if 0
// If there's no error and sync-the-feature is disabled, show a sync promo.
// For a signed-in user, the promo just opens the "turn on sync" dialog.
// For a signed-out user, it prompts for sign-in first.
@@ -573,6 +571,7 @@ void ProfileMenuView::BuildSyncInfo() {
/*show_sync_badge=*/false);
#endif
}
+#endif //if 0
}
void ProfileMenuView::BuildFeatureButtons() {
--
2.35.2

View file

@ -0,0 +1,41 @@
From f5308bcc20c6364e0642ce5afd320fc6f009fc41 Mon Sep 17 00:00:00 2001
From: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
Date: Mon, 6 Jun 2022 11:54:20 +0300
Subject: [PATCH] Adjust sizes in new tab page for Russian text
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Avoid cutting "Добавить ярлык" ("Add shortcut") to "Добавить яр...".
Keep enough distance between items after adjusting that size.
Note: it is a hack. Text size depends on font and size.
---
.../resources/cr_components/most_visited/most_visited.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui/webui/resources/cr_components/most_visited/most_visited.html b/ui/webui/resources/cr_components/most_visited/most_visited.html
index fa00ea2729..fc06516c2e 100644
--- a/ui/webui/resources/cr_components/most_visited/most_visited.html
+++ b/ui/webui/resources/cr_components/most_visited/most_visited.html
@@ -5,7 +5,7 @@
--icon-size: 48px;
--tile-background-color: rgb(229, 231, 232);
--tile-hover-color: rgba(var(--google-grey-900-rgb), .1);
- --tile-size: 112px;
+ --tile-size: 120px;
--title-height: 32px;
}
@@ -135,7 +135,7 @@
line-height: calc(var(--title-height) / 2);
margin-top: 6px;
padding: 2px 8px;
- width: 88px;
+ width: 110px;
}
:host([use-title-pill_]) .tile-title {
--
2.35.2

View file

@ -81,7 +81,7 @@
Summary: A fast web browser based on the Blink engine
Name: chromium-browser-stable
Version: 102.0.5005.61
Release: 2
Release: 3
License: BSD, LGPL
Group: Networking/WWW
Url: https://www.chromium.org/Home
@ -126,13 +126,15 @@ Patch647: ALT-allow-to-override-clang-through-env-variables.patch
# XXX This patch is not enough to fully fix debuginfo and debugsource subpackages
Patch648: fix-debugsource.patch
# chrome://new-tab-page-third-party -> chrome://new-tab-page
Patch650: 0001-Functional-new-tab-page-with-non-Google-search-engin.patch
Patch651: 0002-Yandex-as-default-search-engine.patch
Patch652: 0003-Remove-voice-search-button.patch
Patch651: 0001-Functional-new-tab-page-with-non-Google-search-engin.patch
Patch652: 0002-Yandex-as-default-search-engine.patch
Patch653: 0003-Remove-voice-search-button.patch
Patch654: 0004-Hide-sync-with-Google.patch
Patch655: 0005-Adjust-sizes-in-new-tab-page-for-Russian-text.patch
# Block odd interaction with Google servers, probably including loading promo Google logos
# (e.g. an LGBT-colored one, https://clck.ru/niFdJ)
# https://github.com/Eloston/ungoogled-chromium/blob/master/patches/core/ungoogled-chromium/block-requests.patch
Patch653: block-requests.patch
Patch656: block-requests.patch
BuildRequires: bison
BuildRequires: llvm15