From 3b441e03b2e626d2b51e2a3383ac12807fedb0c5 Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Thu, 7 Nov 2024 10:05:22 +0100 Subject: [PATCH] Content settings infrastructure: try to keeping resources in windows build (#1593) Unblock chrome-extension:// urls (#1571) --- .../Content-settings-infrastructure.patch | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/build/patches/Content-settings-infrastructure.patch b/build/patches/Content-settings-infrastructure.patch index cc816877..61d74884 100644 --- a/build/patches/Content-settings-infrastructure.patch +++ b/build/patches/Content-settings-infrastructure.patch @@ -25,7 +25,7 @@ Require: bromite-build-utils.patch .../site_settings/site_settings_mixin.ts | 18 + .../site_settings_page/site_settings_page.ts | 30 +- .../site_settings_page_util.ts | 55 +++ - chrome/browser/ui/BUILD.gn | 1 + + chrome/browser/ui/BUILD.gn | 2 + .../controls/rich_controls_container_view.h | 7 + .../ui/views/page_info/page_info_main_view.cc | 28 +- .../views/page_info/page_info_view_factory.cc | 20 + @@ -72,7 +72,7 @@ Require: bromite-build-utils.patch .../common/content_settings_mojom_traits.cc | 12 +- .../common/content_settings_mojom_traits.h | 24 + .../core/common/content_settings_types.mojom | 1 + - .../renderer/content_settings_agent_impl.cc | 68 +++ + .../renderer/content_settings_agent_impl.cc | 71 +++ .../renderer/content_settings_agent_impl.h | 9 + .../PageInfoPermissionsController.java | 9 + .../PermissionParamsListBuilder.java | 1 + @@ -83,7 +83,7 @@ Require: bromite-build-utils.patch .../platform/web_content_settings_client.h | 9 + .../execution_context/execution_context.cc | 16 + .../execution_context/execution_context.h | 5 + - 72 files changed, 1910 insertions(+), 93 deletions(-) + 72 files changed, 1914 insertions(+), 93 deletions(-) create mode 100644 components/browser_ui/settings/android/java/res/layout/preference_spinner_single_widget.xml create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSetting.java create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSettingImpl.java @@ -717,6 +717,14 @@ diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn "//components/enterprise/common:files_scan_data", "//components/feedback/proto", "//components/headless/policy", +@@ -5274,6 +5275,7 @@ static_library("ui") { + "//components/power_bookmarks/storage", + "//components/reading_list/features:flags", + "//components/segmentation_platform/embedder/default_model:default_model", ++ "//components/strings:components_strings_grit", + "//components/services/app_service", + "//components/soda", + "//components/soda:constants", diff --git a/chrome/browser/ui/views/controls/rich_controls_container_view.h b/chrome/browser/ui/views/controls/rich_controls_container_view.h --- a/chrome/browser/ui/views/controls/rich_controls_container_view.h +++ b/chrome/browser/ui/views/controls/rich_controls_container_view.h @@ -3156,7 +3164,7 @@ diff --git a/components/content_settings/core/common/content_settings_types.mojo diff --git a/components/content_settings/renderer/content_settings_agent_impl.cc b/components/content_settings/renderer/content_settings_agent_impl.cc --- a/components/content_settings/renderer/content_settings_agent_impl.cc +++ b/components/content_settings/renderer/content_settings_agent_impl.cc -@@ -200,6 +200,74 @@ void ContentSettingsAgentImpl::SendRendererContentSettingRules( +@@ -200,6 +200,77 @@ void ContentSettingsAgentImpl::SendRendererContentSettingRules( std::move(renderer_settings)); } @@ -3219,6 +3227,9 @@ diff --git a/components/content_settings/renderer/content_settings_agent_impl.cc + if (protocol == content::kChromeDevToolsScheme) + return true; // DevTools UI elements should still work. + ++ if (document_url.ProtocolIs("chrome-extension")) ++ return true; // Extension pages should still work. ++ + // If the scheme is file:, an empty file name indicates a directory listing, + // which requires JavaScript to function properly. + if (protocol == url::kFileScheme &&