chromium-browser-stable-test/0004-Hide-sync-with-Google.patch
Mikhail Novosyolov 0f0f8b4ee4 Fix patch
2023-10-17 19:10:08 +03:00

106 lines
4 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(-)
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 3e54b152a5979..ff41b31cb47f5 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 9311059b41ead..0f697ffb44310 100644
--- 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>
+-->
diff --git a/chrome/browser/ui/views/profiles/profile_menu_view.cc b/chrome/browser/ui/views/profiles/profile_menu_view.cc
index 047e22de8fc4d..430f20a92b1b4 100644
--- a/chrome/browser/ui/views/profiles/profile_menu_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_menu_view.cc
@@ -171,9 +171,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
@@ -568,8 +566,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 absl::optional<AvatarSyncErrorType> error =
@@ -597,6 +594,7 @@
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.
@@ -624,6 +622,7 @@
/*show_sync_badge=*/false);
#endif
}
+#endif //if 0
}
void ProfileMenuView::BuildFeatureButtons() {
--
2.40.1