Skip to content

Commit

Permalink
[Kartoffel][Clank] Clean up PrivacySandboxSettings4 flag usage - v2
Browse files Browse the repository at this point in the history
Continuing the cleanup work on Clank.

Bug: 1449833
Change-Id: I48492d1b11c2e5af8a853865bea3180217c23c49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4935117
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Commit-Queue: Christian Dullweber <dullweber@chromium.org>
Auto-Submit: Nicola Tommasi <tommasin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1210142}
  • Loading branch information
Nicola Tommasi authored and Chromium LUCI CQ committed Oct 16, 2023
1 parent 6e807ee commit 05360f9
Show file tree
Hide file tree
Showing 25 changed files with 84 additions and 344 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,8 @@ public boolean isShowingPaintPreviewPage() {

@Override
public void showCookieSettings() {
SiteSettingsHelper.showCategorySettings(mContext, mProfile,
getSiteSettingsDelegate().isPrivacySandboxSettings4Enabled()
? SiteSettingsCategory.Type.THIRD_PARTY_COOKIES
: SiteSettingsCategory.Type.COOKIES);
SiteSettingsHelper.showCategorySettings(
mContext, mProfile, SiteSettingsCategory.Type.THIRD_PARTY_COOKIES);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,6 @@ public boolean isPrivacySandboxFirstPartySetsUIFeatureEnabled() {
return ChromeFeatureList.isEnabled(ChromeFeatureList.PRIVACY_SANDBOX_FPS_UI);
}

@Override
public boolean isPrivacySandboxSettings4Enabled() {
return ChromeFeatureList.isEnabled(ChromeFeatureList.PRIVACY_SANDBOX_SETTINGS_4);
}

@Override
public boolean isUserBypassUIEnabled() {
return ChromeFeatureList.isEnabled(ChromeFeatureList.USER_BYPASS_UI);
Expand Down Expand Up @@ -227,11 +222,7 @@ public void maybeDisplayPrivacySandboxSnackbar() {
if (mPrivacySandboxController == null) return;

// Only show the snackbar when Privacy Sandbox APIs are enabled.
if (isPrivacySandboxSettings4Enabled()) {
if (!isAnyPrivacySandboxApiEnabledV4()) return;
} else {
if (!PrivacySandboxBridge.isPrivacySandboxEnabled()) return;
}
if (!isAnyPrivacySandboxApiEnabledV4()) return;

if (PrivacySandboxBridge.isPrivacySandboxRestricted()) return;

Expand Down
1 change: 0 additions & 1 deletion components/browser_ui/site_settings/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ android_resources("java_resources") {
"java/res/xml/grouped_websites_preferences.xml",
"java/res/xml/single_website_preferences.xml",
"java/res/xml/site_settings_preferences.xml",
"java/res/xml/site_settings_preferences_with_categories.xml",
"java/res/xml/website_preferences.xml",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ found in the LICENSE file.
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/offline"
android:layout_marginTop="12dp"
android:visibility="gone">
android:layout_marginTop="12dp">
<ImageView
android:id="@+id/ad_personalization_icon"
android:layout_width="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2015 The Chromium Authors
Copyright 2022 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<!--
The order of the following items is from: http://crbug.com/610358.
Used when PrivacySandboxSettingsV4 is disabled.
Also add new settings to site_settings_preferences_with_categories.xml!
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
Expand All @@ -19,10 +17,9 @@ Also add new settings to site_settings_preferences_with_categories.xml!
android:title="@string/all_sites"
android:icon="@drawable/settings_all_sites"
app:iconTint="@macro/default_icon_color" />
<!-- Cookies -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:key="cookies"
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings" />

<!-- PERMISSIONS section -->
<PreferenceCategory android:title="@string/site_settings_permission_category"/>
<!-- Location -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
Expand All @@ -43,47 +40,10 @@ Also add new settings to site_settings_preferences_with_categories.xml!
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="notifications" />
<!-- JavaScript -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="javascript" />
<!-- Popups -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="popups" />
<!-- StorageAccess -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="storage_access" />
<!-- Ads -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="ads" />
<!-- Background sync -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="background_sync" />
<!-- Automatic Downloads -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="automatic_downloads" />
<!-- Protected content -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="protected_content" />
<!-- Sound -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="sound" />
<!-- Storage -->
<!-- TODO(finnur): Move this over to the new Usage screen, once it exists.
Also update site_settings_preferences_with_categories.xml. -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.AllSiteSettings"
android:key="use_storage"
android:title="@string/website_settings_storage"
android:icon="@drawable/ic_storage"
app:iconTint="@macro/default_icon_color" />
<!-- NFC -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
Expand Down Expand Up @@ -116,6 +76,35 @@ Also add new settings to site_settings_preferences_with_categories.xml!
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="idle_detection" />

<!-- CONTENT SETTINGS section -->
<PreferenceCategory android:title="@string/site_settings_content_category"/>
<!-- Third party cookies -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:key="third_party_cookies"
android:icon="@drawable/permission_cookie"
app:iconTint="@macro/default_icon_color"
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings" />
<!-- JavaScript -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="javascript" />
<!-- Popups -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="popups" />
<!-- Sound -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="sound" />
<!-- Ads -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="ads" />
<!-- Protected content -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="protected_content" />
<!-- Federated Identity API -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
Expand All @@ -124,21 +113,40 @@ Also add new settings to site_settings_preferences_with_categories.xml!
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="anti_abuse"/>
<!-- Site data -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:key="site_data"
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings" />
<!-- Request Desktop Site -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="request_desktop_site" />
<!-- Auto-dark Web Content -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="auto_dark_web_content" />
<!-- Background sync -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="background_sync" />
<!-- Automatic Downloads -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="automatic_downloads" />
<!-- Zoom -->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.AllSiteSettings"
android:key="zoom"
android:title="@string/page_zoom_menu_title"
android:icon="@drawable/ic_zoom"
app:iconTint="@macro/default_icon_color" />
<!-- Request Desktop Site -->
<!-- TODO(crbug.com/1243758): Update the location of this setting once approved.
Also update site_settings_preferences_with_categories.xml. -->

<!-- Storage -->
<!-- TODO(finnur): Move this over to the new Usage screen, once it exists.-->
<org.chromium.components.browser_ui.settings.ChromeBasePreference
android:fragment="org.chromium.components.browser_ui.site_settings.SingleCategorySettings"
android:key="request_desktop_site" />
android:fragment="org.chromium.components.browser_ui.site_settings.AllSiteSettings"
android:key="use_storage"
android:title="@string/website_settings_storage"
android:icon="@drawable/ic_storage"
app:iconTint="@macro/default_icon_color" />
</PreferenceScreen>

This file was deleted.

0 comments on commit 05360f9

Please sign in to comment.