From 85a8dd71ac012bddf3e4495275f784907f296af8 Mon Sep 17 00:00:00 2001 From: mkarolin Date: Tue, 16 Aug 2022 12:13:46 -0400 Subject: [PATCH] Disables Chromium features flagged by security/privacy teams. --- app/brave_main_delegate_browsertest.cc | 9 ++++++++- chromium_src/chrome/browser/browser_features.cc | 3 +++ .../prefetch_proxy/prefetch_proxy_features.cc | 16 ++++++++++++++++ .../core/common/autofill_payments_features.cc | 1 + .../private_aggregation_features.cc | 16 ++++++++++++++++ .../third_party/blink/common/features.cc | 1 + 6 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 chromium_src/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_features.cc create mode 100644 chromium_src/content/browser/private_aggregation/private_aggregation_features.cc diff --git a/app/brave_main_delegate_browsertest.cc b/app/brave_main_delegate_browsertest.cc index b32650170f3..c7b335788da 100644 --- a/app/brave_main_delegate_browsertest.cc +++ b/app/brave_main_delegate_browsertest.cc @@ -7,6 +7,7 @@ #include "build/build_config.h" #include "chrome/browser/domain_reliability/service_factory.h" #include "chrome/browser/enterprise/connectors/analysis/content_analysis_features.h" +#include "chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_features.h" #include "chrome/common/chrome_features.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/base/chrome_test_utils.h" @@ -82,12 +83,14 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) { const base::Feature* disabled_features[] = { &autofill::features::kAutofillEnableAccountWalletStorage, &autofill::features::kAutofillEnableOfferNotificationForPromoCodes, + &autofill::features::kAutofillEnableRemadeDownstreamMetrics, &autofill::features::kAutofillSaveCardUiExperiment, &autofill::features::kAutofillServerCommunication, &autofill::features::kAutofillUpstreamAllowAdditionalEmailDomains, &blink::features::kAdInterestGroupAPI, - &blink::features::kBrowsingTopics, &blink::features::kAllowURNsInIframes, + &blink::features::kBrowsingTopics, + &blink::features::kClientHintsMetaEquivDelegateCH, &blink::features::kComputePressure, &blink::features::kConversionMeasurement, &blink::features::kCssSelectorFragmentAnchor, @@ -107,6 +110,9 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) { &commerce::kShoppingPDPMetrics, &commerce::kRetailCoupons, &enterprise_connectors::kLocalContentAnalysisEnabled, +#if BUILDFLAG(IS_WIN) + &features::kAppBoundEncryptionMetrics, +#endif #if !BUILDFLAG(IS_ANDROID) &features::kCopyLinkToText, #endif @@ -115,6 +121,7 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) { &features::kFedCm, &features::kFirstPartySets, &features::kIdleDetection, + &features::kIsolatePrerenders, &features::kNavigationRequestPreconnect, &features::kNotificationTriggers, &features::kOmniboxTriggerForNoStatePrefetch, diff --git a/chromium_src/chrome/browser/browser_features.cc b/chromium_src/chrome/browser/browser_features.cc index 113b926f463..70a5d241107 100644 --- a/chromium_src/chrome/browser/browser_features.cc +++ b/chromium_src/chrome/browser/browser_features.cc @@ -10,6 +10,9 @@ namespace features { OVERRIDE_FEATURE_DEFAULT_STATES({{ +#if BUILDFLAG(IS_WIN) + {kAppBoundEncryptionMetrics, base::FEATURE_DISABLED_BY_DEFAULT}, +#endif #if !BUILDFLAG(IS_ANDROID) {kCopyLinkToText, base::FEATURE_DISABLED_BY_DEFAULT}, #endif diff --git a/chromium_src/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_features.cc b/chromium_src/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_features.cc new file mode 100644 index 00000000000..4c356023396 --- /dev/null +++ b/chromium_src/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_features.cc @@ -0,0 +1,16 @@ +/* Copyright (c) 2022 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#include "src/chrome/browser/prefetch/prefetch_proxy/prefetch_proxy_features.cc" + +#include "base/feature_override.h" + +namespace features { + +OVERRIDE_FEATURE_DEFAULT_STATES({{ + {kIsolatePrerenders, base::FEATURE_DISABLED_BY_DEFAULT}, +}}); + +} // namespace features diff --git a/chromium_src/components/autofill/core/common/autofill_payments_features.cc b/chromium_src/components/autofill/core/common/autofill_payments_features.cc index e82d6fd5fc8..f0d368c119b 100644 --- a/chromium_src/components/autofill/core/common/autofill_payments_features.cc +++ b/chromium_src/components/autofill/core/common/autofill_payments_features.cc @@ -13,6 +13,7 @@ namespace features { OVERRIDE_FEATURE_DEFAULT_STATES({{ {kAutofillEnableOfferNotificationForPromoCodes, base::FEATURE_DISABLED_BY_DEFAULT}, + {kAutofillEnableRemadeDownstreamMetrics, base::FEATURE_DISABLED_BY_DEFAULT}, {kAutofillSaveCardUiExperiment, base::FEATURE_DISABLED_BY_DEFAULT}, {kAutofillUpstreamAllowAdditionalEmailDomains, base::FEATURE_DISABLED_BY_DEFAULT}, diff --git a/chromium_src/content/browser/private_aggregation/private_aggregation_features.cc b/chromium_src/content/browser/private_aggregation/private_aggregation_features.cc new file mode 100644 index 00000000000..1dacd0e1fb2 --- /dev/null +++ b/chromium_src/content/browser/private_aggregation/private_aggregation_features.cc @@ -0,0 +1,16 @@ +/* Copyright (c) 2022 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ + +#include "src/content/browser/private_aggregation/private_aggregation_features.cc" + +#include "base/feature_override.h" + +namespace content { + +OVERRIDE_FEATURE_DEFAULT_STATES({{ + {kPrivateAggregationApi, base::FEATURE_DISABLED_BY_DEFAULT}, +}}); + +} // namespace content diff --git a/chromium_src/third_party/blink/common/features.cc b/chromium_src/third_party/blink/common/features.cc index b8540e7864d..ff4cc263904 100644 --- a/chromium_src/third_party/blink/common/features.cc +++ b/chromium_src/third_party/blink/common/features.cc @@ -19,6 +19,7 @@ OVERRIDE_FEATURE_DEFAULT_STATES({{ {kAdInterestGroupAPI, base::FEATURE_DISABLED_BY_DEFAULT}, {kAllowURNsInIframes, base::FEATURE_DISABLED_BY_DEFAULT}, {kBrowsingTopics, base::FEATURE_DISABLED_BY_DEFAULT}, + {kClientHintsMetaEquivDelegateCH, base::FEATURE_DISABLED_BY_DEFAULT}, {kComputePressure, base::FEATURE_DISABLED_BY_DEFAULT}, {kConversionMeasurement, base::FEATURE_DISABLED_BY_DEFAULT}, {kCssSelectorFragmentAnchor, base::FEATURE_DISABLED_BY_DEFAULT},