Add browser policy: Disables additional possibilities for unintended activation of Commerce API

This commit is contained in:
Carmelo Messina
2025-01-22 13:37:54 +01:00
parent b0ddb6eca8
commit bd283f6acf
+17 -3
View File
@@ -19,7 +19,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
.../ui/webui/policy/policy_ui_handler.cc | 104 ++++++++++++-
.../ui/webui/policy/policy_ui_handler.h | 2 +
.../strings/android/browser_ui_strings.grd | 2 +-
.../commerce/core/commerce_feature_list.cc | 65 ++-------
.../commerce/core/commerce_feature_list.cc | 69 ++-------
.../core/browser/browser_policy_connector.cc | 3 +
.../common/command_line_policy_provider.cc | 3 +
.../core/common/policy_loader_command_line.cc | 137 ++++++++++++++++--
@@ -36,7 +36,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
.../gaia_cookie_manager_service.cc | 4 +
google_apis/gaia/gaia_auth_fetcher.cc | 1 +
net/socket/ssl_client_socket_impl.cc | 3 +
32 files changed, 324 insertions(+), 151 deletions(-)
32 files changed, 326 insertions(+), 153 deletions(-)
diff --git a/base/win/win_util.cc b/base/win/win_util.cc
--- a/base/win/win_util.cc
@@ -600,7 +600,13 @@ diff --git a/components/commerce/core/commerce_feature_list.cc b/components/comm
// Params for Discount Consent V2 in the NTP Cart module.
const char kNtpChromeCartModuleDiscountConsentNtpVariationParam[] =
"discount-consent-ntp-variation";
@@ -527,11 +487,11 @@ bool IsPartnerMerchant(const GURL& url) {
@@ -522,16 +482,15 @@ const base::FeatureParam<bool> kRevertIconOnFailure{
&kShoppingList, kRevertIconOnFailureParam, false};
bool IsPartnerMerchant(const GURL& url) {
- return commerce::IsCouponDiscountPartnerMerchant(url) ||
- IsRuleDiscountPartnerMerchant(url);
+ return false;
}
bool IsRuleDiscountPartnerMerchant(const GURL& url) {
@@ -614,6 +620,14 @@ diff --git a/components/commerce/core/commerce_feature_list.cc b/components/comm
}
bool IsCartDiscountFeatureEnabled() {
@@ -589,6 +548,7 @@ bool IsRegionLockedFeatureEnabled(const base::Feature& feature,
const base::Feature& feature_region_launched,
const std::string& country_code,
const std::string& locale) {
+ if ((true)) return false;
bool flag_enabled = base::FeatureList::IsEnabled(feature);
bool region_launched =
base::FeatureList::IsEnabled(feature_region_launched) &&
@@ -611,6 +571,7 @@ base::TimeDelta GetDiscountFetchDelay() {
}