summaryrefslogtreecommitdiff
path: root/www/chromium-uc/patches/core/ungoogled-chromium/disable-privacy-sandbox.patch
blob: ad36006d092788a4a1bc904557fd1b33e69a3a3a (plain)
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
--- a/chrome/browser/resources/settings/privacy_page/privacy_page.html
+++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html
@@ -85,21 +85,6 @@
             sub-label="$i18n{permissionsPageDescription}"
             on-click="onPermissionsPageClick_"
             role-description="$i18n{subpageArrowRoleDescription}"></cr-link-row>
-        <template is="dom-if" if="[[!isPrivacySandboxRestricted_]]">
-          <cr-link-row id="privacySandboxLinkRow"
-              start-icon="settings20:experiment"
-              class="hr"
-              label="$i18n{privacySandboxTitle}"
-              sub-label="[[computePrivacySandboxSublabel_(
-                  prefs.privacy_sandbox.*)]]"
-              on-click="onPrivacySandboxClick_"
-              external
-              role-description="$i18n{subpageArrowRoleDescription}">
-          </cr-link-row>
-          <a id="privacySandboxLink" href="privacySandbox"
-              target="_blank" tabindex="-1" aria-disabled="true"
-              role="none"></a>
-        </template>
       </div>
 
 <if expr="use_nss_certs">
--- a/components/privacy_sandbox/privacy_sandbox_prefs.cc
+++ b/components/privacy_sandbox/privacy_sandbox_prefs.cc
@@ -71,7 +71,7 @@ namespace privacy_sandbox {
 
 void RegisterProfilePrefs(PrefRegistrySimple* registry) {
   registry->RegisterBooleanPref(
-      prefs::kPrivacySandboxApisEnabled, true,
+      prefs::kPrivacySandboxApisEnabled, false,
       user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
   registry->RegisterBooleanPref(prefs::kPrivacySandboxApisEnabledV2, false);
   registry->RegisterBooleanPref(prefs::kPrivacySandboxApisEnabledV2Init, false);
--- a/components/privacy_sandbox/privacy_sandbox_settings.cc
+++ b/components/privacy_sandbox/privacy_sandbox_settings.cc
@@ -339,48 +339,10 @@ std::vector<GURL> PrivacySandboxSettings
 }
 
 bool PrivacySandboxSettings::IsPrivacySandboxEnabled() const {
-  // If the delegate is restricting access, or indicates confirmation has not
-  // occurred, the Privacy Sandbox is disabled.
-  if (delegate_->IsPrivacySandboxRestricted() ||
-      !delegate_->IsPrivacySandboxConfirmed()) {
-    return false;
-  }
-
-  // For Measurement and Relevance APIs, we explicitly do not require the
-  // underlying pref to be enabled if there is a local flag enabling the APIs to
-  // allow for local testing.
-  bool should_override_setting_for_local_testing = base::FeatureList::IsEnabled(
-      privacy_sandbox::kOverridePrivacySandboxSettingsLocalTesting);
-
-  // Which preference is consulted is dependent on whether release 3 of the
-  // settings is available.
-  if (base::FeatureList::IsEnabled(privacy_sandbox::kPrivacySandboxSettings3)) {
-    // For Privacy Sandbox Settings 3, APIs are disabled in incognito.
-    if (incognito_profile_)
-      return false;
-
-    if (should_override_setting_for_local_testing) {
-      return true;
-    }
-
-    // For Privacy Sandbox Settings 3, APIs may be restricted via the delegate.
-    // The V2 pref was introduced with the 3rd Privacy Sandbox release.
-    return pref_service_->GetBoolean(prefs::kPrivacySandboxApisEnabledV2);
-  }
-
-  if (should_override_setting_for_local_testing)
-    return true;
-
-  return pref_service_->GetBoolean(prefs::kPrivacySandboxApisEnabled);
+  return false;
 }
 
 void PrivacySandboxSettings::SetPrivacySandboxEnabled(bool enabled) {
-  // Only apply the decision to the appropriate preference.
-  if (base::FeatureList::IsEnabled(privacy_sandbox::kPrivacySandboxSettings3)) {
-    pref_service_->SetBoolean(prefs::kPrivacySandboxApisEnabledV2, enabled);
-  } else {
-    pref_service_->SetBoolean(prefs::kPrivacySandboxApisEnabled, enabled);
-  }
 }
 
 bool PrivacySandboxSettings::IsTrustTokensAllowed() {