Merge pull request #16121 from brave/maxk-hide-ads-setting

Remove Ads permission from site settings UI.
This commit is contained in:
Max
2022-11-29 11:48:12 -05:00
committed by GitHub
5 changed files with 26 additions and 0 deletions
+2
View File
@@ -30,6 +30,7 @@
#include "components/segmentation_platform/public/features.h"
#include "components/send_tab_to_self/features.h"
#include "components/shared_highlighting/core/common/shared_highlighting_features.h"
#include "components/subresource_filter/core/common/common_features.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_test.h"
#include "gpu/config/gpu_finch_features.h"
@@ -171,6 +172,7 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisabledFeatures) {
&send_tab_to_self::kSendTabToSelfSigninPromo,
&shared_highlighting::kIOSSharedHighlightingV2,
&shared_highlighting::kSharedHighlightingAmp,
&subresource_filter::kAdTagging,
#if !BUILDFLAG(IS_ANDROID)
&translate::kTFLiteLanguageDetectionEnabled,
#endif
@@ -19,6 +19,12 @@ RegisterPolymerTemplateModifications({
idleDetectionItem.hidden = true
}
}
const adsItem = templateContent.querySelector('[category="[[contentSettingsTypesEnum_.ADS]]"]')
if (!adsItem) {
console.error(`[Brave Settings Overrides] Couldn't find ads item`)
} else {
adsItem.hidden = true
}
const firstPermissionItem = templateContent.querySelector('div.list-frame > site-details-permission:nth-child(1)')
if (!firstPermissionItem) {
console.error(`[Brave Settings Overrides] Couldn't find first permission item`)
@@ -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/components/subresource_filter/core/common/common_features.cc"
#include "base/feature_override.h"
namespace subresource_filter {
OVERRIDE_FEATURE_DEFAULT_STATES({{
{kAdTagging, base::FEATURE_DISABLED_BY_DEFAULT},
}});
} // namespace subresource_filter
@@ -61,6 +61,7 @@ void BraveContentRendererClient::
blink::WebRuntimeFeatures::EnableFeatureFromString("Serial", false);
blink::WebRuntimeFeatures::EnableFeatureFromString(
"SpeculationRulesPrefetchProxy", false);
blink::WebRuntimeFeatures::EnableFeatureFromString("AdTagging", false);
}
BraveContentRendererClient::~BraveContentRendererClient() = default;
+1
View File
@@ -928,6 +928,7 @@ test("brave_browser_tests") {
"//components/send_tab_to_self",
"//components/shared_highlighting/core/common",
"//components/spellcheck/browser",
"//components/subresource_filter/core/common",
"//components/user_prefs",
"//extensions/browser:test_support",
"//extensions/common:common_constants",