chromium-browser-stable-test/0004-Hide-sync-with-Google.patch
2024-04-19 09:20:02 +00:00

97 lines
3.7 KiB
Diff

From 1682820745c024b75643d03efdeb295a2b46e94e 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 4/5] 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(-)
--- a/chrome/browser/resources/settings/people_page/sync_account_control.html
+++ b/chrome/browser/resources/settings/people_page/sync_account_control.html
@@ -118,6 +118,7 @@
but has sync disabled. -->
<div id="banner" hidden="[[shouldHideBanner_(syncStatus.signedIn)]]"
part="banner"></div>
+ <!--
<div class="cr-row first"
id="promo-header" hidden="[[shouldHideBanner_(syncStatus.signedIn)]]">
<div class="flex cr-padded-text">
@@ -136,6 +137,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">
--- a/chrome/browser/resources/welcome/signin_view.html
+++ b/chrome/browser/resources/welcome/signin_view.html
@@ -9,6 +9,7 @@
outline: none;
}
</style>
+<!--
<div id="container">
<onboarding-background id="background" class="fade-in">
</onboarding-background>
@@ -25,3 +26,4 @@
</button>
</div>
</div>
+-->
--- a/chrome/browser/ui/views/profiles/profile_menu_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_menu_view.cc
@@ -186,9 +186,7 @@
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
@@ -652,8 +650,7 @@
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 std::optional<AvatarSyncErrorType> error =
@@ -680,7 +677,7 @@
base::Unretained(this)));
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 web-only signed-in user in the UNO model, the promo signs the user on
@@ -744,6 +741,7 @@
base::Unretained(this), account_info, button_type),
show_sync_badge,
show_account_card ? account_info_for_promos : AccountInfo());
+#endif //if 0
}
void ProfileMenuView::BuildFeatureButtons() {