forked from bromite/bromite
-
Notifications
You must be signed in to change notification settings - Fork 249
Expand file tree
/
Copy pathDisable-all-promo-dialogs.patch
More file actions
90 lines (81 loc) · 5.2 KB
/
Disable-all-promo-dialogs.patch
File metadata and controls
90 lines (81 loc) · 5.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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 +-
.../chrome/browser/user_education/UserEducationHelper.java | 1 +
chrome/browser/user_education/user_education_service_factory.cc | 1 +
.../common/feature_promo/feature_promo_registry.cc | 2 ++
.../common/feature_promo/impl/feature_promo_queue.cc | 1 +
6 files changed, 7 insertions(+), 1 deletion(-)
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
@@ -2065,6 +2065,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
@@ -191,7 +191,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/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
@@ -19,6 +19,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,
@@ -34,6 +35,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_queue.cc b/components/user_education/common/feature_promo/impl/feature_promo_queue.cc
--- a/components/user_education/common/feature_promo/impl/feature_promo_queue.cc
+++ b/components/user_education/common/feature_promo/impl/feature_promo_queue.cc
@@ -76,6 +76,7 @@ FeaturePromoResult FeaturePromoQueue::CanShow(
const FeaturePromoSpecification& spec,
const FeaturePromoParams& promo_params,
const UserEducationContextPtr& context) const {
+ if ((true)) return user_education::FeaturePromoResult::kBlockedByUi;
auto required = required_preconditions_provider_->GetPreconditions(
spec, promo_params, context);
UnownedTypedDataCollection data;
--