diff --git a/build/patches/Disable-safe-browsing.patch b/build/patches/Disable-safe-browsing.patch index 8162fd4f..37c85f82 100644 --- a/build/patches/Disable-safe-browsing.patch +++ b/build/patches/Disable-safe-browsing.patch @@ -9,7 +9,10 @@ Disable CrowdDeny feature .../res/xml/google_services_preferences.xml | 20 ------ .../java/res/xml/privacy_preferences.xml | 11 --- .../res/xml/sync_and_services_preferences.xml | 20 ------ + .../EnhancedProtectionPromoController.java | 8 --- + .../EnhancedProtectionPromoUtils.java | 3 +- .../privacy/settings/PrivacySettings.java | 55 ++------------ + .../SafeBrowsingSettingsLauncher.java | 9 --- .../sync/settings/GoogleServicesSettings.java | 10 +-- .../settings/SyncAndServicesSettings.java | 9 +-- .../android/chrome_main_delegate_android.cc | 1 + @@ -19,6 +22,7 @@ Disable CrowdDeny feature chrome/browser/browser_process.h | 7 -- chrome/browser/browser_process_impl.cc | 29 -------- chrome/browser/browser_process_impl.h | 4 -- + .../chrome_browsing_data_remover_delegate.cc | 2 + .../browser/chrome_content_browser_client.cc | 28 ++++---- ...ontent_browser_client_receiver_bindings.cc | 2 + .../file_type_policies_component_installer.cc | 16 +---- @@ -41,6 +45,7 @@ Disable CrowdDeny feature ...me_native_file_system_permission_context.h | 3 + ...ial_comparison_cert_verifier_controller.cc | 3 - .../chrome_password_manager_client.cc | 2 + + ...ve_origin_permission_revocation_request.cc | 2 + .../permissions/chrome_permissions_client.cc | 8 --- .../permissions/chrome_permissions_client.h | 3 - ...hrome_browser_main_extra_parts_profiles.cc | 1 - @@ -52,10 +57,11 @@ Disable CrowdDeny feature .../android/safe_browsing_bridge.cc | 51 ------------- .../download_protection_service.cc | 7 -- .../download_protection_service.h | 5 -- + .../url_lookup_service_factory.cc | 4 ++ .../safety_check/SafetyCheckMediator.java | 25 ------- .../ssl/sct_reporting_service_factory.cc | 11 +-- .../browser/ssl/security_state_tab_helper.cc | 2 + - .../chrome_subresource_filter_client.cc | 1 + + .../chrome_subresource_filter_client.cc | 4 ++ chrome/browser/ui/BUILD.gn | 1 - .../strings/android_chrome_strings.grd | 21 ------ chrome/browser/ui/tab_helpers.cc | 8 --- @@ -64,13 +70,14 @@ Disable CrowdDeny feature .../chrome_content_renderer_client.cc | 2 + .../permissions/permission_request_manager.cc | 28 ++++++-- components/safe_browsing/core/features.cc | 2 +- + .../safe_browsing/core/file_type_policies.cc | 3 +- .../content/captive_portal_blocking_page.cc | 7 -- .../content/cert_report_helper.cc | 2 - .../unified_consent_service.cc | 2 +- .../native_file_system_file_writer_impl.cc | 50 +------------ .../native_file_system_file_writer_impl.h | 14 +--- .../native_file_system_permission_context.h | 6 -- - 64 files changed, 180 insertions(+), 660 deletions(-) + 71 files changed, 193 insertions(+), 681 deletions(-) diff --git a/chrome/android/java/res/xml/google_services_preferences.xml b/chrome/android/java/res/xml/google_services_preferences.xml --- a/chrome/android/java/res/xml/google_services_preferences.xml @@ -168,6 +175,44 @@ diff --git a/chrome/android/java/res/xml/sync_and_services_preferences.xml b/chr subresource_filter_ruleset_service_; +diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc +--- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc ++++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc +@@ -658,10 +658,12 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData( + base::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies")); + + network::mojom::NetworkContext* safe_browsing_context = nullptr; ++#if BUILDFLAG(FULL_SAFE_BROWSING) + safe_browsing::SafeBrowsingService* sb_service = + g_browser_process->safe_browsing_service(); + if (sb_service) + safe_browsing_context = sb_service->GetNetworkContext(profile_); ++#endif + + browsing_data::RemoveEmbedderCookieData( + delete_begin, delete_end, filter_builder, host_content_settings_map_, diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -1589,6 +1675,25 @@ diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b if (log_manager_->IsLoggingActive()) { password_manager::BrowserSavePasswordProgressLogger logger( +diff --git a/chrome/browser/permissions/abusive_origin_permission_revocation_request.cc b/chrome/browser/permissions/abusive_origin_permission_revocation_request.cc +--- a/chrome/browser/permissions/abusive_origin_permission_revocation_request.cc ++++ b/chrome/browser/permissions/abusive_origin_permission_revocation_request.cc +@@ -122,6 +122,7 @@ void AbusiveOriginPermissionRevocationRequest::CheckAndRevokeIfAbusive() { + return; + } + ++#if BUILDFLAG(FULL_SAFE_BROWSING) + CrowdDenyPreloadData* crowd_deny = CrowdDenyPreloadData::GetInstance(); + permissions::PermissionUmaUtil::RecordCrowdDenyIsLoadedAtAbuseCheckTime( + crowd_deny->is_loaded_from_disk()); +@@ -147,6 +148,7 @@ void AbusiveOriginPermissionRevocationRequest::CheckAndRevokeIfAbusive() { + return; + } + } ++#endif + + std::move(callback_).Run(Outcome::PERMISSION_NOT_REVOKED); + } diff --git a/chrome/browser/permissions/chrome_permissions_client.cc b/chrome/browser/permissions/chrome_permissions_client.cc --- a/chrome/browser/permissions/chrome_permissions_client.cc +++ b/chrome/browser/permissions/chrome_permissions_client.cc @@ -1930,6 +2035,27 @@ diff --git a/chrome/browser/safe_browsing/download_protection/download_protectio SafeBrowsingService* sb_service_; // These pointers may be NULL if SafeBrowsing is disabled. scoped_refptr ui_manager_; +diff --git a/chrome/browser/safe_browsing/url_lookup_service_factory.cc b/chrome/browser/safe_browsing/url_lookup_service_factory.cc +--- a/chrome/browser/safe_browsing/url_lookup_service_factory.cc ++++ b/chrome/browser/safe_browsing/url_lookup_service_factory.cc +@@ -50,6 +50,7 @@ RealTimeUrlLookupServiceFactory::RealTimeUrlLookupServiceFactory() + + KeyedService* RealTimeUrlLookupServiceFactory::BuildServiceInstanceFor( + content::BrowserContext* context) const { ++#if BUILDFLAG(FULL_SAFE_BROWSING) + if (!g_browser_process->safe_browsing_service()) { + return nullptr; + } +@@ -74,6 +75,9 @@ KeyedService* RealTimeUrlLookupServiceFactory::BuildServiceInstanceFor( + GetProfileManagementStatus(browser_policy_connector), + is_under_advanced_protection, profile->IsOffTheRecord(), + g_browser_process->variations_service()); ++#else ++ return nullptr; ++#endif + } + + } // namespace safe_browsing diff --git a/chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckMediator.java b/chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckMediator.java --- a/chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckMediator.java +++ b/chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckMediator.java @@ -2022,14 +2148,21 @@ diff --git a/chrome/browser/ssl/security_state_tab_helper.cc b/chrome/browser/ss diff --git a/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc b/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc --- a/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc +++ b/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc -@@ -97,6 +97,7 @@ ChromeSubresourceFilterClient::OnPageActivationComputed( - subresource_filter::mojom::ActivationLevel::kEnabled; - *decision = subresource_filter::ActivationDecision::FORCED_ACTIVATION; - } +@@ -167,10 +167,14 @@ void ChromeSubresourceFilterClient::AllowlistByContentSettings( + + const scoped_refptr + ChromeSubresourceFilterClient::GetSafeBrowsingDatabaseManager() { ++#if BUILDFLAG(FULL_SAFE_BROWSING) + safe_browsing::SafeBrowsingService* safe_browsing_service = + g_browser_process->safe_browsing_service(); + return safe_browsing_service ? safe_browsing_service->database_manager() + : nullptr; ++#else ++ return nullptr; +#endif + } - const GURL& url(navigation_handle->GetURL()); - + void ChromeSubresourceFilterClient::ToggleForceActivationInCurrentWebContents( diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn @@ -2276,6 +2409,19 @@ diff --git a/components/safe_browsing/core/features.cc b/components/safe_browsin const base::Feature kThreatDomDetailsTagAndAttributeFeature{ "ThreatDomDetailsTagAttributes", base::FEATURE_DISABLED_BY_DEFAULT}; +diff --git a/components/safe_browsing/core/file_type_policies.cc b/components/safe_browsing/core/file_type_policies.cc +--- a/components/safe_browsing/core/file_type_policies.cc ++++ b/components/safe_browsing/core/file_type_policies.cc +@@ -49,8 +49,7 @@ FileTypePolicies::~FileTypePolicies() { + } + + std::string FileTypePolicies::ReadResourceBundle() { +- ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); +- return bundle.LoadDataResourceString(IDR_DOWNLOAD_FILE_TYPES_PB); ++ return nullptr; + } + + void FileTypePolicies::RecordUpdateMetrics(UpdateResult result, diff --git a/components/security_interstitials/content/captive_portal_blocking_page.cc b/components/security_interstitials/content/captive_portal_blocking_page.cc --- a/components/security_interstitials/content/captive_portal_blocking_page.cc +++ b/components/security_interstitials/content/captive_portal_blocking_page.cc