Files
cromite/build/patches/Disable-all-promo-dialogs.patch
T

91 lines
5.4 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 +-
.../ui/views/user_education/browser_feature_promo_controller.cc | 1 +
.../chrome/browser/user_education/UserEducationHelper.java | 1 +
components/user_education/common/feature_promo_controller.cc | 1 +
components/user_education/common/feature_promo_registry.cc | 1 +
.../browser/ui/ui_features_cc/Disable-all-promo-dialogs.inc | 1 +
7 files changed, 7 insertions(+), 1 deletion(-)
create mode 100755 cromite_flags/chrome/browser/ui/ui_features_cc/Disable-all-promo-dialogs.inc
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
@@ -1310,6 +1310,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
@@ -148,7 +148,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/user_education/browser_feature_promo_controller.cc b/chrome/browser/ui/views/user_education/browser_feature_promo_controller.cc
--- a/chrome/browser/ui/views/user_education/browser_feature_promo_controller.cc
+++ b/chrome/browser/ui/views/user_education/browser_feature_promo_controller.cc
@@ -78,6 +78,7 @@ ui::ElementContext BrowserFeaturePromoController::GetAnchorContext() const {
bool BrowserFeaturePromoController::CanShowPromoForElement(
ui::TrackedElement* anchor_element) const {
+ if ((true)) return false;
// Trying to show an IPH while the browser is closing can cause problems;
// see crbug.com/346461762 for an example.
if (browser_view_->browser()->IsBrowserClosing()) {
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
@@ -126,6 +126,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/components/user_education/common/feature_promo_controller.cc b/components/user_education/common/feature_promo_controller.cc
--- a/components/user_education/common/feature_promo_controller.cc
+++ b/components/user_education/common/feature_promo_controller.cc
@@ -669,6 +669,7 @@ FeaturePromoResult FeaturePromoControllerCommon::CanShowPromoCommon(
const FeaturePromoSpecification** display_spec_out,
std::unique_ptr<FeaturePromoLifecycle>* lifecycle_out,
ui::TrackedElement** anchor_element_out) 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_registry.cc b/components/user_education/common/feature_promo_registry.cc
--- a/components/user_education/common/feature_promo_registry.cc
+++ b/components/user_education/common/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,
diff --git a/cromite_flags/chrome/browser/ui/ui_features_cc/Disable-all-promo-dialogs.inc b/cromite_flags/chrome/browser/ui/ui_features_cc/Disable-all-promo-dialogs.inc
new file mode 100755
--- /dev/null
+++ b/cromite_flags/chrome/browser/ui/ui_features_cc/Disable-all-promo-dialogs.inc
@@ -0,0 +1 @@
+SET_CROMITE_FEATURE_DISABLED(kChromeLabs);
--