Files
cromite/build/patches/Disable-all-promo-dialogs.patch
T
2026-01-15 12:58:05 +01:00

136 lines
8.2 KiB
Diff

From: uazo <uazo@users.noreply.github.com>
Date: Tue, 12 Jun 2018 15:09:26 +0200
Subject: Disable all promo dialogs
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
.../chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java | 1 +
chrome/browser/ui/browser_ui_prefs.cc | 2 +-
.../views/profiles/profile_picker_feature_promo_controller.cc | 1 +
.../user_education/impl/browser_feature_promo_controller_20.cc | 1 +
.../chrome/browser/user_education/UserEducationHelper.java | 1 +
.../browser/user_education/user_education_service_factory.cc | 1 +
.../common/feature_promo/feature_promo_registry.cc | 2 ++
.../common/feature_promo/impl/feature_promo_controller_20.cc | 1 +
.../common/feature_promo/impl/feature_promo_controller_25.cc | 3 ++-
9 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
@@ -1858,6 +1858,7 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator {
}
private boolean maybeShowPromo(Profile profile) {
+ if ((true)) return false;
// NOTE: Only one promo can be shown in one run to avoid nagging users too much.
// The PWA Restore promotion runs when we've detected that a user has switched to a new
diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc
--- a/chrome/browser/ui/browser_ui_prefs.cc
+++ b/chrome/browser/ui/browser_ui_prefs.cc
@@ -187,7 +187,7 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(prefs::kEnterpriseHardwarePlatformAPIEnabled,
false);
- registry->RegisterBooleanPref(prefs::kUserFeedbackAllowed, true);
+ registry->RegisterBooleanPref(prefs::kUserFeedbackAllowed, false);
registry->RegisterBooleanPref(
prefs::kExternalProtocolDialogShowAlwaysOpenCheckbox, true);
registry->RegisterBooleanPref(prefs::kScreenCaptureAllowed, true);
diff --git a/chrome/browser/ui/views/profiles/profile_picker_feature_promo_controller.cc b/chrome/browser/ui/views/profiles/profile_picker_feature_promo_controller.cc
--- a/chrome/browser/ui/views/profiles/profile_picker_feature_promo_controller.cc
+++ b/chrome/browser/ui/views/profiles/profile_picker_feature_promo_controller.cc
@@ -36,6 +36,7 @@ user_education::FeaturePromoResult
ProfilePickerFeaturePromoController::CanShowPromoForElement(
ui::TrackedElement* anchor_element,
const user_education::UserEducationContextPtr&) const {
+ if ((true)) return user_education::FeaturePromoResult::kBlockedByUi;
return ProfilePicker::IsOpen()
? user_education::FeaturePromoResult::Success()
: user_education::FeaturePromoResult::kBlockedByUi;
diff --git a/chrome/browser/ui/views/user_education/impl/browser_feature_promo_controller_20.cc b/chrome/browser/ui/views/user_education/impl/browser_feature_promo_controller_20.cc
--- a/chrome/browser/ui/views/user_education/impl/browser_feature_promo_controller_20.cc
+++ b/chrome/browser/ui/views/user_education/impl/browser_feature_promo_controller_20.cc
@@ -47,6 +47,7 @@ user_education::FeaturePromoResult
BrowserFeaturePromoController20::CanShowPromoForElement(
ui::TrackedElement* anchor_element,
const user_education::UserEducationContextPtr& context) const {
+ if ((true)) return user_education::FeaturePromoResult::kBlockedByUi;
auto* const browser_context = context->AsA<BrowserUserEducationContext>();
CHECK(browser_context && browser_context->IsValid());
auto* const browser_view = &browser_context->GetBrowserView();
diff --git a/chrome/browser/user_education/java/src/org/chromium/chrome/browser/user_education/UserEducationHelper.java b/chrome/browser/user_education/java/src/org/chromium/chrome/browser/user_education/UserEducationHelper.java
--- a/chrome/browser/user_education/java/src/org/chromium/chrome/browser/user_education/UserEducationHelper.java
+++ b/chrome/browser/user_education/java/src/org/chromium/chrome/browser/user_education/UserEducationHelper.java
@@ -119,6 +119,7 @@ public class UserEducationHelper {
}
private void showIph(Tracker tracker, IphCommand iphCommand) {
+ if ((true)) return;
// Activity was destroyed; don't show IPH.
View anchorView = iphCommand.anchorView;
if (mActivity == null
diff --git a/chrome/browser/user_education/user_education_service_factory.cc b/chrome/browser/user_education/user_education_service_factory.cc
--- a/chrome/browser/user_education/user_education_service_factory.cc
+++ b/chrome/browser/user_education/user_education_service_factory.cc
@@ -112,6 +112,7 @@ UserEducationServiceFactory::BuildServiceInstanceForBrowserContextImpl(
// static
bool UserEducationServiceFactory::ProfileAllowsUserEducation(Profile* profile) {
+ if ((true)) return false;
#if BUILDFLAG(CHROME_FOR_TESTING)
// IPH is always disabled in Chrome for Testing.
return false;
diff --git a/components/user_education/common/feature_promo/feature_promo_registry.cc b/components/user_education/common/feature_promo/feature_promo_registry.cc
--- a/components/user_education/common/feature_promo/feature_promo_registry.cc
+++ b/components/user_education/common/feature_promo/feature_promo_registry.cc
@@ -20,6 +20,7 @@ FeaturePromoRegistry& FeaturePromoRegistry::operator=(
FeaturePromoRegistry::~FeaturePromoRegistry() = default;
void FeaturePromoRegistry::RegisterFeature(FeaturePromoSpecification spec) {
+ if ((true)) return;
const base::Feature* const iph_feature = spec.feature();
CHECK(iph_feature);
CHECK_NE(FeaturePromoSpecification::PromoType::kUnspecified,
@@ -35,6 +36,7 @@ NewBadgeRegistry& NewBadgeRegistry::operator=(
NewBadgeRegistry::~NewBadgeRegistry() = default;
void NewBadgeRegistry::RegisterFeature(NewBadgeSpecification spec) {
+ if ((true)) return;
const base::Feature* const iph_feature = spec.feature;
CHECK(iph_feature);
FeatureRegistry<NewBadgeSpecification>::RegisterFeature(*iph_feature,
diff --git a/components/user_education/common/feature_promo/impl/feature_promo_controller_20.cc b/components/user_education/common/feature_promo/impl/feature_promo_controller_20.cc
--- a/components/user_education/common/feature_promo/impl/feature_promo_controller_20.cc
+++ b/components/user_education/common/feature_promo/impl/feature_promo_controller_20.cc
@@ -106,6 +106,7 @@ FeaturePromoResult FeaturePromoController20::CanShowPromoCommon(
const UserEducationContextPtr& context,
ShowSource source,
CanShowPromoOutputs* outputs) const {
+ if ((true)) return FeaturePromoResult::kBlockedByContext;
const bool for_demo = source == ShowSource::kDemo;
// Ensure that this promo isn't already queued for startup.
diff --git a/components/user_education/common/feature_promo/impl/feature_promo_controller_25.cc b/components/user_education/common/feature_promo/impl/feature_promo_controller_25.cc
--- a/components/user_education/common/feature_promo/impl/feature_promo_controller_25.cc
+++ b/components/user_education/common/feature_promo/impl/feature_promo_controller_25.cc
@@ -189,6 +189,7 @@ FeaturePromoController25::~FeaturePromoController25() {
FeaturePromoResult FeaturePromoController25::CanShowPromo(
const FeaturePromoParams& params,
const UserEducationContextPtr& context) const {
+ if ((true)) return FeaturePromoResult::kBlockedByContext;
auto* const spec = registry()->GetParamsForFeature(*params.feature);
if (!spec) {
return FeaturePromoResult::kError;
@@ -211,7 +212,7 @@ void FeaturePromoController25::MaybeShowStartupPromo(
void FeaturePromoController25::MaybeShowPromo(FeaturePromoParams params,
UserEducationContextPtr context) {
auto* const spec = registry()->GetParamsForFeature(*params.feature);
- if (!spec) {
+ if (((true)) || !spec) {
PostShowPromoResult(std::move(params.show_promo_result_callback),
FeaturePromoResult::kError);
return;
--