From: uazo Date: Mon, 15 Nov 2021 09:43:29 +0000 Subject: Disable conversion measurement api Disable Conversion Measurement API by disabling the flag and removing support for the AttributionReporting provider. it also removes the handling of attributions via intents between apps. This patch enforces the deactivation by preventing the report from being sent and being saved to disk, although it is currently in uncalled code. Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- .../browser/aw_content_browser_client.cc | 3 + .../chromium/android_webview/AwSettings.java | 4 +- .../apk/AndroidManifest.xml | 3 - chrome/android/java/AndroidManifest.xml | 4 - .../ChromeSiteSettingsDelegate.java | 2 + .../privacy_page/privacy_page_index.html | 9 - chrome/browser/resources/settings/route.ts | 2 +- .../site_settings/site_settings_page.ts | 1 + .../aggregatable_trigger_config.cc | 2 +- components/attribution_reporting/features.cc | 1 + .../core/browser/content_settings_registry.cc | 2 +- .../origin_trials/features.cc | 1 + .../render_view_context_menu_base.cc | 3 - .../aggregatable_report_sender.cc | 15 +- .../attribution_data_host_manager_impl.cc | 8 +- .../attribution_reporting/attribution_host.cc | 3 +- .../attribution_manager_impl.cc | 4 - .../attribution_os_level_manager.cc | 3 +- .../attribution_report_network_sender.cc | 9 + .../attribution_storage_sql.cc | 8 +- .../renderer_host/render_frame_host_impl.cc | 11 + content/browser/storage_partition_impl.cc | 12 - content/public/android/BUILD.gn | 2 - .../browser/AttributionOsLevelManager.java | 349 +----------------- .../public/browser/content_browser_client.cc | 7 +- .../public/browser/navigation_controller.cc | 1 - .../Disable-conversion-measurement-api.inc | 2 + .../Disable-conversion-measurement-api.inc | 8 + .../attribution/request_headers_internal.cc | 1 + services/network/network_context.cc | 24 +- .../network/public/cpp/attribution_utils.cc | 2 + .../core/frame/attribution_src_loader.cc | 2 - third_party/blink/renderer/core/page/page.cc | 2 +- .../platform/runtime_enabled_features.json5 | 20 +- ui/events/android/motion_event_android.cc | 8 +- 35 files changed, 102 insertions(+), 436 deletions(-) create mode 100644 cromite_flags/services/network/public/cpp/features_cc/Disable-conversion-measurement-api.inc create mode 100644 cromite_flags/third_party/blink/common/features_cc/Disable-conversion-measurement-api.inc diff --git a/android_webview/browser/aw_content_browser_client.cc b/android_webview/browser/aw_content_browser_client.cc --- a/android_webview/browser/aw_content_browser_client.cc +++ b/android_webview/browser/aw_content_browser_client.cc @@ -1380,6 +1380,7 @@ network::mojom::AttributionSupport AwContentBrowserClient::GetAttributionSupport( AttributionReportingOsApiState state, bool client_os_disabled) { + if ((true)) return network::mojom::AttributionSupport::kNone; // WebView only supports OS-level attribution and not web-attribution. switch (state) { case AttributionReportingOsApiState::kDisabled: @@ -1398,6 +1399,8 @@ bool AwContentBrowserClient::IsAttributionReportingOperationAllowed( const url::Origin* destination_origin, const url::Origin* reporting_origin, bool* can_bypass) { + if ((true)) + return false; AwBrowserContext* aw_context = static_cast(browser_context); // WebView only supports OS-level attribution and not web-attribution. diff --git a/android_webview/java/src/org/chromium/android_webview/AwSettings.java b/android_webview/java/src/org/chromium/android_webview/AwSettings.java --- a/android_webview/java/src/org/chromium/android_webview/AwSettings.java +++ b/android_webview/java/src/org/chromium/android_webview/AwSettings.java @@ -201,7 +201,7 @@ public class AwSettings { private boolean mSpatialNavigationEnabled; // Default depends on device features. private boolean mEnableSupportedHardwareAcceleratedFeatures; private int mMixedContentMode = WebSettings.MIXED_CONTENT_NEVER_ALLOW; - private int mAttributionBehavior = AttributionBehavior.APP_SOURCE_AND_WEB_TRIGGER; + private int mAttributionBehavior = AttributionBehavior.DISABLED; private boolean mIgnoreDuplicateNavEnabled; private int mIgnoreDuplicateNavThresholdMs = -1; @@ -1868,7 +1868,7 @@ public class AwSettings { public void setAttributionBehavior(@AttributionBehavior int behavior) { synchronized (mAwSettingsLock) { if (mAttributionBehavior != behavior) { - mAttributionBehavior = behavior; + mAttributionBehavior = AttributionBehavior.DISABLED; mEventHandler.updateWebkitPreferencesLocked(); } } diff --git a/android_webview/tools/system_webview_shell/apk/AndroidManifest.xml b/android_webview/tools/system_webview_shell/apk/AndroidManifest.xml --- a/android_webview/tools/system_webview_shell/apk/AndroidManifest.xml +++ b/android_webview/tools/system_webview_shell/apk/AndroidManifest.xml @@ -191,9 +191,6 @@ android:exported="true"> - - diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml --- a/chrome/android/java/AndroidManifest.xml +++ b/chrome/android/java/AndroidManifest.xml @@ -39,7 +39,6 @@ by a child template that "extends" this file. - diff --git a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsDelegate.java --- a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsDelegate.java @@ -152,6 +152,8 @@ public class ChromeSiteSettingsDelegate implements SiteSettingsDelegate { // not great to dynamically remove the preference in this way. case SiteSettingsCategory.Type.ADS: return SiteSettingsCategory.adsCategoryEnabled(); + case SiteSettingsCategory.Type.ANTI_ABUSE: + return false; case SiteSettingsCategory.Type.AUTO_DARK_WEB_CONTENT: return ChromeFeatureList.isEnabled( ChromeFeatureList.DARKEN_WEBSITES_CHECKBOX_IN_THEMES_SETTING); diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page_index.html b/chrome/browser/resources/settings/privacy_page/privacy_page_index.html --- a/chrome/browser/resources/settings/privacy_page/privacy_page_index.html +++ b/chrome/browser/resources/settings/privacy_page/privacy_page_index.html @@ -179,15 +179,6 @@ - -