diff --git a/build/bromite_patches_list.txt b/build/bromite_patches_list.txt index 4b52f0e7..6567a31b 100644 --- a/build/bromite_patches_list.txt +++ b/build/bromite_patches_list.txt @@ -211,4 +211,37 @@ Fix-WebWorker-requestAnimationFrame.patch 00Experimental-user-scripts-support--fixup--2.patch 00OpenSearch--miscellaneous--fixup-.patch 00Eyeo-Adblock.patch -00Eyeo-Adblock-Remove-Privacy-Issues.patch \ No newline at end of file +00Eyeo-Adblock-Remove-Privacy-Issues.patch +00Add-an-always-incognito-mode--win-fixup-.patch +00Experimental-user-scripts-support--win-fixup-.patch +00Disable-safe-browsing--win-fixup-.patch +00ungoogled-chr--Disable-profile-avatar--win-fixup-.patch +00Add-a-proxy-configuration-page--win-fixup-.patch +00Add-bookmark-import-export-actions--win-fixup-.patch +00openH264--enable-ARM-ARM64-optimizati--win-fixup-.patch +00Add-flag-to-disable-IPv6-probes--win-fixup-.patch +00Remove-EV-certificates--win-fixup-.patch +00AImageReader-CFI-crash-mitigations--win-fixup-.patch +00Remove-binary-blob-integrations--win-fixup-.patch +00Enable-native-Android-autofill--win-fixup-.patch +00Remove-signin-and-sync-integrations--win-fixup-.patch +00Add-lifetime-options-for-permissions--win-fixup-.patch +00Disable-various-metrics--win-fixup-.patch +00Do-not-build-API-keys-infobar--win-fixup-.patch +00Revert-flags--remove-num-raster-thre--win-fixup-.patch +00Add-flag-to-configure-maximum-connecti--win-fixup-.patch +00Add-flag-to-disable-external-intent-re--win-fixup-.patch +00Restore-Search-Ready-Omnibox-flag--win-fixup-.patch +00Disable-requests-for-single-word-Omni--win-fixup-.patch +00Revert-the-removal-to-block-autoplay--win-fixup-.patch +00JIT-site-settings--win-fixup-.patch +00Timezone-customization--win-fixup-.patch +00Add-webGL-site-setting--win-fixup-.patch +00Add-webRTC-site-settings--win-fixup-.patch +00Viewport-Protection--win-fixup-.patch +00Eyeo-Adblock--win-fixup-.patch +00Content-settings-infrastructure--win-fixup-.patch +00ungoogled-chromium--no-special-hosts-d--win-fixup-.patch +00Client-hints-overrides--win-fixup-.patch +00Logcat-crash-reports-UI--win-fixup-.patch +00Fix-windows-build.patch \ No newline at end of file diff --git a/build/patches/00AImageReader-CFI-crash-mitigations--win-fixup-.patch b/build/patches/00AImageReader-CFI-crash-mitigations--win-fixup-.patch new file mode 100644 index 00000000..a374cc37 --- /dev/null +++ b/build/patches/00AImageReader-CFI-crash-mitigations--win-fixup-.patch @@ -0,0 +1,26 @@ +From: Your Name +Date: Wed, 12 Oct 2022 11:36:56 +0000 +Subject: AImageReader CFI crash mitigations (win fixup) + +--- + gpu/ipc/service/gpu_init.cc | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc +--- a/gpu/ipc/service/gpu_init.cc ++++ b/gpu/ipc/service/gpu_init.cc +@@ -624,10 +624,12 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line, + } + #endif // BUILDFLAG(IS_WIN) + ++#if BUILDFLAG(IS_ANDROID) + // Disable AImageReader if the workaround is enabled. + if (gpu_feature_info_.IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) { + base::android::AndroidImageReader::DisableSupport(); + } ++#endif + + if (gpu_feature_info_.status_values[GPU_FEATURE_TYPE_VULKAN] != + kGpuFeatureStatusEnabled || +-- +2.25.1 diff --git a/build/patches/00Add-a-proxy-configuration-page--win-fixup-.patch b/build/patches/00Add-a-proxy-configuration-page--win-fixup-.patch new file mode 100644 index 00000000..4f4e0b50 --- /dev/null +++ b/build/patches/00Add-a-proxy-configuration-page--win-fixup-.patch @@ -0,0 +1,39 @@ +From: Your Name +Date: Wed, 12 Oct 2022 10:59:27 +0000 +Subject: Add a proxy configuration page (win fixup) + +--- + chrome/browser/browser_resources.grd | 6 ++---- + chrome/browser/extensions/api/proxy/proxy_api_helpers.cc | 2 +- + 2 files changed, 3 insertions(+), 5 deletions(-) + +diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd +--- a/chrome/browser/browser_resources.grd ++++ b/chrome/browser/browser_resources.grd +@@ -77,10 +77,8 @@ + + + +- +- +- +- ++ ++ + + + +diff --git a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc +--- a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc ++++ b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc +@@ -380,7 +380,7 @@ std::unique_ptr CreateProxyConfigDict( + } + return std::make_unique( + ProxyConfigDictionary::CreateFixedServers(proxy_rules_string, +- bypass_list)); ++ bypass_list, /*reverse_bypass*/false)); + } + case ProxyPrefs::MODE_SYSTEM: + return std::make_unique( +-- +2.25.1 diff --git a/build/patches/00Add-an-always-incognito-mode--win-fixup-.patch b/build/patches/00Add-an-always-incognito-mode--win-fixup-.patch new file mode 100644 index 00000000..f0c2866c --- /dev/null +++ b/build/patches/00Add-an-always-incognito-mode--win-fixup-.patch @@ -0,0 +1,62 @@ +From: Your Name +Date: Wed, 12 Oct 2022 09:09:26 +0000 +Subject: Add an always-incognito mode (win fixup) + +--- + .../browser/autocomplete/chrome_autocomplete_provider_client.cc | 2 ++ + .../content_settings/host_content_settings_map_factory.cc | 2 ++ + chrome/browser/history/history_tab_helper.cc | 2 ++ + 3 files changed, 6 insertions(+) + +diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc +--- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc ++++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc +@@ -311,9 +311,11 @@ signin::IdentityManager* ChromeAutocompleteProviderClient::GetIdentityManager() + } + + bool ChromeAutocompleteProviderClient::IsAlwaysIncognitoEnabled() const { ++#if BUILDFLAG(IS_ANDROID) + if (profile_->GetPrefs()->GetBoolean(prefs::kAlwaysIncognitoEnabled)) { + return true; + } ++#endif + return false; + } + +diff --git a/chrome/browser/content_settings/host_content_settings_map_factory.cc b/chrome/browser/content_settings/host_content_settings_map_factory.cc +--- a/chrome/browser/content_settings/host_content_settings_map_factory.cc ++++ b/chrome/browser/content_settings/host_content_settings_map_factory.cc +@@ -100,6 +100,7 @@ scoped_refptr + bool always_incognito_enabled = false; + bool force_save_site_settings = false; + ++#if BUILDFLAG(IS_ANDROID) + PrefService* prefService = original_profile->GetPrefs(); + if (prefService->GetBoolean(prefs::kAlwaysIncognitoEnabled)) { + always_incognito_enabled = true; +@@ -109,6 +110,7 @@ scoped_refptr + profile = original_profile; + force_save_site_settings = true; + } ++#endif + + scoped_refptr settings_map(new HostContentSettingsMap( + profile->GetPrefs(), +diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc +--- a/chrome/browser/history/history_tab_helper.cc ++++ b/chrome/browser/history/history_tab_helper.cc +@@ -429,10 +429,12 @@ history::HistoryService* HistoryTabHelper::GetHistoryService() { + + // static + void HistoryTabHelper::RegisterProfilePrefs(PrefRegistrySimple* registry) { ++#if BUILDFLAG(IS_ANDROID) + registry->RegisterBooleanPref(prefs::kIncognitoTabHistoryEnabled, + /*default_value=*/false); + registry->RegisterBooleanPref(prefs::kIncognitoSaveSiteSettingEnabled, + /*default_value=*/false); ++#endif + } + + void HistoryTabHelper::WebContentsDestroyed() { +-- +2.25.1 diff --git a/build/patches/00Add-bookmark-import-export-actions--win-fixup-.patch b/build/patches/00Add-bookmark-import-export-actions--win-fixup-.patch new file mode 100644 index 00000000..5465b235 --- /dev/null +++ b/build/patches/00Add-bookmark-import-export-actions--win-fixup-.patch @@ -0,0 +1,109 @@ +From: Your Name +Date: Wed, 12 Oct 2022 11:30:34 +0000 +Subject: Add bookmark import/export actions (win fixup) + +--- + chrome/browser/BUILD.gn | 2 ++ + chrome/browser/about_flags.cc | 2 ++ + chrome/browser/bookmarks/bookmark_html_writer.cc | 7 ++++++- + .../lib/browser/headless_select_file_dialog_factory.cc | 4 ++++ + ui/shell_dialogs/select_file_dialog_win.cc | 5 +++++ + 5 files changed, 19 insertions(+), 1 deletion(-) + +diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn +--- a/chrome/browser/BUILD.gn ++++ b/chrome/browser/BUILD.gn +@@ -3588,6 +3588,8 @@ static_library("browser") { + "badging/badge_manager_factory.h", + "banners/app_banner_manager_desktop.cc", + "banners/app_banner_manager_desktop.h", ++ "bookmarks/bookmark_html_writer.cc", ++ "bookmarks/bookmark_html_writer.h", + "bookmarks/url_and_id.h", + "cart/cart_db.cc", + "cart/cart_db.h", +diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc +--- a/chrome/browser/about_flags.cc ++++ b/chrome/browser/about_flags.cc +@@ -8746,11 +8746,13 @@ const FeatureEntry kFeatureEntries[] = { + FEATURE_VALUE_TYPE(net::features::kIsCleartextPermitted)}, + #endif + ++#if BUILDFLAG(IS_ANDROID) + {"export-bookmarks-use-saf", + flag_descriptions::kBookmarksExportUseSafName, + flag_descriptions::kBookmarksExportUseSafDescription, kOsAndroid, + FEATURE_VALUE_TYPE( + chrome::android::kBookmarksExportUseSaf)}, ++#endif + + #if BUILDFLAG(IS_CHROMEOS_ASH) + {"snooping-protection", flag_descriptions::kSnoopingProtectionName, +diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/bookmarks/bookmark_html_writer.cc +--- a/chrome/browser/bookmarks/bookmark_html_writer.cc ++++ b/chrome/browser/bookmarks/bookmark_html_writer.cc +@@ -27,7 +27,9 @@ + #include "base/task/thread_pool.h" + #include "base/time/time.h" + #include "base/values.h" ++#if BUILDFLAG(IS_ANDROID) + #include "base/android/content_uri_utils.h" ++#endif + #include "chrome/browser/bookmarks/bookmark_model_factory.h" + #include "chrome/browser/favicon/favicon_service_factory.h" + #include "chrome/browser/profiles/profile.h" +@@ -239,12 +241,15 @@ class Writer : public base::RefCountedThreadSafe { + // Opens the file, returning true on success. + bool OpenFile() { + int flags = base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE; ++#if BUILDFLAG(IS_ANDROID) + if (path_.IsContentUri()) { + file_ = std::make_unique(base::OpenContentUriForWrite(path_)); + } else { + file_ = std::make_unique(path_, flags); + } +- ++#else ++ file_ = std::make_unique(path_, flags); ++#endif + if (!file_->IsValid()) { + PLOG(ERROR) << "Could not create " << path_; + return false; +diff --git a/headless/lib/browser/headless_select_file_dialog_factory.cc b/headless/lib/browser/headless_select_file_dialog_factory.cc +--- a/headless/lib/browser/headless_select_file_dialog_factory.cc ++++ b/headless/lib/browser/headless_select_file_dialog_factory.cc +@@ -54,6 +54,10 @@ class HeadlessSelectFileDialog : public ui::SelectFileDialog { + // ui::SelectFileDialog: + bool HasMultipleFileTypeChoicesImpl() override { return false; } + ++ void ShowToast(const std::string& message) override { ++ // nothing to do, used only on android ++ } ++ + SelectFileDialogCallback callback_; + }; + +diff --git a/ui/shell_dialogs/select_file_dialog_win.cc b/ui/shell_dialogs/select_file_dialog_win.cc +--- a/ui/shell_dialogs/select_file_dialog_win.cc ++++ b/ui/shell_dialogs/select_file_dialog_win.cc +@@ -192,6 +192,7 @@ class SelectFileDialogImpl : public ui::SelectFileDialog, + int index); + + bool HasMultipleFileTypeChoicesImpl() override; ++ void ShowToast(const std::string& message) override; + + // Returns the filter to be used while displaying the open/save file dialog. + // This is computed from the extensions for the file types being opened. +@@ -269,6 +270,10 @@ bool SelectFileDialogImpl::HasMultipleFileTypeChoicesImpl() { + return has_multiple_file_type_choices_; + } + ++void SelectFileDialogImpl::ShowToast(const std::string& message) { ++ // nothing to do, used only on android ++} ++ + bool SelectFileDialogImpl::IsRunning(gfx::NativeWindow owning_window) const { + if (!owning_window->GetRootWindow()) + return false; +-- +2.25.1 diff --git a/build/patches/00Add-flag-to-configure-maximum-connecti--win-fixup-.patch b/build/patches/00Add-flag-to-configure-maximum-connecti--win-fixup-.patch new file mode 100644 index 00000000..244845df --- /dev/null +++ b/build/patches/00Add-flag-to-configure-maximum-connecti--win-fixup-.patch @@ -0,0 +1,26 @@ +From: Your Name +Date: Wed, 12 Oct 2022 12:00:06 +0000 +Subject: Add flag to configure maximum connecti (win fixup) + +--- + chrome/browser/about_flags.cc | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc +--- a/chrome/browser/about_flags.cc ++++ b/chrome/browser/about_flags.cc +@@ -1048,10 +1048,12 @@ const FeatureEntry::Choice kForceColorProfileChoices[] = { + switches::kForceDisplayColorProfile, "hdr10"}, + }; + ++#if BUILDFLAG(IS_ANDROID) + const FeatureEntry::Choice kMaxConnectionsPerHostChoices[] = { + {features::kMaxConnectionsPerHostChoiceDefault, "", ""}, + {features::kMaxConnectionsPerHostChoice15, switches::kMaxConnectionsPerHost, "15"}, + }; ++#endif + + const FeatureEntry::Choice kMemlogModeChoices[] = { + {flags_ui::kGenericExperimentChoiceDisabled, "", ""}, +-- +2.25.1 diff --git a/build/patches/00Add-flag-to-disable-IPv6-probes--win-fixup-.patch b/build/patches/00Add-flag-to-disable-IPv6-probes--win-fixup-.patch new file mode 100644 index 00000000..e4c04f7d --- /dev/null +++ b/build/patches/00Add-flag-to-disable-IPv6-probes--win-fixup-.patch @@ -0,0 +1,136 @@ +From: Your Name +Date: Wed, 12 Oct 2022 11:34:42 +0000 +Subject: Add flag to disable IPv6 probes (win fixup) + +--- + chrome/browser/about_flags.cc | 2 +- + components/subresource_filter/tools/BUILD.gn | 6 ------ + components/url_formatter/spoof_checks/top_domains/BUILD.gn | 3 +-- + net/base/features.cc | 3 +++ + net/base/features.h | 3 +++ + net/dns/host_resolver_manager.cc | 2 +- + services/network/public/cpp/features.cc | 4 ---- + services/network/public/cpp/features.h | 2 -- + 8 files changed, 9 insertions(+), 16 deletions(-) + +diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc +--- a/chrome/browser/about_flags.cc ++++ b/chrome/browser/about_flags.cc +@@ -5790,7 +5790,7 @@ const FeatureEntry kFeatureEntries[] = { + {"ipv6-probing", + flag_descriptions::kIPv6ProbingName, + flag_descriptions::kIPv6ProbingDescription, kOsAll, +- FEATURE_VALUE_TYPE(network::features::kIPv6Probing)}, ++ FEATURE_VALUE_TYPE(net::features::kIPv6Probing)}, + #endif // BUILDFLAG(IS_ANDROID) + + {"shopping-list", commerce::flag_descriptions::kShoppingListName, +diff --git a/components/subresource_filter/tools/BUILD.gn b/components/subresource_filter/tools/BUILD.gn +--- a/components/subresource_filter/tools/BUILD.gn ++++ b/components/subresource_filter/tools/BUILD.gn +@@ -50,8 +50,6 @@ if (!is_ios) { + deps = [ + ":tools_lib", + "//base", +- "//components/network_session_configurator/common", +- "//services/network/public/cpp" + ] + } + +@@ -63,8 +61,6 @@ if (!is_ios) { + ":tools_lib", + "../core/common", + "//base", +- "//components/network_session_configurator/common", +- "//services/network/public/cpp", + ] + } + +@@ -74,8 +70,6 @@ if (!is_ios) { + "ruleset_converter:support", + "//base", + "//third_party/protobuf:protobuf_lite", +- "//components/network_session_configurator/common", +- "//services/network/public/cpp" + ] + } + +diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/components/url_formatter/spoof_checks/top_domains/BUILD.gn +--- a/components/url_formatter/spoof_checks/top_domains/BUILD.gn ++++ b/components/url_formatter/spoof_checks/top_domains/BUILD.gn +@@ -89,8 +89,7 @@ executable("make_top_domain_list_variables") { + "//base:i18n", + "//components/url_formatter/spoof_checks/common_words:common", + "//third_party/icu", +- "//components/network_session_configurator/common", +- "//services/network/public/cpp", ++ "//components/network_session_configurator/common" + ] + if (is_ios) { + frameworks = [ "UIKit.framework" ] +diff --git a/net/base/features.cc b/net/base/features.cc +--- a/net/base/features.cc ++++ b/net/base/features.cc +@@ -57,6 +57,9 @@ const base::FeatureParam kDnsHttpssvcControlDomains{ + const base::FeatureParam kDnsHttpssvcControlDomainWildcard{ + &kDnsHttpssvc, "DnsHttpssvcControlDomainWildcard", false}; + ++const base::Feature kIPv6Probing{"IPv6Probing", ++ base::FEATURE_ENABLED_BY_DEFAULT}; ++ + namespace dns_httpssvc_experiment { + base::TimeDelta GetExtraTimeAbsolute() { + DCHECK(base::FeatureList::IsEnabled(features::kDnsHttpssvc)); +diff --git a/net/base/features.h b/net/base/features.h +--- a/net/base/features.h ++++ b/net/base/features.h +@@ -118,6 +118,9 @@ NET_EXPORT extern const base::FeatureParam kUseDnsHttpsSvcbHttpUpgrade; + NET_EXPORT extern const base::FeatureParam + kUseDnsHttpsSvcbEnforceSecureResponse; + ++// Enable IPv6 ping probes to RIPE DNS. ++NET_EXPORT extern const base::Feature kIPv6Probing; ++ + // Param to control whether HTTPS queries will be allowed via Insecure DNS + // (instead of just via Secure DNS). + NET_EXPORT extern const base::FeatureParam kUseDnsHttpsSvcbEnableInsecure; +diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc +--- a/net/dns/host_resolver_manager.cc ++++ b/net/dns/host_resolver_manager.cc +@@ -4089,7 +4089,7 @@ bool HostResolverManager::IsIPv6Reachable(const NetLogWithSource& net_log) { + (tick_clock_->NowTicks() - last_ipv6_probe_time_).InMilliseconds() > + kIPv6ProbePeriodMs) { + +- if (!base::FeatureList::IsEnabled(network::features::kIPv6Probing)) { ++ if (!base::FeatureList::IsEnabled(net::features::kIPv6Probing)) { + // pretend IPv6 connectivy probe is successful when probing is disabled + SetLastIPv6ProbeResult(true); + } else { +diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc +--- a/services/network/public/cpp/features.cc ++++ b/services/network/public/cpp/features.cc +@@ -41,10 +41,6 @@ const base::Feature kReporting{"Reporting", base::FEATURE_ENABLED_BY_DEFAULT}; + const base::Feature kThrottleDelayable{"ThrottleDelayable", + base::FEATURE_ENABLED_BY_DEFAULT}; + +-// Enable IPv6 ping probes to RIPE DNS. +-const base::Feature kIPv6Probing{"IPv6Probing", +- base::FEATURE_ENABLED_BY_DEFAULT}; +- + // When kPriorityRequestsDelayableOnSlowConnections is enabled, HTTP + // requests fetched from a SPDY/QUIC/H2 proxies can be delayed by the + // ResourceScheduler just as HTTP/1.1 resources are. However, requests from such +diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h +--- a/services/network/public/cpp/features.h ++++ b/services/network/public/cpp/features.h +@@ -18,8 +18,6 @@ extern const base::Feature kExpectCTReporting; + COMPONENT_EXPORT(NETWORK_CPP) + extern const base::Feature kNetworkErrorLogging; + COMPONENT_EXPORT(NETWORK_CPP) +-extern const base::Feature kIPv6Probing; +-COMPONENT_EXPORT(NETWORK_CPP) + extern const base::Feature kReporting; + COMPONENT_EXPORT(NETWORK_CPP) + extern const base::Feature kThrottleDelayable; +-- +2.25.1 diff --git a/build/patches/00Add-flag-to-disable-external-intent-re--win-fixup-.patch b/build/patches/00Add-flag-to-disable-external-intent-re--win-fixup-.patch new file mode 100644 index 00000000..55567446 --- /dev/null +++ b/build/patches/00Add-flag-to-disable-external-intent-re--win-fixup-.patch @@ -0,0 +1,25 @@ +From: Your Name +Date: Wed, 12 Oct 2022 12:00:43 +0000 +Subject: Add flag to disable external intent re (win fixup) + +--- + chrome/browser/about_flags.cc | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc +--- a/chrome/browser/about_flags.cc ++++ b/chrome/browser/about_flags.cc +@@ -3395,9 +3395,11 @@ const FeatureEntry kFeatureEntries[] = { + {"ui-disable-partial-swap", flag_descriptions::kUiPartialSwapName, + flag_descriptions::kUiPartialSwapDescription, kOsAll, + SINGLE_DISABLE_VALUE_TYPE(switches::kUIDisablePartialSwap)}, ++#if BUILDFLAG(IS_ANDROID) + {"disable-external-intent-requests", flag_descriptions::kDisableExternalIntentRequestsName, + flag_descriptions::kDisableExternalIntentRequestsDescription, kOsAll, + SINGLE_DISABLE_VALUE_TYPE("disable-external-intent-requests")}, ++#endif + {"disable-webrtc-hw-decoding", flag_descriptions::kWebrtcHwDecodingName, + flag_descriptions::kWebrtcHwDecodingDescription, kOsAndroid | kOsCrOS, + SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)}, +-- +2.25.1 diff --git a/build/patches/00Add-lifetime-options-for-permissions--win-fixup-.patch b/build/patches/00Add-lifetime-options-for-permissions--win-fixup-.patch new file mode 100644 index 00000000..95ca703f --- /dev/null +++ b/build/patches/00Add-lifetime-options-for-permissions--win-fixup-.patch @@ -0,0 +1,22 @@ +From: Your Name +Date: Wed, 12 Oct 2022 11:52:11 +0000 +Subject: Add lifetime options for permissions (win fixup) + +--- + .../ui/views/permissions/permission_prompt_bubble_view.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chrome/browser/ui/views/permissions/permission_prompt_bubble_view.cc b/chrome/browser/ui/views/permissions/permission_prompt_bubble_view.cc +--- a/chrome/browser/ui/views/permissions/permission_prompt_bubble_view.cc ++++ b/chrome/browser/ui/views/permissions/permission_prompt_bubble_view.cc +@@ -410,7 +410,7 @@ void PermissionPromptBubbleView::AcceptPermission() { + void PermissionPromptBubbleView::AcceptPermissionThisTime() { + RecordDecision(permissions::PermissionAction::GRANTED_ONCE); + if (delegate_) +- delegate_->AcceptThisTime(); ++ delegate_->AcceptThisTime(content_settings::LifetimeMode::Always); + } + + void PermissionPromptBubbleView::DenyPermission() { +-- +2.25.1 diff --git a/build/patches/00Add-webGL-site-setting--win-fixup-.patch b/build/patches/00Add-webGL-site-setting--win-fixup-.patch new file mode 100644 index 00000000..e72a3e51 --- /dev/null +++ b/build/patches/00Add-webGL-site-setting--win-fixup-.patch @@ -0,0 +1,252 @@ +From: Your Name +Date: Thu, 13 Oct 2022 08:12:18 +0000 +Subject: Add webGL site setting (win fixup) + +--- + chrome/app/settings_strings.grdp | 19 ++++++++++++++++ + chrome/browser/resources/settings/icons.html | 2 ++ + .../settings/privacy_page/privacy_page.html | 22 +++++++++++++++++++ + chrome/browser/resources/settings/route.ts | 1 + + .../resources/settings/settings_routes.ts | 1 + + .../site_settings/category_default_setting.ts | 1 + + .../settings/site_settings/constants.ts | 1 + + .../settings_category_default_radio_group.ts | 1 + + .../settings/site_settings/site_details.html | 5 +++++ + .../recent_site_permissions.ts | 2 ++ + .../site_settings_page/site_settings_page.ts | 9 ++++++++ + .../views/page_info/page_info_view_factory.cc | 3 +++ + .../settings_localized_strings_provider.cc | 7 ++++++ + .../ui/webui/settings/site_settings_helper.cc | 1 + + .../core/browser/content_settings_registry.cc | 2 +- + 15 files changed, 76 insertions(+), 1 deletion(-) + +diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp +--- a/chrome/app/settings_strings.grdp ++++ b/chrome/app/settings_strings.grdp +@@ -3715,6 +3715,25 @@ + Random Timezone override + + ++ ++ Webgl ++ ++ ++ Enable Webgl ++ ++ ++ Webgl is enabled ++ ++ ++ Webgl is disabled ++ ++ ++ Allowed to use webgl ++ ++ ++ Not allowed to use webgl ++ ++ + + + +diff --git a/chrome/browser/resources/settings/icons.html b/chrome/browser/resources/settings/icons.html +--- a/chrome/browser/resources/settings/icons.html ++++ b/chrome/browser/resources/settings/icons.html +@@ -174,6 +174,8 @@ NOTE: Chrome OS icons go in ./chromeos/os_icons.html. + + + ++ ++ + + + +diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chrome/browser/resources/settings/privacy_page/privacy_page.html +--- a/chrome/browser/resources/settings/privacy_page/privacy_page.html ++++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html +@@ -1070,4 +1070,26 @@ + + + ++ + +diff --git a/chrome/browser/resources/settings/route.ts b/chrome/browser/resources/settings/route.ts +--- a/chrome/browser/resources/settings/route.ts ++++ b/chrome/browser/resources/settings/route.ts +@@ -105,6 +105,7 @@ function addPrivacyChildRoutes(r: Partial) { + r.SITE_SETTINGS_AUTOPLAY = r.SITE_SETTINGS.createChild('autoplay'); + r.SITE_SETTINGS_JAVASCRIPT_JIT = r.SITE_SETTINGS.createChild('javascript-jit'); + r.SITE_SETTINGS_TIMEZONE_OVERRIDE = r.SITE_SETTINGS.createChild('timezone-override'); ++ r.SITE_SETTINGS_WEBGL = r.SITE_SETTINGS.createChild('webgl'); + } + + /** +diff --git a/chrome/browser/resources/settings/settings_routes.ts b/chrome/browser/resources/settings/settings_routes.ts +--- a/chrome/browser/resources/settings/settings_routes.ts ++++ b/chrome/browser/resources/settings/settings_routes.ts +@@ -98,4 +98,5 @@ export interface SettingsRoutes { + SITE_SETTINGS_AUTOPLAY: Route; + SITE_SETTINGS_JAVASCRIPT_JIT: Route; + SITE_SETTINGS_TIMEZONE_OVERRIDE: Route; ++ SITE_SETTINGS_WEBGL: Route; + } +diff --git a/chrome/browser/resources/settings/site_settings/category_default_setting.ts b/chrome/browser/resources/settings/site_settings/category_default_setting.ts +--- a/chrome/browser/resources/settings/site_settings/category_default_setting.ts ++++ b/chrome/browser/resources/settings/site_settings/category_default_setting.ts +@@ -198,6 +198,7 @@ export class CategoryDefaultSettingElement extends + case ContentSettingsTypes.AUTOPLAY: + case ContentSettingsTypes.JAVASCRIPT_JIT: + case ContentSettingsTypes.TIMEZONE_OVERRIDE: ++ case ContentSettingsTypes.WEBGL: + // "Allowed" vs "Blocked". + this.browserProxy.setDefaultValueForContentType( + this.category, +diff --git a/chrome/browser/resources/settings/site_settings/constants.ts b/chrome/browser/resources/settings/site_settings/constants.ts +--- a/chrome/browser/resources/settings/site_settings/constants.ts ++++ b/chrome/browser/resources/settings/site_settings/constants.ts +@@ -45,6 +45,7 @@ export enum ContentSettingsTypes { + AUTOPLAY = 'autoplay', + JAVASCRIPT_JIT = 'javascript-jit', + TIMEZONE_OVERRIDE = 'timezone-override', ++ WEBGL = 'webgl', + + // The following item is not in the C++ kContentSettingsTypeGroupNames, but it + // is used everywhere where ContentSettingsTypes is used in JS. +diff --git a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts +--- a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts ++++ b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts +@@ -142,6 +142,7 @@ export class SettingsCategoryDefaultRadioGroupElement extends + case ContentSettingsTypes.AUTOPLAY: + case ContentSettingsTypes.JAVASCRIPT_JIT: + case ContentSettingsTypes.TIMEZONE_OVERRIDE: ++ case ContentSettingsTypes.WEBGL: + // "Allowed" vs "Blocked". + return ContentSetting.ALLOW; + case ContentSettingsTypes.AR: +diff --git a/chrome/browser/resources/settings/site_settings/site_details.html b/chrome/browser/resources/settings/site_settings/site_details.html +--- a/chrome/browser/resources/settings/site_settings/site_details.html ++++ b/chrome/browser/resources/settings/site_settings/site_details.html +@@ -238,4 +238,9 @@ + icon="settings:timezone-override" + label="$i18n{siteSettingsTimezoneOverride}"> + ++ ++ + +diff --git a/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts b/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts +--- a/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts ++++ b/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts +@@ -202,6 +202,8 @@ export class SettingsRecentSitePermissionsElement extends + return this.i18n('siteSettingsJavascriptJITMidSentence'); + case ContentSettingsTypes.TIMEZONE_OVERRIDE: + return this.i18n('siteSettingsTimezoneOverrideMidSentence'); ++ case ContentSettingsTypes.WEBGL: ++ return this.i18n('siteSettingsWebglMidSentence'); + default: + return ''; + } +diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts +--- a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts ++++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts +@@ -337,6 +337,14 @@ function getCategoryItemMap(): Map { + enabledLabel: 'siteSettingsTimezoneOverrideAllowed', + disabledLabel: 'siteSettingsTimezoneOverrideBlocked', + }, ++ { ++ route: routes.SITE_SETTINGS_WEBGL, ++ id: Id.WEBGL, ++ label: 'siteSettingsWebgl', ++ icon: 'settings:webgl', ++ enabledLabel: 'siteSettingsWebglAllowed', ++ disabledLabel: 'siteSettingsWebglBlocked', ++ }, + ]; + + categoryItemMap = new Map(categoryList.map(item => [item.id, item])); +@@ -422,6 +430,7 @@ export class SettingsSiteSettingsPageElement extends PolymerElement { + Id.AUTOPLAY, + Id.JAVASCRIPT_JIT, + Id.TIMEZONE_OVERRIDE, ++ Id.WEBGL, + ]), + }; + }, +diff --git a/chrome/browser/ui/views/page_info/page_info_view_factory.cc b/chrome/browser/ui/views/page_info/page_info_view_factory.cc +--- a/chrome/browser/ui/views/page_info/page_info_view_factory.cc ++++ b/chrome/browser/ui/views/page_info/page_info_view_factory.cc +@@ -338,6 +338,9 @@ const ui::ImageModel PageInfoViewFactory::GetPermissionIcon( + case ContentSettingsType::TIMEZONE_OVERRIDE: + icon = &vector_icons::kAccountCircleIcon; + break; ++ case ContentSettingsType::WEBGL: ++ icon = &vector_icons::kProtectedContentIcon; ++ break; + default: + // All other |ContentSettingsType|s do not have icons on desktop or are + // not shown in the Page Info bubble. +diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc ++++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +@@ -2104,6 +2104,13 @@ void AddSiteSettingsStrings(content::WebUIDataSource* html_source, + {"siteSettingsTimezoneOverrideAllowedExceptions",IDS_SETTINGS_SITE_SETTINGS_TIMEZONE_OVERRIDE_ALLOWED_EXCEPTIONS}, + {"siteSettingsTimezoneOverrideBlockedExceptions", IDS_SETTINGS_SITE_SETTINGS_TIMEZONE_OVERRIDE_BLOCKED_EXCEPTIONS}, + {"siteSettingsTimezoneOverrideMidSentence", IDS_SITE_SETTINGS_TIMEZONE_OVERRIDE_TITLE}, ++ {"siteSettingsWebgl", IDS_SITE_SETTINGS_WEBGL_TITLE}, ++ {"siteSettingsWebglDescription", IDS_SETTINGS_SITE_SETTINGS_WEBGL_DESCRIPTION}, ++ {"siteSettingsWebglAllowed", IDS_SETTINGS_SITE_SETTINGS_WEBGL_ALLOWED}, ++ {"siteSettingsWebglBlocked", IDS_SETTINGS_SITE_SETTINGS_WEBGL_BLOCKED}, ++ {"siteSettingsWebglAllowedExceptions",IDS_SETTINGS_SITE_SETTINGS_WEBGL_ALLOWED_EXCEPTIONS}, ++ {"siteSettingsWebglBlockedExceptions", IDS_SETTINGS_SITE_SETTINGS_WEBGL_BLOCKED_EXCEPTIONS}, ++ {"siteSettingsWebglMidSentence", IDS_SITE_SETTINGS_WEBGL_TITLE}, + {"addSite", IDS_SETTINGS_ADD_SITE}, + {"addSiteTitle", IDS_SETTINGS_ADD_SITE_TITLE}, + #if BUILDFLAG(IS_CHROMEOS_ASH) +diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/browser/ui/webui/settings/site_settings_helper.cc +--- a/chrome/browser/ui/webui/settings/site_settings_helper.cc ++++ b/chrome/browser/ui/webui/settings/site_settings_helper.cc +@@ -118,6 +118,7 @@ const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = { + {ContentSettingsType::AUTOPLAY, "autoplay"}, + {ContentSettingsType::JAVASCRIPT_JIT, "javascript-jit"}, + {ContentSettingsType::TIMEZONE_OVERRIDE, "timezone-override"}, ++ {ContentSettingsType::WEBGL, "webgl"}, + + // Add new content settings here if a corresponding Javascript string + // representation for it is not required, for example if the content setting +diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc +--- a/components/content_settings/core/browser/content_settings_registry.cc ++++ b/components/content_settings/core/browser/content_settings_registry.cc +@@ -694,7 +694,7 @@ void ContentSettingsRegistry::Init() { + ValidSettings(CONTENT_SETTING_ALLOW, + CONTENT_SETTING_BLOCK), + WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE, +- WebsiteSettingsRegistry::PLATFORM_ANDROID, ++ WebsiteSettingsRegistry::ALL_PLATFORMS, + ContentSettingsInfo::INHERIT_IN_INCOGNITO, + ContentSettingsInfo::PERSISTENT, + ContentSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS, +-- +2.25.1 diff --git a/build/patches/00Add-webRTC-site-settings--win-fixup-.patch b/build/patches/00Add-webRTC-site-settings--win-fixup-.patch new file mode 100644 index 00000000..8b116892 --- /dev/null +++ b/build/patches/00Add-webRTC-site-settings--win-fixup-.patch @@ -0,0 +1,252 @@ +From: Your Name +Date: Thu, 13 Oct 2022 08:52:11 +0000 +Subject: Add webRTC site settings (win fixup) + +--- + chrome/app/settings_strings.grdp | 19 ++++++++++++++++ + chrome/browser/resources/settings/icons.html | 2 ++ + .../settings/privacy_page/privacy_page.html | 22 +++++++++++++++++++ + chrome/browser/resources/settings/route.ts | 1 + + .../resources/settings/settings_routes.ts | 1 + + .../site_settings/category_default_setting.ts | 1 + + .../settings/site_settings/constants.ts | 1 + + .../settings_category_default_radio_group.ts | 1 + + .../settings/site_settings/site_details.html | 5 +++++ + .../recent_site_permissions.ts | 2 ++ + .../site_settings_page/site_settings_page.ts | 9 ++++++++ + .../views/page_info/page_info_view_factory.cc | 3 +++ + .../settings_localized_strings_provider.cc | 7 ++++++ + .../ui/webui/settings/site_settings_helper.cc | 1 + + .../core/browser/content_settings_registry.cc | 2 +- + 15 files changed, 76 insertions(+), 1 deletion(-) + +diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp +--- a/chrome/app/settings_strings.grdp ++++ b/chrome/app/settings_strings.grdp +@@ -3734,6 +3734,25 @@ + Not allowed to use webgl + + ++ ++ WebRTC ++ ++ ++ Enable WebRTC ++ ++ ++ WebRTC is enabled ++ ++ ++ WebRTC is disabled ++ ++ ++ Allowed to use WebRTC ++ ++ ++ Not allowed to use WebRTC ++ ++ + + + +diff --git a/chrome/browser/resources/settings/icons.html b/chrome/browser/resources/settings/icons.html +--- a/chrome/browser/resources/settings/icons.html ++++ b/chrome/browser/resources/settings/icons.html +@@ -176,6 +176,8 @@ NOTE: Chrome OS icons go in ./chromeos/os_icons.html. + + + ++ ++ + + + +diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chrome/browser/resources/settings/privacy_page/privacy_page.html +--- a/chrome/browser/resources/settings/privacy_page/privacy_page.html ++++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html +@@ -1092,4 +1092,26 @@ + + + ++ + +diff --git a/chrome/browser/resources/settings/route.ts b/chrome/browser/resources/settings/route.ts +--- a/chrome/browser/resources/settings/route.ts ++++ b/chrome/browser/resources/settings/route.ts +@@ -106,6 +106,7 @@ function addPrivacyChildRoutes(r: Partial) { + r.SITE_SETTINGS_JAVASCRIPT_JIT = r.SITE_SETTINGS.createChild('javascript-jit'); + r.SITE_SETTINGS_TIMEZONE_OVERRIDE = r.SITE_SETTINGS.createChild('timezone-override'); + r.SITE_SETTINGS_WEBGL = r.SITE_SETTINGS.createChild('webgl'); ++ r.SITE_SETTINGS_WEBRTC = r.SITE_SETTINGS.createChild('webrtc'); + } + + /** +diff --git a/chrome/browser/resources/settings/settings_routes.ts b/chrome/browser/resources/settings/settings_routes.ts +--- a/chrome/browser/resources/settings/settings_routes.ts ++++ b/chrome/browser/resources/settings/settings_routes.ts +@@ -99,4 +99,5 @@ export interface SettingsRoutes { + SITE_SETTINGS_JAVASCRIPT_JIT: Route; + SITE_SETTINGS_TIMEZONE_OVERRIDE: Route; + SITE_SETTINGS_WEBGL: Route; ++ SITE_SETTINGS_WEBRTC: Route; + } +diff --git a/chrome/browser/resources/settings/site_settings/category_default_setting.ts b/chrome/browser/resources/settings/site_settings/category_default_setting.ts +--- a/chrome/browser/resources/settings/site_settings/category_default_setting.ts ++++ b/chrome/browser/resources/settings/site_settings/category_default_setting.ts +@@ -199,6 +199,7 @@ export class CategoryDefaultSettingElement extends + case ContentSettingsTypes.JAVASCRIPT_JIT: + case ContentSettingsTypes.TIMEZONE_OVERRIDE: + case ContentSettingsTypes.WEBGL: ++ case ContentSettingsTypes.WEBRTC: + // "Allowed" vs "Blocked". + this.browserProxy.setDefaultValueForContentType( + this.category, +diff --git a/chrome/browser/resources/settings/site_settings/constants.ts b/chrome/browser/resources/settings/site_settings/constants.ts +--- a/chrome/browser/resources/settings/site_settings/constants.ts ++++ b/chrome/browser/resources/settings/site_settings/constants.ts +@@ -46,6 +46,7 @@ export enum ContentSettingsTypes { + JAVASCRIPT_JIT = 'javascript-jit', + TIMEZONE_OVERRIDE = 'timezone-override', + WEBGL = 'webgl', ++ WEBRTC = 'webrtc', + + // The following item is not in the C++ kContentSettingsTypeGroupNames, but it + // is used everywhere where ContentSettingsTypes is used in JS. +diff --git a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts +--- a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts ++++ b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts +@@ -143,6 +143,7 @@ export class SettingsCategoryDefaultRadioGroupElement extends + case ContentSettingsTypes.JAVASCRIPT_JIT: + case ContentSettingsTypes.TIMEZONE_OVERRIDE: + case ContentSettingsTypes.WEBGL: ++ case ContentSettingsTypes.WEBRTC: + // "Allowed" vs "Blocked". + return ContentSetting.ALLOW; + case ContentSettingsTypes.AR: +diff --git a/chrome/browser/resources/settings/site_settings/site_details.html b/chrome/browser/resources/settings/site_settings/site_details.html +--- a/chrome/browser/resources/settings/site_settings/site_details.html ++++ b/chrome/browser/resources/settings/site_settings/site_details.html +@@ -243,4 +243,9 @@ + icon="settings:webgl" + label="$i18n{siteSettingsWebgl}"> + ++ ++ + +diff --git a/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts b/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts +--- a/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts ++++ b/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts +@@ -204,6 +204,8 @@ export class SettingsRecentSitePermissionsElement extends + return this.i18n('siteSettingsTimezoneOverrideMidSentence'); + case ContentSettingsTypes.WEBGL: + return this.i18n('siteSettingsWebglMidSentence'); ++ case ContentSettingsTypes.WEBRTC: ++ return this.i18n('siteSettingsWebRTCMidSentence'); + default: + return ''; + } +diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts +--- a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts ++++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts +@@ -345,6 +345,14 @@ function getCategoryItemMap(): Map { + enabledLabel: 'siteSettingsWebglAllowed', + disabledLabel: 'siteSettingsWebglBlocked', + }, ++ { ++ route: routes.SITE_SETTINGS_WEBRTC, ++ id: Id.WEBRTC, ++ label: 'siteSettingsWebRTC', ++ icon: 'settings:webrtc', ++ enabledLabel: 'siteSettingsWebRTCAllowed', ++ disabledLabel: 'siteSettingsWebRTCBlocked', ++ }, + ]; + + categoryItemMap = new Map(categoryList.map(item => [item.id, item])); +@@ -431,6 +439,7 @@ export class SettingsSiteSettingsPageElement extends PolymerElement { + Id.JAVASCRIPT_JIT, + Id.TIMEZONE_OVERRIDE, + Id.WEBGL, ++ Id.WEBRTC, + ]), + }; + }, +diff --git a/chrome/browser/ui/views/page_info/page_info_view_factory.cc b/chrome/browser/ui/views/page_info/page_info_view_factory.cc +--- a/chrome/browser/ui/views/page_info/page_info_view_factory.cc ++++ b/chrome/browser/ui/views/page_info/page_info_view_factory.cc +@@ -341,6 +341,9 @@ const ui::ImageModel PageInfoViewFactory::GetPermissionIcon( + case ContentSettingsType::WEBGL: + icon = &vector_icons::kProtectedContentIcon; + break; ++ case ContentSettingsType::WEBRTC: ++ icon = &vector_icons::kProtectedContentIcon; ++ break; + default: + // All other |ContentSettingsType|s do not have icons on desktop or are + // not shown in the Page Info bubble. +diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc ++++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +@@ -2111,6 +2111,13 @@ void AddSiteSettingsStrings(content::WebUIDataSource* html_source, + {"siteSettingsWebglAllowedExceptions",IDS_SETTINGS_SITE_SETTINGS_WEBGL_ALLOWED_EXCEPTIONS}, + {"siteSettingsWebglBlockedExceptions", IDS_SETTINGS_SITE_SETTINGS_WEBGL_BLOCKED_EXCEPTIONS}, + {"siteSettingsWebglMidSentence", IDS_SITE_SETTINGS_WEBGL_TITLE}, ++ {"siteSettingsWebRTC", IDS_SITE_SETTINGS_WEBRTC_TITLE}, ++ {"siteSettingsWebRTCDescription", IDS_SETTINGS_SITE_SETTINGS_WEBRTC_DESCRIPTION}, ++ {"siteSettingsWebRTCAllowed", IDS_SETTINGS_SITE_SETTINGS_WEBRTC_ALLOWED}, ++ {"siteSettingsWebRTCBlocked", IDS_SETTINGS_SITE_SETTINGS_WEBRTC_BLOCKED}, ++ {"siteSettingsWebRTCAllowedExceptions",IDS_SETTINGS_SITE_SETTINGS_WEBRTC_ALLOWED_EXCEPTIONS}, ++ {"siteSettingsWebRTCBlockedExceptions", IDS_SETTINGS_SITE_SETTINGS_WEBRTC_BLOCKED_EXCEPTIONS}, ++ {"siteSettingsWebRTCMidSentence", IDS_SITE_SETTINGS_WEBRTC_TITLE}, + {"addSite", IDS_SETTINGS_ADD_SITE}, + {"addSiteTitle", IDS_SETTINGS_ADD_SITE_TITLE}, + #if BUILDFLAG(IS_CHROMEOS_ASH) +diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/browser/ui/webui/settings/site_settings_helper.cc +--- a/chrome/browser/ui/webui/settings/site_settings_helper.cc ++++ b/chrome/browser/ui/webui/settings/site_settings_helper.cc +@@ -119,6 +119,7 @@ const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = { + {ContentSettingsType::JAVASCRIPT_JIT, "javascript-jit"}, + {ContentSettingsType::TIMEZONE_OVERRIDE, "timezone-override"}, + {ContentSettingsType::WEBGL, "webgl"}, ++ {ContentSettingsType::WEBRTC, "webrtc"}, + + // Add new content settings here if a corresponding Javascript string + // representation for it is not required, for example if the content setting +diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc +--- a/components/content_settings/core/browser/content_settings_registry.cc ++++ b/components/content_settings/core/browser/content_settings_registry.cc +@@ -708,7 +708,7 @@ void ContentSettingsRegistry::Init() { + ValidSettings(CONTENT_SETTING_ALLOW, + CONTENT_SETTING_BLOCK), + WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE, +- WebsiteSettingsRegistry::PLATFORM_ANDROID, ++ WebsiteSettingsRegistry::ALL_PLATFORMS, + ContentSettingsInfo::INHERIT_IN_INCOGNITO, + ContentSettingsInfo::PERSISTENT, + ContentSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS, +-- +2.25.1 diff --git a/build/patches/00Client-hints-overrides--win-fixup-.patch b/build/patches/00Client-hints-overrides--win-fixup-.patch new file mode 100644 index 00000000..ab5a7eb0 --- /dev/null +++ b/build/patches/00Client-hints-overrides--win-fixup-.patch @@ -0,0 +1,26 @@ +From: Your Name +Date: Thu, 13 Oct 2022 10:33:34 +0000 +Subject: Client hints overrides (win fixup) + +--- + content/common/user_agent.cc | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/content/common/user_agent.cc b/content/common/user_agent.cc +--- a/content/common/user_agent.cc ++++ b/content/common/user_agent.cc +@@ -323,7 +323,11 @@ std::string BuildUserAgentFromProduct(const std::string& product) { + } + + std::string BuildModelInfo() { +- return "SAMSUNG SM-G960U"; ++ std::string model; ++#if BUILDFLAG(IS_ANDROID) ++ model = "SAMSUNG SM-G960U" ++#endif ++ return model; + } + + #if BUILDFLAG(IS_ANDROID) +-- +2.25.1 diff --git a/build/patches/00Content-settings-infrastructure--win-fixup-.patch b/build/patches/00Content-settings-infrastructure--win-fixup-.patch new file mode 100644 index 00000000..5a1ebf9e --- /dev/null +++ b/build/patches/00Content-settings-infrastructure--win-fixup-.patch @@ -0,0 +1,21 @@ +From: Your Name +Date: Thu, 13 Oct 2022 10:26:13 +0000 +Subject: Content settings infrastructure (win fixup) + +--- + components/content_settings/core/common/content_settings.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/components/content_settings/core/common/content_settings.cc b/components/content_settings/core/common/content_settings.cc +--- a/components/content_settings/core/common/content_settings.cc ++++ b/components/content_settings/core/common/content_settings.cc +@@ -129,6 +129,7 @@ ContentSetting IntToContentSetting(int content_setting) { + int ContentSettingTypeToHistogramValue(ContentSettingsType content_setting, + size_t* num_values) { + *num_values = std::size(kHistogramValue); ++ if ((true)) return 0; + + // Verify the array is sorted by enum type and contains all values. + DCHECK(std::is_sorted(std::begin(kHistogramValue), std::end(kHistogramValue), +-- +2.25.1 diff --git a/build/patches/00Disable-requests-for-single-word-Omni--win-fixup-.patch b/build/patches/00Disable-requests-for-single-word-Omni--win-fixup-.patch new file mode 100644 index 00000000..d3ca192d --- /dev/null +++ b/build/patches/00Disable-requests-for-single-word-Omni--win-fixup-.patch @@ -0,0 +1,29 @@ +From: Your Name +Date: Wed, 12 Oct 2022 12:02:16 +0000 +Subject: Disable requests for single-word Omni (win fixup) + +--- + chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc +--- a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc ++++ b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc +@@ -76,6 +76,7 @@ bool OnlyChangeIsFromHTTPToHTTPS(const GURL& origin, const GURL& destination) { + return origin_with_https == destination; + } + ++#if BUILDFLAG(IS_ANDROID) + // Choose the appropriate URLLoaderFactory: either an explicitly specified or a + // default for the given profile. + network::mojom::URLLoaderFactory* GetURLLoaderFactory( +@@ -87,6 +88,7 @@ network::mojom::URLLoaderFactory* GetURLLoaderFactory( + ->GetURLLoaderFactoryForBrowserProcess() + .get(); + } ++#endif + + // Helper to keep ChromeOmniboxNavigationObserver alive while the initiated + // navigation is pending. +-- +2.25.1 diff --git a/build/patches/00Disable-safe-browsing--win-fixup-.patch b/build/patches/00Disable-safe-browsing--win-fixup-.patch new file mode 100644 index 00000000..43a9e7c0 --- /dev/null +++ b/build/patches/00Disable-safe-browsing--win-fixup-.patch @@ -0,0 +1,1437 @@ +From: Your Name +Date: Wed, 12 Oct 2022 09:52:02 +0000 +Subject: Disable safe browsing (win fixup) + +--- + chrome/browser/BUILD.gn | 14 +- + .../accuracy_tips/accuracy_service_factory.cc | 6 +- + .../chrome_browsing_data_remover_delegate.cc | 2 - + chrome/browser/chrome_browser_main_win.cc | 6 - + .../bubble/download_bubble_controller.cc | 2 + + .../chrome_download_manager_delegate.cc | 4 +- + .../browser/download/download_item_model.cc | 2 + + .../analysis/content_analysis_delegate.cc | 163 +----------------- + .../analysis/content_analysis_delegate.h | 7 - + .../analysis/request_handler_base.cc | 13 -- + .../reporting/realtime_reporting_client.cc | 2 +- + chrome/browser/extensions/BUILD.gn | 5 - + .../safe_browsing_private_api.cc | 3 +- + .../safe_browsing_private_event_router.cc | 43 ++--- + .../webstore_private/webstore_private_api.cc | 15 +- + .../extensions/blocklist_state_fetcher.cc | 13 +- + .../chrome_extensions_browser_client.cc | 28 +-- + .../browser/extensions/extension_allowlist.cc | 9 - + .../webrtc/display_media_access_handler.cc | 1 - + .../safe_browsing/safe_browsing_handler.cc | 5 +- + .../safe_browsing/safe_browsing_handler.h | 3 - + .../notification_display_service_impl.cc | 7 - + ...nfiguration_policy_handler_list_factory.cc | 7 - + chrome/browser/prefs/browser_prefs.cc | 2 + + chrome/browser/printing/print_view_manager.cc | 14 -- + chrome/browser/profiles/profiles_state.cc | 2 - + chrome/browser/safe_browsing/BUILD.gn | 8 +- + .../safe_browsing/chrome_cleaner/BUILD.gn | 1 - + .../chrome_cleaner/settings_resetter_win.cc | 1 - + .../download_protection/file_analyzer.h | 15 -- + .../chrome_security_blocking_page_factory.cc | 21 --- + chrome/browser/ui/BUILD.gn | 6 - + ...b_modal_dialog_manager_delegate_desktop.cc | 1 - + .../ui/page_info/chrome_page_info_delegate.cc | 1 - + .../ui/views/download/download_item_view.cc | 23 +-- + .../webui/downloads/downloads_dom_handler.cc | 12 +- + .../ui/webui/downloads/downloads_ui.cc | 5 +- + chrome/browser/webshare/share_service_impl.cc | 4 + + .../public/cpp/sandboxed_rar_analyzer.cc | 16 +- + .../public/cpp/sandboxed_rar_analyzer.h | 2 - + .../public/cpp/sandboxed_zip_analyzer.h | 2 - + chrome/test/BUILD.gn | 5 - + .../browser/mojo_safe_browsing_impl.cc | 1 + + .../core/common/safe_browsing_prefs.cc | 2 +- + .../tracked_persistent_pref_store_factory.cc | 10 +- + 45 files changed, 48 insertions(+), 466 deletions(-) + +diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn +--- a/chrome/browser/BUILD.gn ++++ b/chrome/browser/BUILD.gn +@@ -1918,10 +1918,6 @@ static_library("browser") { + "//chrome/browser/ui", + "//chrome/browser/ui/webui/bluetooth_internals", + "//chrome/browser/storage_access_api:permissions", +- "//chrome/browser/safe_browsing", +- "//chrome/browser/safe_browsing:verdict_cache_manager_factory", +- "//chrome/browser/safe_browsing:advanced_protection", +- "//chrome/browser/safe_browsing:metrics_collector", + + # TODO(crbug.com/1030821): Eliminate usages of browser.h from Media Router. + "//chrome/browser/media/router", +@@ -2011,10 +2007,7 @@ static_library("browser") { + "//chrome/browser/push_messaging:budget_proto", + "//chrome/browser/resource_coordinator:mojo_bindings", + "//chrome/browser/resource_coordinator:tab_manager_features", +- "//chrome/browser/safe_browsing", +- "//chrome/browser/safe_browsing:advanced_protection", +- "//chrome/browser/safe_browsing:metrics_collector", +- "//chrome/browser/safe_browsing:verdict_cache_manager_factory", ++ "//components/safe_browsing/content/common:interfaces", + "//chrome/browser/share", + "//chrome/browser/sharing:buildflags", + "//chrome/browser/sharing/proto", +@@ -3723,10 +3716,6 @@ static_library("browser") { + "enterprise/connectors/analysis/content_analysis_dialog.h", + "enterprise/connectors/analysis/content_analysis_downloads_delegate.cc", + "enterprise/connectors/analysis/content_analysis_downloads_delegate.h", +- "enterprise/connectors/analysis/files_request_handler.cc", +- "enterprise/connectors/analysis/files_request_handler.h", +- "enterprise/connectors/analysis/page_print_analysis_request.cc", +- "enterprise/connectors/analysis/page_print_analysis_request.h", + "enterprise/connectors/analysis/request_handler_base.cc", + "enterprise/connectors/analysis/request_handler_base.h", + "enterprise/connectors/common.cc", +@@ -8121,7 +8110,6 @@ static_library("test_support") { + public_deps = [ + ":browser", + "//chrome/browser/profiles:profile", +- "//chrome/browser/safe_browsing:test_support", + "//chrome/browser/ui:test_support", + ] + deps = [ +diff --git a/chrome/browser/accuracy_tips/accuracy_service_factory.cc b/chrome/browser/accuracy_tips/accuracy_service_factory.cc +--- a/chrome/browser/accuracy_tips/accuracy_service_factory.cc ++++ b/chrome/browser/accuracy_tips/accuracy_service_factory.cc +@@ -45,15 +45,11 @@ KeyedService* AccuracyServiceFactory::BuildServiceInstanceFor( + content::BrowserContext* browser_context) const { + DCHECK(base::FeatureList::IsEnabled(safe_browsing::kAccuracyTipsFeature)); + Profile* profile = Profile::FromBrowserContext(browser_context); +- auto sb_database = +- g_browser_process->safe_browsing_service() +- ? g_browser_process->safe_browsing_service()->database_manager() +- : nullptr; + auto* history_service = HistoryServiceFactory::GetForProfile( + profile, ServiceAccessType::IMPLICIT_ACCESS); + auto delegate = std::make_unique(profile); + return new accuracy_tips::AccuracyService( +- std::move(delegate), profile->GetPrefs(), std::move(sb_database), ++ std::move(delegate), profile->GetPrefs(), nullptr, + history_service, content::GetUIThreadTaskRunner({}), + content::GetIOThreadTaskRunner({})); + } +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 +@@ -653,8 +653,6 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData( + base::BindOnce( + &ChromeBrowsingDataRemoverDelegate::CreateTaskCompletionClosure, + base::Unretained(this), TracingDataType::kCookies)); +- safe_browsing::VerdictCacheManagerFactory::GetForProfile(profile_) +- ->OnCookiesDeleted(); + } + + if (filter_builder->GetMode() == +diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc +--- a/chrome/browser/chrome_browser_main_win.cc ++++ b/chrome/browser/chrome_browser_main_win.cc +@@ -395,12 +395,6 @@ void ShowCloseBrowserFirstMessageBox() { + } + + void MaybePostSettingsResetPrompt() { +- if (base::FeatureList::IsEnabled(safe_browsing::kSettingsResetPrompt)) { +- content::GetUIThreadTaskRunner({base::TaskPriority::BEST_EFFORT}) +- ->PostTask(FROM_HERE, +- base::BindOnce( +- safe_browsing::MaybeShowSettingsResetPromptWithDelay)); +- } + } + + // Updates all Progressive Web App launchers in |profile_dir| to the latest +diff --git a/chrome/browser/download/bubble/download_bubble_controller.cc b/chrome/browser/download/bubble/download_bubble_controller.cc +--- a/chrome/browser/download/bubble/download_bubble_controller.cc ++++ b/chrome/browser/download/bubble/download_bubble_controller.cc +@@ -400,8 +400,10 @@ void DownloadBubbleUIController::ProcessDownloadButtonPress( + ProcessDownloadWarningButtonPress(model, command); + break; + case DownloadCommands::REVIEW: ++#if BUILDFLAG(FULL_SAFE_BROWSING) + model->ReviewScanningVerdict( + browser_->tab_strip_model()->GetActiveWebContents()); ++#endif + break; + case DownloadCommands::RETRY: + RetryDownload(model, command); +diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc +--- a/chrome/browser/download/chrome_download_manager_delegate.cc ++++ b/chrome/browser/download/chrome_download_manager_delegate.cc +@@ -1717,8 +1717,8 @@ void ChromeDownloadManagerDelegate::CheckSavePackageAllowed( + DCHECK(download_item); + DCHECK(download_item->IsSavePackageDownload()); + +-#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ +- BUILDFLAG(IS_MAC) ++#if (BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \ ++ BUILDFLAG(IS_MAC)) && BUILDFLAG(FULL_SAFE_BROWSING) + absl::optional settings = + safe_browsing::DeepScanningRequest::ShouldUploadBinary(download_item); + +diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc +--- a/chrome/browser/download/download_item_model.cc ++++ b/chrome/browser/download/download_item_model.cc +@@ -885,6 +885,7 @@ void DownloadItemModel::ExecuteCommand(DownloadCommands* download_commands, + DownloadUIModel::ExecuteCommand(download_commands, command); + break; + case DownloadCommands::DEEP_SCAN: ++#if BUILDFLAG(FULL_SAFE_BROWSING) + safe_browsing::SafeBrowsingService* sb_service = + g_browser_process->safe_browsing_service(); + if (!sb_service) +@@ -917,6 +918,7 @@ void DownloadItemModel::ExecuteCommand(DownloadCommands* download_commands, + safe_browsing::DeepScanningRequest::DeepScanTrigger:: + TRIGGER_APP_PROMPT, + safe_browsing::DownloadCheckResult::UNKNOWN, std::move(settings)); ++#endif + break; + } + } +diff --git a/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc b/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc +--- a/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc ++++ b/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc +@@ -97,15 +97,9 @@ StringAnalysisRequest::StringAnalysisRequest( + data_.contents = std::move(text); + result_ = BinaryUploadService::Result::SUCCESS; + } +- safe_browsing::IncrementCrashKey( +- safe_browsing::ScanningCrashKey::PENDING_TEXT_UPLOADS); +- safe_browsing::IncrementCrashKey( +- safe_browsing::ScanningCrashKey::TOTAL_TEXT_UPLOADS); + } + + StringAnalysisRequest::~StringAnalysisRequest() { +- safe_browsing::DecrementCrashKey( +- safe_browsing::ScanningCrashKey::PENDING_TEXT_UPLOADS); + } + + void StringAnalysisRequest::GetRequestData(DataCallback callback) { +@@ -117,25 +111,6 @@ bool* UIEnabledStorage() { + return &enabled; + } + +-ContentAnalysisAcknowledgement::FinalAction GetFinalAction( +- FinalContentAnalysisResult final_result) { +- auto final_action = ContentAnalysisAcknowledgement::ALLOW; +- switch (final_result) { +- case FinalContentAnalysisResult::FAILURE: +- case FinalContentAnalysisResult::LARGE_FILES: +- case FinalContentAnalysisResult::ENCRYPTED_FILES: +- final_action = ContentAnalysisAcknowledgement::BLOCK; +- break; +- case FinalContentAnalysisResult::WARNING: +- final_action = ContentAnalysisAcknowledgement::WARN; +- break; +- case FinalContentAnalysisResult::SUCCESS: +- break; +- } +- +- return final_action; +-} +- + } // namespace + + ContentAnalysisDelegate::Data::Data() = default; +@@ -156,15 +131,6 @@ void ContentAnalysisDelegate::BypassWarnings( + // Mark the full text as complying and report a warning bypass. + if (text_warning_) { + std::fill(result_.text_results.begin(), result_.text_results.end(), true); +- +- int64_t content_size = 0; +- for (const std::string& entry : data_.text) +- content_size += entry.size(); +- +- ReportAnalysisConnectorWarningBypass( +- profile_, url_, "Text data", std::string(), "text/plain", +- extensions::SafeBrowsingPrivateEventRouter::kTriggerWebContentUpload, +- access_point_, content_size, text_response_, user_justification); + } + + if (!warned_file_indices_.empty()) { +@@ -178,12 +144,6 @@ void ContentAnalysisDelegate::BypassWarnings( + // Mark the printed page as complying and report a warning bypass. + if (page_warning_) { + result_.page_result = true; +- +- ReportAnalysisConnectorWarningBypass( +- profile_, url_, title_, /*sha256*/ std::string(), +- /*mime_type*/ std::string(), +- extensions::SafeBrowsingPrivateEventRouter::kTriggerPagePrint, +- access_point_, /*content_size*/ -1, page_response_, user_justification); + } + + RunCallback(); +@@ -193,14 +153,6 @@ void ContentAnalysisDelegate::Cancel(bool warning) { + if (callback_.is_null()) + return; + +- // Don't report this upload as cancelled if the user didn't bypass the +- // warning. +- if (!warning) { +- RecordDeepScanMetrics(access_point_, +- base::TimeTicks::Now() - upload_start_time_, 0, +- "CancelledByUser", false); +- } +- + // Make sure to reject everything. + FillAllResultsWith(false); + RunCallback(); +@@ -346,8 +298,7 @@ ContentAnalysisDelegate::ContentAnalysisDelegate( + CompletionCallback callback, + safe_browsing::DeepScanAccessPoint access_point) + : data_(std::move(data)), +- callback_(std::move(callback)), +- access_point_(access_point) { ++ callback_(std::move(callback)) { + DCHECK(web_contents); + profile_ = Profile::FromBrowserContext(web_contents->GetBrowserContext()); + url_ = web_contents->GetLastCommittedURL(); +@@ -364,13 +315,6 @@ void ContentAnalysisDelegate::StringRequestCallback( + if (result == safe_browsing::BinaryUploadService::Result::SUCCESS) + request_tokens_.push_back(response.request_token()); + +- int64_t content_size = 0; +- for (const std::string& entry : data_.text) +- content_size += entry.size(); +- RecordDeepScanMetrics(access_point_, +- base::TimeTicks::Now() - upload_start_time_, +- content_size, result, response); +- + text_request_complete_ = true; + + RequestHandlerResult request_handler_result = +@@ -383,12 +327,6 @@ void ContentAnalysisDelegate::StringRequestCallback( + std::fill(result_.text_results.begin(), result_.text_results.end(), + text_complies); + +- MaybeReportDeepScanningVerdict( +- profile_, url_, "Text data", std::string(), "text/plain", +- extensions::SafeBrowsingPrivateEventRouter::kTriggerWebContentUpload, +- access_point_, content_size, result, response, +- CalculateEventResult(data_.settings, text_complies, should_warn)); +- + UpdateFinalResult(request_handler_result.final_result, + request_handler_result.tag); + +@@ -448,10 +386,6 @@ void ContentAnalysisDelegate::PageRequestCallback( + if (result == safe_browsing::BinaryUploadService::Result::SUCCESS) + request_tokens_.push_back(response.request_token()); + +- RecordDeepScanMetrics(access_point_, +- base::TimeTicks::Now() - upload_start_time_, +- page_size_bytes_, result, response); +- + page_request_complete_ = true; + + RequestHandlerResult request_handler_result = +@@ -461,13 +395,6 @@ void ContentAnalysisDelegate::PageRequestCallback( + bool should_warn = request_handler_result.final_result == + FinalContentAnalysisResult::WARNING; + +- MaybeReportDeepScanningVerdict( +- profile_, url_, title_, /*sha256*/ std::string(), +- /*mime_type*/ std::string(), +- extensions::SafeBrowsingPrivateEventRouter::kTriggerPagePrint, +- access_point_, /*content_size*/ -1, result, response, +- CalculateEventResult(data_.settings, result_.page_result, should_warn)); +- + UpdateFinalResult(request_handler_result.final_result, + request_handler_result.tag); + +@@ -486,19 +413,7 @@ bool ContentAnalysisDelegate::UploadData() { + PrepareTextRequest(); + PreparePageRequest(); + +- if (!data_.paths.empty()) { +- // Passing the settings using a reference is safe here, because +- // MultiFileRequestHandler is owned by this class. +- files_request_handler_ = FilesRequestHandler::Create( +- GetBinaryUploadService(), profile_, data_.settings, url_, access_point_, +- data_.paths, +- base::BindOnce(&ContentAnalysisDelegate::FilesRequestCallback, +- GetWeakPtr())); +- files_request_complete_ = !files_request_handler_->UploadData(); +- } else { +- // If no files should be uploaded, the file request is complete. +- files_request_complete_ = true; +- } ++ files_request_complete_ = true; + data_uploaded_ = true; + // Do not add code under this comment. The above line should be the last thing + // this function does before the return statement. +@@ -508,70 +423,14 @@ bool ContentAnalysisDelegate::UploadData() { + } + + void ContentAnalysisDelegate::PrepareTextRequest() { +- std::string full_text; +- for (const std::string& text : data_.text) +- full_text.append(text); +- +- // The request is considered complete if there is no text or if the text is +- // too small compared to the minimum size. This means a minimum_data_size of +- // 0 is equivalent to no minimum, as the second part of the "or" will always +- // be false. +- text_request_complete_ = +- full_text.empty() || full_text.size() < data_.settings.minimum_data_size; +- +- if (!full_text.empty()) { +- base::UmaHistogramCustomCounts("Enterprise.OnBulkDataEntry.DataSize", +- full_text.size(), +- /*min=*/1, +- /*max=*/51 * 1024 * 1024, +- /*buckets=*/50); +- } +- +- if (!text_request_complete_) { +- auto request = std::make_unique( +- data_.settings.cloud_or_local_settings, std::move(full_text), +- base::BindOnce(&ContentAnalysisDelegate::StringRequestCallback, +- weak_ptr_factory_.GetWeakPtr())); +- +- PrepareRequest(enterprise_connectors::BULK_DATA_ENTRY, request.get()); +- UploadTextForDeepScanning(std::move(request)); +- } + } + + void ContentAnalysisDelegate::PreparePageRequest() { +- // The request is considered complete if the mapped region is invalid since it +- // prevents scanning. +- page_request_complete_ = !data_.page.IsValid(); +- +- if (!page_request_complete_) { +- page_size_bytes_ = data_.page.GetSize(); +- auto request = std::make_unique( +- data_.settings, std::move(data_.page), +- base::BindOnce(&ContentAnalysisDelegate::PageRequestCallback, +- weak_ptr_factory_.GetWeakPtr())); +- +- PrepareRequest(enterprise_connectors::PRINT, request.get()); +- request->set_filename(title_); +- UploadPageForDeepScanning(std::move(request)); +- } + } + + void ContentAnalysisDelegate::PrepareRequest( + enterprise_connectors::AnalysisConnector connector, + BinaryUploadService::Request* request) { +- if (data_.settings.cloud_or_local_settings.is_cloud_analysis()) { +- request->set_device_token( +- data_.settings.cloud_or_local_settings.dm_token()); +- } +- request->set_analysis_connector(connector); +- request->set_email(safe_browsing::GetProfileEmail(profile_)); +- request->set_url(data_.url.spec()); +- request->set_tab_url(data_.url); +- request->set_per_profile_request(data_.settings.per_profile); +- for (const auto& tag : data_.settings.tags) +- request->add_tag(tag.first); +- if (data_.settings.client_metadata) +- request->set_client_metadata(*data_.settings.client_metadata); + } + + void ContentAnalysisDelegate::FillAllResultsWith(bool status) { +@@ -581,8 +440,7 @@ void ContentAnalysisDelegate::FillAllResultsWith(bool status) { + } + + BinaryUploadService* ContentAnalysisDelegate::GetBinaryUploadService() { +- return safe_browsing::BinaryUploadService::GetForProfile(profile_, +- data_.settings); ++ return nullptr; + } + + void ContentAnalysisDelegate::UploadTextForDeepScanning( +@@ -642,21 +500,6 @@ void ContentAnalysisDelegate::UpdateFinalResult( + } + + void ContentAnalysisDelegate::AckAllRequests() { +- BinaryUploadService* upload_service = GetBinaryUploadService(); +- if (!upload_service) +- return; +- +- // Calculate final action applied to all requests. +- auto final_action = GetFinalAction(final_result_); +- +- for (auto& token : request_tokens_) { +- auto ack = std::make_unique( +- data_.settings.cloud_or_local_settings); +- ack->set_request_token(token); +- ack->set_status(ContentAnalysisAcknowledgement::SUCCESS); +- ack->set_final_action(final_action); +- upload_service->MaybeAcknowledge(std::move(ack)); +- } + } + + } // namespace enterprise_connectors +diff --git a/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.h b/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.h +--- a/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.h ++++ b/chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.h +@@ -307,10 +307,6 @@ class ContentAnalysisDelegate : public ContentAnalysisDelegateBase { + bool page_warning_ = false; + enterprise_connectors::ContentAnalysisResponse page_response_; + +- // Stores the scanned page's size since it moves from `data_` to be uploaded. +- // TODO(crbug.com/1324892): Move to PageRequestHandler. +- int64_t page_size_bytes_ = 0; +- + // Set to true once the scan of text has completed. If the scan request has + // no text requiring deep scanning, this is set to true immediately. + bool text_request_complete_ = false; +@@ -330,9 +326,6 @@ class ContentAnalysisDelegate : public ContentAnalysisDelegateBase { + // Pointer to UI when enabled. + raw_ptr dialog_ = nullptr; + +- // Access point to use to record UMA metrics. +- safe_browsing::DeepScanAccessPoint access_point_; +- + // Scanning result to be shown to the user once every request is done. + FinalContentAnalysisResult final_result_ = + FinalContentAnalysisResult::SUCCESS; +diff --git a/chrome/browser/enterprise/connectors/analysis/request_handler_base.cc b/chrome/browser/enterprise/connectors/analysis/request_handler_base.cc +--- a/chrome/browser/enterprise/connectors/analysis/request_handler_base.cc ++++ b/chrome/browser/enterprise/connectors/analysis/request_handler_base.cc +@@ -37,19 +37,6 @@ void RequestHandlerBase::AppendRequestTokensTo( + void RequestHandlerBase::PrepareRequest( + enterprise_connectors::AnalysisConnector connector, + safe_browsing::BinaryUploadService::Request* request) { +- if (analysis_settings_.cloud_or_local_settings.is_cloud_analysis()) { +- request->set_device_token( +- analysis_settings_.cloud_or_local_settings.dm_token()); +- } +- request->set_analysis_connector(connector); +- request->set_email(safe_browsing::GetProfileEmail(profile_)); +- request->set_url(url_.spec()); +- request->set_tab_url(url_); +- request->set_per_profile_request(analysis_settings_.per_profile); +- for (const auto& tag : analysis_settings_.tags) +- request->add_tag(tag.first); +- if (analysis_settings_.client_metadata) +- request->set_client_metadata(*analysis_settings_.client_metadata); + } + + safe_browsing::BinaryUploadService* +diff --git a/chrome/browser/enterprise/connectors/reporting/realtime_reporting_client.cc b/chrome/browser/enterprise/connectors/reporting/realtime_reporting_client.cc +--- a/chrome/browser/enterprise/connectors/reporting/realtime_reporting_client.cc ++++ b/chrome/browser/enterprise/connectors/reporting/realtime_reporting_client.cc +@@ -383,7 +383,7 @@ void RealtimeReportingClient::ReportRealtimeEvent( + } + + std::string RealtimeReportingClient::GetProfileUserName() const { +- return safe_browsing::GetProfileEmail(identity_manager_); ++ return ""; + } + + #if BUILDFLAG(IS_CHROMEOS_ASH) +diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn +--- a/chrome/browser/extensions/BUILD.gn ++++ b/chrome/browser/extensions/BUILD.gn +@@ -746,9 +746,6 @@ static_library("extensions") { + + # TODO(crbug.com/1065748): Remove this circular dependency. + "//chrome/browser/web_applications/extensions", +- +- # TODO(crbug/925153): Remove this circular dependency. +- "//chrome/browser/safe_browsing", + ] + + # Since browser and browser_extensions actually depend on each other, +@@ -797,8 +794,6 @@ static_library("extensions") { + "//chrome/browser/profiles:profile", + "//chrome/browser/resource_coordinator:intervention_policy_database_proto", + "//chrome/browser/resource_coordinator:mojo_bindings", +- "//chrome/browser/safe_browsing", +- "//chrome/browser/safe_browsing:metrics_collector", + "//chrome/browser/ui/tabs:tab_enums", + "//chrome/browser/web_applications", + "//components/adblock/content:browser", +diff --git a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_api.cc b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_api.cc +--- a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_api.cc ++++ b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_api.cc +@@ -55,8 +55,7 @@ SafeBrowsingPrivateGetReferrerChainFunction::Run() { + } + + Profile* profile = Profile::FromBrowserContext(browser_context()); +- if (!SafeBrowsingNavigationObserverManager::IsEnabledAndReady( +- profile->GetPrefs(), g_browser_process->safe_browsing_service())) ++ if ((true)) + return RespondNow(NoArguments()); + + SafeBrowsingNavigationObserverManager* navigation_observer_manager = +diff --git a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc +--- a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc ++++ b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc +@@ -300,10 +300,7 @@ void SafeBrowsingPrivateEventRouter::OnPolicySpecifiedPasswordReuseDetected( + event.Set(kKeyUserName, params.user_name); + event.Set(kKeyIsPhishingUrl, params.is_phishing_url); + event.Set(kKeyProfileUserName, GetProfileUserName()); +- event.Set(kKeyEventResult, +- safe_browsing::EventResultToString( +- warning_shown ? safe_browsing::EventResult::WARNED +- : safe_browsing::EventResult::ALLOWED)); ++ event.Set(kKeyEventResult, "EVENT_RESULT_ALLOWED"); + + reporting_client_->ReportRealtimeEvent( + kKeyPasswordReuseEvent, std::move(settings.value()), std::move(event)); +@@ -382,8 +379,7 @@ void SafeBrowsingPrivateEventRouter::OnDangerousDownloadOpened( + if (content_size >= 0) + event.Set(kKeyContentSize, base::Int64ToValue(content_size)); + event.Set(kKeyTrigger, kTriggerFileDownload); +- event.Set(kKeyEventResult, safe_browsing::EventResultToString( +- safe_browsing::EventResult::BYPASSED)); ++ event.Set(kKeyEventResult, "EVENT_RESULT_BYPASSED"); + event.Set(kKeyClickedThrough, true); + event.Set(kKeyThreatType, DangerTypeToThreatType(danger_type)); + // The scan ID can be empty when the reported dangerous download is from a +@@ -428,22 +424,6 @@ void SafeBrowsingPrivateEventRouter::OnSecurityInterstitialShown( + settings->enabled_event_names.count(kKeyInterstitialEvent) == 0) { + return; + } +- +- PrefService* prefs = Profile::FromBrowserContext(context_)->GetPrefs(); +- safe_browsing::EventResult event_result = +- prefs->GetBoolean(prefs::kSafeBrowsingProceedAnywayDisabled) +- ? safe_browsing::EventResult::BLOCKED +- : safe_browsing::EventResult::WARNED; +- base::Value::Dict event; +- event.Set(kKeyUrl, params.url); +- event.Set(kKeyReason, params.reason); +- event.Set(kKeyNetErrorCode, net_error_code); +- event.Set(kKeyProfileUserName, params.user_name); +- event.Set(kKeyClickedThrough, false); +- event.Set(kKeyEventResult, safe_browsing::EventResultToString(event_result)); +- +- reporting_client_->ReportRealtimeEvent( +- kKeyInterstitialEvent, std::move(settings.value()), std::move(event)); + } + + void SafeBrowsingPrivateEventRouter::OnSecurityInterstitialProceeded( +@@ -484,8 +464,7 @@ void SafeBrowsingPrivateEventRouter::OnSecurityInterstitialProceeded( + event.Set(kKeyNetErrorCode, net_error_code); + event.Set(kKeyProfileUserName, params.user_name); + event.Set(kKeyClickedThrough, true); +- event.Set(kKeyEventResult, safe_browsing::EventResultToString( +- safe_browsing::EventResult::BYPASSED)); ++ event.Set(kKeyEventResult, ""); + + reporting_client_->ReportRealtimeEvent( + kKeyInterstitialEvent, std::move(settings.value()), std::move(event)); +@@ -548,7 +527,7 @@ void SafeBrowsingPrivateEventRouter::OnDangerousDeepScanningResult( + event.Set(kKeyContentSize, base::Int64ToValue(content_size)); + } + event.Set(kKeyTrigger, trigger); +- event.Set(kKeyEventResult, safe_browsing::EventResultToString(event_result)); ++ event.Set(kKeyEventResult, ""); + event.Set(kKeyClickedThrough, + event_result == safe_browsing::EventResult::BYPASSED); + if (!malware_family.empty()) { +@@ -600,7 +579,7 @@ void SafeBrowsingPrivateEventRouter::OnSensitiveDataEvent( + event.Set(kKeyContentSize, base::Int64ToValue(content_size)); + } + event.Set(kKeyTrigger, trigger); +- event.Set(kKeyEventResult, safe_browsing::EventResultToString(event_result)); ++ event.Set(kKeyEventResult, ""); + event.Set(kKeyClickedThrough, + event_result == safe_browsing::EventResult::BYPASSED); + if (!result.evidence_locker_filepath().empty()) { +@@ -644,8 +623,7 @@ void SafeBrowsingPrivateEventRouter::OnAnalysisConnectorWarningBypassed( + event.Set(kKeyContentSize, base::Int64ToValue(content_size)); + } + event.Set(kKeyTrigger, trigger); +- event.Set(kKeyEventResult, safe_browsing::EventResultToString( +- safe_browsing::EventResult::BYPASSED)); ++ event.Set(kKeyEventResult, ""); + event.Set(kKeyClickedThrough, true); + if (!result.evidence_locker_filepath().empty()) { + event.Set(kKeyEvidenceLockerFilePath, result.evidence_locker_filepath()); +@@ -691,7 +669,7 @@ void SafeBrowsingPrivateEventRouter::OnUnscannedFileEvent( + event.Set(kKeyContentSize, base::Int64ToValue(content_size)); + } + event.Set(kKeyTrigger, trigger); +- event.Set(kKeyEventResult, safe_browsing::EventResultToString(event_result)); ++ event.Set(kKeyEventResult, ""); + event.Set(kKeyClickedThrough, + event_result == safe_browsing::EventResult::BYPASSED); + +@@ -743,7 +721,7 @@ void SafeBrowsingPrivateEventRouter::OnDangerousDownloadEvent( + event.Set(kKeyContentSize, base::Int64ToValue(content_size)); + } + event.Set(kKeyTrigger, kTriggerFileDownload); +- event.Set(kKeyEventResult, safe_browsing::EventResultToString(event_result)); ++ event.Set(kKeyEventResult, ""); + + // The scan ID can be empty when the reported dangerous download is from a + // Safe Browsing verdict. +@@ -798,8 +776,7 @@ void SafeBrowsingPrivateEventRouter::OnDangerousDownloadWarningBypassed( + event.Set(kKeyContentSize, base::Int64ToValue(content_size)); + } + event.Set(kKeyTrigger, kTriggerFileDownload); +- event.Set(kKeyEventResult, safe_browsing::EventResultToString( +- safe_browsing::EventResult::BYPASSED)); ++ event.Set(kKeyEventResult, ""); + // The scan ID can be empty when the reported dangerous download is from a + // Safe Browsing verdict. + if (!scan_id.empty()) { +@@ -889,7 +866,7 @@ void SafeBrowsingPrivateEventRouter::SetIdentityManagerForTesting( + } + + std::string SafeBrowsingPrivateEventRouter::GetProfileUserName() const { +- return safe_browsing::GetProfileEmail(identity_manager_); ++ return ""; + } + + } // namespace extensions +diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc +--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc ++++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc +@@ -720,18 +720,6 @@ void WebstorePrivateBeginInstallWithManifest3Function::OnFrictionPromptDone( + + void WebstorePrivateBeginInstallWithManifest3Function:: + ReportFrictionAcceptedEvent() { +- if (!profile_) { +- return; +- } +- auto* metrics_collector = +- safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile( +- profile_); +- // `metrics_collector` can be null in incognito. +- if (metrics_collector) { +- metrics_collector->AddSafeBrowsingEventToPref( +- safe_browsing::SafeBrowsingMetricsCollector::EventType:: +- EXTENSION_ALLOWLIST_INSTALL_BYPASS); +- } + } + + void WebstorePrivateBeginInstallWithManifest3Function::OnInstallPromptDone( +@@ -1202,8 +1190,7 @@ WebstorePrivateGetReferrerChainFunction:: + ExtensionFunction::ResponseAction + WebstorePrivateGetReferrerChainFunction::Run() { + Profile* profile = Profile::FromBrowserContext(browser_context()); +- if (!SafeBrowsingNavigationObserverManager::IsEnabledAndReady( +- profile->GetPrefs(), g_browser_process->safe_browsing_service())) ++ if ((true)) + return RespondNow(ArgumentList( + api::webstore_private::GetReferrerChain::Results::Create(""))); + +diff --git a/chrome/browser/extensions/blocklist_state_fetcher.cc b/chrome/browser/extensions/blocklist_state_fetcher.cc +--- a/chrome/browser/extensions/blocklist_state_fetcher.cc ++++ b/chrome/browser/extensions/blocklist_state_fetcher.cc +@@ -38,16 +38,9 @@ BlocklistStateFetcher::~BlocklistStateFetcher() { + void BlocklistStateFetcher::Request(const std::string& id, + RequestCallback callback) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); +- if (!safe_browsing_config_) { +- if (g_browser_process && g_browser_process->safe_browsing_service()) { +- SetSafeBrowsingConfig( +- g_browser_process->safe_browsing_service()->GetV4ProtocolConfig()); +- } else { +- base::ThreadTaskRunnerHandle::Get()->PostTask( +- FROM_HERE, base::BindOnce(std::move(callback), BLOCKLISTED_UNKNOWN)); +- return; +- } +- } ++ base::ThreadTaskRunnerHandle::Get()->PostTask( ++ FROM_HERE, base::BindOnce(std::move(callback), BLOCKLISTED_UNKNOWN)); ++ if ((true)) return; + + bool request_already_sent = base::Contains(callbacks_, id); + callbacks_.insert(std::make_pair(id, std::move(callback))); +diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.cc b/chrome/browser/extensions/chrome_extensions_browser_client.cc +--- a/chrome/browser/extensions/chrome_extensions_browser_client.cc ++++ b/chrome/browser/extensions/chrome_extensions_browser_client.cc +@@ -623,26 +623,11 @@ void ChromeExtensionsBrowserClient::NotifyExtensionApiTabExecuteScript( + content::BrowserContext* context, + const ExtensionId& extension_id, + const std::string& code) const { +- auto* telemetry_service = +- safe_browsing::ExtensionTelemetryServiceFactory::GetForProfile( +- Profile::FromBrowserContext(context)); +- if (!telemetry_service || !telemetry_service->enabled() || +- !base::FeatureList::IsEnabled( +- safe_browsing::kExtensionTelemetryTabsExecuteScriptSignal)) { +- return; +- } +- +- auto signal = std::make_unique( +- extension_id, code); +- telemetry_service->AddSignal(std::move(signal)); + } + + bool ChromeExtensionsBrowserClient::IsExtensionTelemetryServiceEnabled( + content::BrowserContext* context) const { +- auto* telemetry_service = +- safe_browsing::ExtensionTelemetryServiceFactory::GetForProfile( +- Profile::FromBrowserContext(context)); +- return telemetry_service && telemetry_service->enabled(); ++ return false; + } + + bool ChromeExtensionsBrowserClient:: +@@ -658,17 +643,6 @@ void ChromeExtensionsBrowserClient::NotifyExtensionRemoteHostContacted( + if (!url.SchemeIsHTTPOrHTTPS()) { + return; + } +- auto* telemetry_service = +- safe_browsing::ExtensionTelemetryServiceFactory::GetForProfile( +- Profile::FromBrowserContext(context)); +- if (!telemetry_service || !telemetry_service->enabled() || +- !IsExtensionTelemetryRemoteHostContactedSignalEnabled()) { +- return; +- } +- auto remote_host_signal = +- std::make_unique(extension_id, +- url); +- telemetry_service->AddSignal(std::move(remote_host_signal)); + } + + // static +diff --git a/chrome/browser/extensions/extension_allowlist.cc b/chrome/browser/extensions/extension_allowlist.cc +--- a/chrome/browser/extensions/extension_allowlist.cc ++++ b/chrome/browser/extensions/extension_allowlist.cc +@@ -399,15 +399,6 @@ void ExtensionAllowlist::NotifyExtensionAllowlistWarningStateChanged( + } + + void ExtensionAllowlist::ReportExtensionReEnabledEvent() { +- auto* metrics_collector = +- safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile( +- profile_); +- DCHECK(metrics_collector); +- if (metrics_collector) { +- metrics_collector->AddSafeBrowsingEventToPref( +- safe_browsing::SafeBrowsingMetricsCollector::EventType:: +- NON_ALLOWLISTED_EXTENSION_RE_ENABLED); +- } + } + + } // namespace extensions +diff --git a/chrome/browser/media/webrtc/display_media_access_handler.cc b/chrome/browser/media/webrtc/display_media_access_handler.cc +--- a/chrome/browser/media/webrtc/display_media_access_handler.cc ++++ b/chrome/browser/media/webrtc/display_media_access_handler.cc +@@ -121,7 +121,6 @@ void DisplayMediaAccessHandler::HandleRequest( + blink::mojom::StreamDevicesSet(), + blink::mojom::MediaStreamRequestResult::PERMISSION_DENIED, + /*ui=*/nullptr); +- observer->OnDesktopCaptureRequest(); + return; + } + +diff --git a/chrome/browser/new_tab_page/modules/safe_browsing/safe_browsing_handler.cc b/chrome/browser/new_tab_page/modules/safe_browsing/safe_browsing_handler.cc +--- a/chrome/browser/new_tab_page/modules/safe_browsing/safe_browsing_handler.cc ++++ b/chrome/browser/new_tab_page/modules/safe_browsing/safe_browsing_handler.cc +@@ -54,8 +54,6 @@ SafeBrowsingHandler::SafeBrowsingHandler( + handler, + Profile* profile) + : handler_(this, std::move(handler)), +- metrics_collector_( +- SafeBrowsingMetricsCollectorFactory::GetForProfile(profile)), + pref_service_(profile->GetPrefs()), + saved_last_cooldown_start_time_(0), + saved_module_shown_count_(0) {} +@@ -80,8 +78,7 @@ void SafeBrowsingHandler::CanShowModule(CanShowModuleCallback callback) { + return; + } + +- absl::optional latest_event_time = +- metrics_collector_->GetLatestSecuritySensitiveEventTimestamp(); ++ absl::optional latest_event_time; + // Do not show if there is no security sensitive event after the latest + // cooldown. + if (!latest_event_time.has_value() || latest_event_time < cooldown_end) { +diff --git a/chrome/browser/new_tab_page/modules/safe_browsing/safe_browsing_handler.h b/chrome/browser/new_tab_page/modules/safe_browsing/safe_browsing_handler.h +--- a/chrome/browser/new_tab_page/modules/safe_browsing/safe_browsing_handler.h ++++ b/chrome/browser/new_tab_page/modules/safe_browsing/safe_browsing_handler.h +@@ -48,9 +48,6 @@ class SafeBrowsingHandler + friend class SafeBrowsingHandlerTest; + + mojo::Receiver handler_; +- // Unowned copy of SafeBrowsingMetricsCollector, to log metrics and read/write +- // security sensitive events. +- raw_ptr metrics_collector_; + // Unowned copy of PrefService, to read/write prefs. + raw_ptr pref_service_; + // Save value of last cooldown start time, in case dismissed module is +diff --git a/chrome/browser/notifications/notification_display_service_impl.cc b/chrome/browser/notifications/notification_display_service_impl.cc +--- a/chrome/browser/notifications/notification_display_service_impl.cc ++++ b/chrome/browser/notifications/notification_display_service_impl.cc +@@ -88,13 +88,6 @@ NotificationDisplayServiceImpl::NotificationDisplayServiceImpl(Profile* profile) + profile_)); + #endif + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \ +- BUILDFLAG(IS_WIN) +- AddNotificationHandler( +- NotificationHandler::Type::TAILORED_SECURITY, +- std::make_unique()); +-#endif +- + #if BUILDFLAG(ENABLE_EXTENSIONS) + AddNotificationHandler( + NotificationHandler::Type::EXTENSION, +diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc +--- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc ++++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc +@@ -1851,13 +1851,6 @@ std::unique_ptr BuildHandlerList( + prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckMode, + prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckScope, chrome_schema)); + +- handlers->AddHandler(std::make_unique( +- key::kExemptDomainFileTypePairsFromFileTypeDownloadWarnings, +- safe_browsing::file_type::prefs:: +- kExemptDomainFileTypePairsFromFileTypeDownloadWarnings, +- chrome_schema, SCHEMA_ALLOW_UNKNOWN, +- SimpleSchemaValidatingPolicyHandler::RECOMMENDED_PROHIBITED, +- SimpleSchemaValidatingPolicyHandler::MANDATORY_ALLOWED)); + handlers->AddHandler( + std::make_unique(chrome_schema)); + +diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc +--- a/chrome/browser/prefs/browser_prefs.cc ++++ b/chrome/browser/prefs/browser_prefs.cc +@@ -1542,8 +1542,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, + component_updater::RegisterProfilePrefsForSwReporter(registry); + FontPrewarmerTabHelper::RegisterProfilePrefs(registry); + NetworkProfileBubble::RegisterProfilePrefs(registry); ++#if BUILDFLAG(SAFE_BROWSING_AVAILABLE) + safe_browsing::SettingsResetPromptPrefsManager::RegisterProfilePrefs( + registry); ++#endif + safe_browsing::PostCleanupSettingsResetter::RegisterProfilePrefs(registry); + #endif + +diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc +--- a/chrome/browser/printing/print_view_manager.cc ++++ b/chrome/browser/printing/print_view_manager.cc +@@ -275,20 +275,6 @@ void PrintViewManager::OnDlpPrintingRestrictionsChecked( + void PrintViewManager::RejectPrintPreviewRequestIfRestrictedByContentAnalysis( + content::GlobalRenderFrameHostId rfh_id, + base::OnceCallback callback) { +- enterprise_connectors::ContentAnalysisDelegate::Data scanning_data; +- content::RenderFrameHost* rfh = content::RenderFrameHost::FromID(rfh_id); +- if (rfh && +- base::FeatureList::IsEnabled(features::kEnablePrintContentAnalysis) && +- enterprise_connectors::ContentAnalysisDelegate::IsEnabled( +- Profile::FromBrowserContext(web_contents()->GetBrowserContext()), +- web_contents()->GetLastCommittedURL(), &scanning_data, +- enterprise_connectors::AnalysisConnector::PRINT)) { +- GetPrintRenderFrame(rfh)->SnapshotForContentAnalysis(base::BindOnce( +- &PrintViewManager::OnGotSnapshotCallback, weak_factory_.GetWeakPtr(), +- std::move(callback), std::move(scanning_data), rfh_id)); +- return; +- } +- + std::move(callback).Run(/*should_proceed=*/true); + } + +diff --git a/chrome/browser/profiles/profiles_state.cc b/chrome/browser/profiles/profiles_state.cc +--- a/chrome/browser/profiles/profiles_state.cc ++++ b/chrome/browser/profiles/profiles_state.cc +@@ -260,8 +260,6 @@ void RemoveBrowsingDataForProfile(const base::FilePath& profile_path) { + // The BrowsingDataRemover relies on many objects that aren't created in unit + // tests. Previously this code would depend on content::ResourceDispatcherHost + // but that's gone, so do a similar hack for now. +- if (!g_browser_process->safe_browsing_service()) +- return; + + Profile* profile = + g_browser_process->profile_manager()->GetProfileByPath(profile_path); +diff --git a/chrome/browser/safe_browsing/BUILD.gn b/chrome/browser/safe_browsing/BUILD.gn +--- a/chrome/browser/safe_browsing/BUILD.gn ++++ b/chrome/browser/safe_browsing/BUILD.gn +@@ -6,7 +6,7 @@ import("//build/config/chromeos/ui_mode.gni") + import("//components/safe_browsing/buildflags.gni") + import("//extensions/buildflags/buildflags.gni") + +-static_library("safe_browsing") { ++static_library("safe_browsing_disabled") { + if (false) { + sources = [ + "chrome_controller_client.cc", +@@ -419,7 +419,7 @@ static_library("safe_browsing") { + } + } + +-source_set("verdict_cache_manager_factory") { ++source_set("verdict_cache_manager_factory_disabled") { + sources = [ + "verdict_cache_manager_factory.cc", + "verdict_cache_manager_factory.h", +@@ -440,7 +440,7 @@ source_set("verdict_cache_manager_factory") { + ] + } + +-static_library("advanced_protection") { ++static_library("advanced_protection_disabled") { + sources = [ + "advanced_protection_status_manager.cc", + "advanced_protection_status_manager.h", +@@ -460,7 +460,7 @@ static_library("advanced_protection") { + ] + } + +-source_set("metrics_collector") { ++source_set("metrics_collector_disabled") { + sources = [ + "safe_browsing_metrics_collector_factory.cc", + "safe_browsing_metrics_collector_factory.h", +diff --git a/chrome/browser/safe_browsing/chrome_cleaner/BUILD.gn b/chrome/browser/safe_browsing/chrome_cleaner/BUILD.gn +--- a/chrome/browser/safe_browsing/chrome_cleaner/BUILD.gn ++++ b/chrome/browser/safe_browsing/chrome_cleaner/BUILD.gn +@@ -62,7 +62,6 @@ static_library("chrome_cleaner") { + ":public", + "//chrome/browser:browser_process", + "//chrome/browser/profiles:profile", +- "//chrome/browser/safe_browsing", + "//chrome/browser/ui", + "//chrome/common", + "//chrome/installer/util:with_no_strings", +diff --git a/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.cc +--- a/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.cc ++++ b/chrome/browser/safe_browsing/chrome_cleaner/settings_resetter_win.cc +@@ -194,7 +194,6 @@ PostCleanupSettingsResetter::Delegate::~Delegate() {} + + void PostCleanupSettingsResetter::Delegate::FetchDefaultSettings( + DefaultSettingsFetcher::SettingsCallback callback) { +- DefaultSettingsFetcher::FetchDefaultSettings(std::move(callback)); + } + + PostCleanupSettingsResetter::PostCleanupSettingsResetter() = default; +diff --git a/chrome/browser/safe_browsing/download_protection/file_analyzer.h b/chrome/browser/safe_browsing/download_protection/file_analyzer.h +--- a/chrome/browser/safe_browsing/download_protection/file_analyzer.h ++++ b/chrome/browser/safe_browsing/download_protection/file_analyzer.h +@@ -17,10 +17,6 @@ + #include "components/safe_browsing/core/common/proto/csd.pb.h" + #include "third_party/protobuf/src/google/protobuf/repeated_field.h" + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) +-#include "chrome/services/file_util/public/cpp/sandboxed_document_analyzer.h" +-#endif +- + #if BUILDFLAG(IS_MAC) + #include "chrome/common/safe_browsing/disk_image_type_sniffer_mac.h" + #include "chrome/services/file_util/public/cpp/sandboxed_dmg_analyzer_mac.h" +@@ -105,12 +101,6 @@ class FileAnalyzer { + const safe_browsing::ArchiveAnalyzerResults& archive_results); + #endif + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) +- void StartExtractDocumentFeatures(); +- void OnDocumentAnalysisFinished( +- const DocumentAnalyzerResults& document_results); +-#endif +- + void LogAnalysisDurationWithAndWithoutSuffix(const std::string& suffix); + + base::FilePath target_path_; +@@ -128,11 +118,6 @@ class FileAnalyzer { + scoped_refptr dmg_analyzer_; + #endif + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) +- scoped_refptr document_analyzer_; +- base::TimeTicks document_analysis_start_time_; +-#endif +- + base::WeakPtrFactory weakptr_factory_{this}; + }; + +diff --git a/chrome/browser/ssl/chrome_security_blocking_page_factory.cc b/chrome/browser/ssl/chrome_security_blocking_page_factory.cc +--- a/chrome/browser/ssl/chrome_security_blocking_page_factory.cc ++++ b/chrome/browser/ssl/chrome_security_blocking_page_factory.cc +@@ -143,15 +143,6 @@ CreateSettingsPageHelper() { + CreateChromeSettingsPageHelper(); + } + +-void LogSafeBrowsingSecuritySensitiveAction( +- safe_browsing::SafeBrowsingMetricsCollector* metrics_collector) { +- if (metrics_collector) { +- metrics_collector->AddSafeBrowsingEventToPref( +- safe_browsing::SafeBrowsingMetricsCollector::EventType:: +- SECURITY_SENSITIVE_SSL_INTERSTITIAL); +- } +-} +- + } // namespace + + std::unique_ptr +@@ -175,10 +166,6 @@ ChromeSecurityBlockingPageFactory::CreateSSLPage( + Profile::FromBrowserContext(web_contents->GetBrowserContext())); + state->DidDisplayErrorPage(cert_error); + +- LogSafeBrowsingSecuritySensitiveAction( +- safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile( +- Profile::FromBrowserContext(web_contents->GetBrowserContext()))); +- + auto controller_client = std::make_unique( + web_contents, ssl_info, cert_error, request_url, + std::move(metrics_helper), CreateSettingsPageHelper()); +@@ -248,10 +235,6 @@ ChromeSecurityBlockingPageFactory::CreateMITMSoftwareBlockingPage( + std::unique_ptr ssl_cert_reporter, + const net::SSLInfo& ssl_info, + const std::string& mitm_software_name) { +- LogSafeBrowsingSecuritySensitiveAction( +- safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile( +- Profile::FromBrowserContext(web_contents->GetBrowserContext()))); +- + auto page = std::make_unique( + web_contents, cert_error, request_url, std::move(ssl_cert_reporter), + /*can_show_enhanced_protection_message=*/true, ssl_info, +@@ -273,10 +256,6 @@ ChromeSecurityBlockingPageFactory::CreateBlockedInterceptionBlockingPage( + const GURL& request_url, + std::unique_ptr ssl_cert_reporter, + const net::SSLInfo& ssl_info) { +- LogSafeBrowsingSecuritySensitiveAction( +- safe_browsing::SafeBrowsingMetricsCollectorFactory::GetForProfile( +- Profile::FromBrowserContext(web_contents->GetBrowserContext()))); +- + auto page = std::make_unique( + web_contents, cert_error, request_url, std::move(ssl_cert_reporter), + /*can_show_enhanced_protection_message=*/true, ssl_info, +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 +@@ -419,7 +419,6 @@ static_library("ui") { + "//chrome/browser/resources/net_internals:resources", + "//chrome/browser/resources/omnibox:resources", + "//chrome/browser/resources/usb_internals:resources", +- "//chrome/browser/safe_browsing", + "//chrome/browser/share", + "//chrome/browser/ui/webui:configs", + "//chrome/browser/ui/webui/bluetooth_internals", +@@ -668,7 +667,6 @@ static_library("ui") { + # TODO(crbug.com/1158905): Remove this circular dependency. + "//chrome/browser/devtools", + "//chrome/browser/favicon", +- "//chrome/browser/safe_browsing", + "//chrome/browser/ui/webui/bluetooth_internals", + "//chrome/browser/profiling_host", + "//chrome/browser/ui/webui:configs", +@@ -1768,8 +1766,6 @@ static_library("ui") { + "//chrome/browser/resource_coordinator/tab_ranker", + "//chrome/browser/resources/identity_internals:resources", + "//chrome/browser/resources/support_tool:resources", +- "//chrome/browser/safe_browsing", +- "//chrome/browser/safe_browsing:advanced_protection", + "//chrome/browser/support_tool:support_tool_proto", + "//chrome/browser/ui/color:color_headers", + "//chrome/browser/ui/color:mixers", +@@ -3507,8 +3503,6 @@ static_library("ui") { + "views/profiles/profile_picker_force_signin_dialog_host.h", + "views/profiles/profile_picker_signed_in_flow_controller.cc", + "views/profiles/profile_picker_signed_in_flow_controller.h", +- "views/profiles/profile_picker_turn_sync_on_delegate.cc", +- "views/profiles/profile_picker_turn_sync_on_delegate.h", + "views/profiles/profile_picker_view.cc", + "views/profiles/profile_picker_view.h", + "views/profiles/profile_picker_web_contents_host.h", +diff --git a/chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc b/chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc +--- a/chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc ++++ b/chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_desktop.cc +@@ -43,7 +43,6 @@ void JavaScriptTabModalDialogManagerDelegateDesktop::WillRunDialog() { + safe_browsing::SafeBrowsingUserInteractionObserver::FromWebContents( + web_contents_); + if (observer) { +- observer->OnJavaScriptDialog(); + } + } + +diff --git a/chrome/browser/ui/page_info/chrome_page_info_delegate.cc b/chrome/browser/ui/page_info/chrome_page_info_delegate.cc +--- a/chrome/browser/ui/page_info/chrome_page_info_delegate.cc ++++ b/chrome/browser/ui/page_info/chrome_page_info_delegate.cc +@@ -216,7 +216,6 @@ void ChromePageInfoDelegate::OpenConnectionHelpCenterPage( + } + + void ChromePageInfoDelegate::OpenSafetyTipHelpCenterPage() { +- OpenHelpCenterFromSafetyTip(web_contents_); + } + + void ChromePageInfoDelegate::OpenContentSettingsExceptions( +diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc +--- a/chrome/browser/ui/views/download/download_item_view.cc ++++ b/chrome/browser/ui/views/download/download_item_view.cc +@@ -835,21 +835,7 @@ void DownloadItemView::UpdateLabels() { + warning_label_->SizeToFit(GetLabelWidth(*warning_label_)); + } + +- deep_scanning_label_->SetVisible(mode_ == +- download::DownloadItemMode::kDeepScanning); +- if (deep_scanning_label_->GetVisible()) { +- const int id = (model_->GetDownloadItem() && +- safe_browsing::DeepScanningRequest::ShouldUploadBinary( +- model_->GetDownloadItem())) +- ? IDS_PROMPT_DEEP_SCANNING_DOWNLOAD +- : IDS_PROMPT_DEEP_SCANNING_APP_DOWNLOAD; +- const std::u16string filename = ElidedFilename(*deep_scanning_label_); +- size_t filename_offset; +- deep_scanning_label_->SetText( +- l10n_util::GetStringFUTF16(id, filename, &filename_offset)); +- StyleFilename(*deep_scanning_label_, filename_offset, filename.length()); +- deep_scanning_label_->SizeToFit(GetLabelWidth(*deep_scanning_label_)); +- } ++ deep_scanning_label_->SetVisible(false); + } + + void DownloadItemView::UpdateButtons() { +@@ -1083,11 +1069,7 @@ ui::ImageModel DownloadItemView::GetIcon() const { + + switch (danger_type) { + case download::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT: +- return safe_browsing::AdvancedProtectionStatusManagerFactory:: +- GetForProfile(model_->profile()) +- ->IsUnderAdvancedProtection() +- ? kWarning +- : kError; ++ return kError; + case download::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL: + case download::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT: + case download::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST: +@@ -1366,7 +1348,6 @@ void DownloadItemView::ShowContextMenuImpl(const gfx::Rect& rect, + } + + void DownloadItemView::OpenDownloadDuringAsyncScanning() { +- model_->CompleteSafeBrowsingScan(); + model_->SetOpenWhenComplete(true); + } + +diff --git a/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc b/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc +--- a/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc ++++ b/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc +@@ -387,11 +387,6 @@ void DownloadsDOMHandler::ReviewDangerousRequiringGesture( + } + + CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_REVIEW_DANGEROUS); +- download::DownloadItem* download = GetDownloadByStringId(id); +- if (download) { +- DownloadItemModel model(download); +- model.ReviewScanningVerdict(GetWebUIWebContents()); +- } + } + + // DownloadsDOMHandler, private: -------------------------------------------- +@@ -420,12 +415,7 @@ void DownloadsDOMHandler::FinalizeRemovals() { + + void DownloadsDOMHandler::ShowDangerPrompt( + download::DownloadItem* dangerous_item) { +- DownloadDangerPrompt* danger_prompt = DownloadDangerPrompt::Create( +- dangerous_item, GetWebUIWebContents(), false, +- base::BindOnce(&DownloadsDOMHandler::DangerPromptDone, +- weak_ptr_factory_.GetWeakPtr(), dangerous_item->GetId())); +- // danger_prompt will delete itself. +- DCHECK(danger_prompt); ++ DangerPromptDone(dangerous_item->GetId(), DownloadDangerPrompt::ACCEPT); + } + + void DownloadsDOMHandler::DangerPromptDone( +diff --git a/chrome/browser/ui/webui/downloads/downloads_ui.cc b/chrome/browser/ui/webui/downloads/downloads_ui.cc +--- a/chrome/browser/ui/webui/downloads/downloads_ui.cc ++++ b/chrome/browser/ui/webui/downloads/downloads_ui.cc +@@ -63,10 +63,7 @@ content::WebUIDataSource* CreateDownloadsUIHTMLSource(Profile* profile) { + source, base::make_span(kDownloadsResources, kDownloadsResourcesSize), + IDR_DOWNLOADS_DOWNLOADS_HTML); + +- bool requests_ap_verdicts = +- safe_browsing::AdvancedProtectionStatusManagerFactory::GetForProfile( +- profile) +- ->IsUnderAdvancedProtection(); ++ bool requests_ap_verdicts = false; + source->AddBoolean("requestsApVerdicts", requests_ap_verdicts); + + static constexpr webui::LocalizedString kStrings[] = { +diff --git a/chrome/browser/webshare/share_service_impl.cc b/chrome/browser/webshare/share_service_impl.cc +--- a/chrome/browser/webshare/share_service_impl.cc ++++ b/chrome/browser/webshare/share_service_impl.cc +@@ -17,8 +17,10 @@ + #include "chrome/browser/browser_process.h" + #include "chrome/browser/safe_browsing/safe_browsing_service.h" + #include "chrome/common/chrome_features.h" ++#if BUILDFLAG(FULL_SAFE_BROWSING) + #include "components/safe_browsing/content/common/file_type_policies.h" + #include "components/safe_browsing/core/browser/db/database_manager.h" ++#endif + #include "content/public/browser/web_contents.h" + #include "mojo/public/cpp/bindings/self_owned_receiver.h" + +@@ -182,6 +184,7 @@ void ShareServiceImpl::Share(const std::string& title, + return; + } + ++#if BUILDFLAG(FULL_SAFE_BROWSING) + bool should_check_url = false; + for (auto& file : files) { + if (!file || !file->blob || !file->blob->blob) { +@@ -223,6 +226,7 @@ void ShareServiceImpl::Share(const std::string& title, + std::move(files), std::move(callback))); + return; + } ++#endif + + OnSafeBrowsingResultReceived(title, text, share_url, std::move(files), + std::move(callback), +diff --git a/chrome/services/file_util/public/cpp/sandboxed_rar_analyzer.cc b/chrome/services/file_util/public/cpp/sandboxed_rar_analyzer.cc +--- a/chrome/services/file_util/public/cpp/sandboxed_rar_analyzer.cc ++++ b/chrome/services/file_util/public/cpp/sandboxed_rar_analyzer.cc +@@ -27,11 +27,6 @@ SandboxedRarAnalyzer::SandboxedRarAnalyzer( + service_(std::move(service)) { + DCHECK(callback_); + DCHECK(!file_path_.value().empty()); +- service_->BindSafeArchiveAnalyzer( +- remote_analyzer_.BindNewPipeAndPassReceiver()); +- remote_analyzer_.set_disconnect_handler(base::BindOnce( +- &SandboxedRarAnalyzer::AnalyzeFileDone, base::Unretained(this), +- safe_browsing::ArchiveAnalyzerResults())); + } + + void SandboxedRarAnalyzer::Start() { +@@ -49,19 +44,12 @@ SandboxedRarAnalyzer::~SandboxedRarAnalyzer() = default; + void SandboxedRarAnalyzer::AnalyzeFile(base::File file, base::File temp_file) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + DCHECK(!file_path_.value().empty()); +- if (remote_analyzer_) { +- remote_analyzer_->AnalyzeRarFile( +- std::move(file), std::move(temp_file), +- base::BindOnce(&SandboxedRarAnalyzer::AnalyzeFileDone, this)); +- } else { + AnalyzeFileDone(safe_browsing::ArchiveAnalyzerResults()); +- } + } + + void SandboxedRarAnalyzer::AnalyzeFileDone( + const safe_browsing::ArchiveAnalyzerResults& results) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); +- remote_analyzer_.reset(); + if (callback_) { + std::move(callback_).Run(results); + } +@@ -116,9 +104,7 @@ void SandboxedRarAnalyzer::ReportFileFailure( + } + + std::string SandboxedRarAnalyzer::DebugString() const { +- return base::StringPrintf("path: %" PRFilePath "; connected_: %d", +- file_path_.value().c_str(), +- remote_analyzer_.is_connected()); ++ return std:string(); + } + + std::ostream& operator<<(std::ostream& os, +diff --git a/chrome/services/file_util/public/cpp/sandboxed_rar_analyzer.h b/chrome/services/file_util/public/cpp/sandboxed_rar_analyzer.h +--- a/chrome/services/file_util/public/cpp/sandboxed_rar_analyzer.h ++++ b/chrome/services/file_util/public/cpp/sandboxed_rar_analyzer.h +@@ -9,7 +9,6 @@ + #include "base/files/file_path.h" + #include "base/memory/ref_counted_delete_on_sequence.h" + #include "chrome/services/file_util/public/mojom/file_util_service.mojom.h" +-#include "chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom.h" + #include "mojo/public/cpp/bindings/pending_remote.h" + #include "mojo/public/cpp/bindings/remote.h" + +@@ -68,7 +67,6 @@ class SandboxedRarAnalyzer + + // Remote interfaces to the file util service. Only used from the UI thread. + mojo::Remote service_; +- mojo::Remote remote_analyzer_; + }; + + std::ostream& operator<<(std::ostream& os, +diff --git a/chrome/services/file_util/public/cpp/sandboxed_zip_analyzer.h b/chrome/services/file_util/public/cpp/sandboxed_zip_analyzer.h +--- a/chrome/services/file_util/public/cpp/sandboxed_zip_analyzer.h ++++ b/chrome/services/file_util/public/cpp/sandboxed_zip_analyzer.h +@@ -10,7 +10,6 @@ + #include "base/files/file_path.h" + #include "base/memory/ref_counted_delete_on_sequence.h" + #include "chrome/services/file_util/public/mojom/file_util_service.mojom.h" +-#include "chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom.h" + #include "mojo/public/cpp/bindings/pending_remote.h" + #include "mojo/public/cpp/bindings/remote.h" + +@@ -65,7 +64,6 @@ class SandboxedZipAnalyzer + + // Remote interfaces to the file util service. Only used from the UI thread. + mojo::Remote service_; +- mojo::Remote remote_analyzer_; + }; + + #endif // CHROME_SERVICES_FILE_UTIL_PUBLIC_CPP_SANDBOXED_ZIP_ANALYZER_H_ +diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn +--- a/chrome/test/BUILD.gn ++++ b/chrome/test/BUILD.gn +@@ -226,7 +226,6 @@ static_library("test_support") { + "//chrome:strings", + "//chrome/browser:browser_process", + "//chrome/browser:test_support", +- "//chrome/browser/safe_browsing", + "//chrome/child", + "//chrome/common:non_code_constants", + "//chrome/common:test_support", +@@ -1247,7 +1246,6 @@ if (!is_android) { + "//chrome/browser/profiling_host:profiling_browsertests", + "//chrome/browser/resource_coordinator:tab_manager_features", + "//chrome/browser/resource_coordinator:tab_metrics_event_proto", +- "//chrome/browser/safe_browsing:verdict_cache_manager_factory", + "//chrome/browser/segmentation_platform:test_utils", + "//chrome/browser/sharing/proto", + "//chrome/browser/ui/color:color_headers", +@@ -5692,9 +5690,6 @@ test("unit_tests") { + "//chrome/browser/profile_resetter:profile_reset_report_proto", + "//chrome/browser/profiling_host", + "//chrome/browser/push_messaging:budget_proto", +- "//chrome/browser/safe_browsing:advanced_protection", +- "//chrome/browser/safe_browsing:metrics_collector", +- "//chrome/browser/safe_browsing:verdict_cache_manager_factory", + "//chrome/browser/segmentation_platform:test_utils", + "//chrome/browser/share", + "//chrome/browser/sharing/proto", +diff --git a/components/safe_browsing/content/browser/mojo_safe_browsing_impl.cc b/components/safe_browsing/content/browser/mojo_safe_browsing_impl.cc +--- a/components/safe_browsing/content/browser/mojo_safe_browsing_impl.cc ++++ b/components/safe_browsing/content/browser/mojo_safe_browsing_impl.cc +@@ -111,6 +111,7 @@ void MojoSafeBrowsingImpl::MaybeCreate( + if (!resource_context || !delegate) + return; + ++ NOTREACHED(); + std::unique_ptr impl(new MojoSafeBrowsingImpl( + std::move(delegate), render_process_id, resource_context)); + impl->Clone(std::move(receiver)); +diff --git a/components/safe_browsing/core/common/safe_browsing_prefs.cc b/components/safe_browsing/core/common/safe_browsing_prefs.cc +--- a/components/safe_browsing/core/common/safe_browsing_prefs.cc ++++ b/components/safe_browsing/core/common/safe_browsing_prefs.cc +@@ -218,7 +218,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { + registry->RegisterIntegerPref(prefs::kPasswordProtectionWarningTrigger, + PASSWORD_PROTECTION_OFF); + registry->RegisterInt64Pref(prefs::kAdvancedProtectionLastRefreshInUs, 0); +- registry->RegisterBooleanPref(prefs::kAdvancedProtectionAllowed, true); ++ registry->RegisterBooleanPref(prefs::kAdvancedProtectionAllowed, false); + registry->RegisterIntegerPref( + prefs::kSafeBrowsingEnterpriseRealTimeUrlCheckMode, + REAL_TIME_CHECK_DISABLED); +diff --git a/services/preferences/tracked/tracked_persistent_pref_store_factory.cc b/services/preferences/tracked/tracked_persistent_pref_store_factory.cc +--- a/services/preferences/tracked/tracked_persistent_pref_store_factory.cc ++++ b/services/preferences/tracked/tracked_persistent_pref_store_factory.cc +@@ -101,24 +101,18 @@ PersistentPrefStore* CreateTrackedPersistentPrefStore( + } + #endif + +- mojo::Remote +- validation_delegate; +- validation_delegate.Bind(std::move(config->validation_delegate)); +- auto validation_delegate_ref = base::MakeRefCounted>>( +- std::move(validation_delegate)); + std::unique_ptr unprotected_pref_hash_filter( + new PrefHashFilter(CreatePrefHashStore(*config, false), + GetExternalVerificationPrefHashStorePair( + *config, temp_scoped_dir_cleaner), + unprotected_configuration, mojo::NullRemote(), +- validation_delegate_ref, config->reporting_ids_count)); ++ nullptr, config->reporting_ids_count)); + std::unique_ptr protected_pref_hash_filter(new PrefHashFilter( + CreatePrefHashStore(*config, true), + GetExternalVerificationPrefHashStorePair(*config, + temp_scoped_dir_cleaner), + protected_configuration, std::move(config->reset_on_load_observer), +- validation_delegate_ref, config->reporting_ids_count)); ++ nullptr, config->reporting_ids_count)); + + PrefHashFilter* raw_unprotected_pref_hash_filter = + unprotected_pref_hash_filter.get(); +-- +2.25.1 diff --git a/build/patches/00Disable-various-metrics--win-fixup-.patch b/build/patches/00Disable-various-metrics--win-fixup-.patch new file mode 100644 index 00000000..eb635375 --- /dev/null +++ b/build/patches/00Disable-various-metrics--win-fixup-.patch @@ -0,0 +1,45 @@ +From: Your Name +Date: Wed, 12 Oct 2022 11:53:36 +0000 +Subject: Disable various metrics (win fixup) + +--- + chrome/browser/ui/search/ntp_user_data_logger.cc | 4 ---- + components/ntp_tiles/custom_links_manager_impl.cc | 1 - + 2 files changed, 5 deletions(-) + +diff --git a/chrome/browser/ui/search/ntp_user_data_logger.cc b/chrome/browser/ui/search/ntp_user_data_logger.cc +--- a/chrome/browser/ui/search/ntp_user_data_logger.cc ++++ b/chrome/browser/ui/search/ntp_user_data_logger.cc +@@ -429,8 +429,6 @@ void NTPUserDataLogger::LogMostVisitedImpression( + + void NTPUserDataLogger::LogMostVisitedNavigation( + const ntp_tiles::NTPTileImpression& impression) { +- ntp_tiles::metrics::RecordTileClick(impression); +- + // Records the action. This will be available as a time-stamped stream + // server-side and can be used to compute time-to-long-dwell. + base::RecordAction(base::UserMetricsAction("MostVisited_Clicked")); +@@ -459,10 +457,8 @@ void NTPUserDataLogger::EmitNtpStatistics(base::TimeDelta load_time, + if (!impression.has_value()) { + break; + } +- ntp_tiles::metrics::RecordTileImpression(*impression); + ++tiles_count; + } +- ntp_tiles::metrics::RecordPageImpression(tiles_count); + + DVLOG(1) << "Emitting NTP load time: " << load_time << ", " + << "number of tiles: " << tiles_count; +diff --git a/components/ntp_tiles/custom_links_manager_impl.cc b/components/ntp_tiles/custom_links_manager_impl.cc +--- a/components/ntp_tiles/custom_links_manager_impl.cc ++++ b/components/ntp_tiles/custom_links_manager_impl.cc +@@ -202,7 +202,6 @@ void CustomLinksManagerImpl::RemoveCustomLinksForPreinstalledApps() { + } + } + if (default_app_links_deleted) { +- metrics::RecordsMigratedDefaultAppDeleted(DeletedTileType::kCustomLink); + prefs_->SetBoolean(prefs::kCustomLinksForPreinstalledAppsRemoved, true); + } + } +-- +2.25.1 diff --git a/build/patches/00Do-not-build-API-keys-infobar--win-fixup-.patch b/build/patches/00Do-not-build-API-keys-infobar--win-fixup-.patch new file mode 100644 index 00000000..f9bd2787 --- /dev/null +++ b/build/patches/00Do-not-build-API-keys-infobar--win-fixup-.patch @@ -0,0 +1,23 @@ +From: Your Name +Date: Wed, 12 Oct 2022 11:58:29 +0000 +Subject: Do not build API keys infobar (win fixup) + +--- + chrome/browser/ui/startup/infobar_utils.cc | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/chrome/browser/ui/startup/infobar_utils.cc b/chrome/browser/ui/startup/infobar_utils.cc +--- a/chrome/browser/ui/startup/infobar_utils.cc ++++ b/chrome/browser/ui/startup/infobar_utils.cc +@@ -113,9 +113,6 @@ void AddInfoBarsIfNecessary(Browser* browser, + infobars::ContentInfoBarManager* infobar_manager = + infobars::ContentInfoBarManager::FromWebContents(web_contents); + +- if (!google_apis::HasAPIKeyConfigured()) +- GoogleApiKeysInfoBarDelegate::Create(infobar_manager); +- + if (ObsoleteSystem::IsObsoleteNowOrSoon()) { + PrefService* local_state = g_browser_process->local_state(); + if (!local_state || +-- +2.25.1 diff --git a/build/patches/00Enable-native-Android-autofill--win-fixup-.patch b/build/patches/00Enable-native-Android-autofill--win-fixup-.patch new file mode 100644 index 00000000..4d1c75ad --- /dev/null +++ b/build/patches/00Enable-native-Android-autofill--win-fixup-.patch @@ -0,0 +1,60 @@ +From: Your Name +Date: Wed, 12 Oct 2022 11:46:45 +0000 +Subject: Enable native Android autofill (win fixup) + +--- + chrome/browser/extensions/extension_view_host.cc | 3 ++- + .../views/media_router/presentation_receiver_window_view.cc | 3 ++- + .../content/browser/content_autofill_driver_factory.cc | 6 ++++++ + 3 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/chrome/browser/extensions/extension_view_host.cc b/chrome/browser/extensions/extension_view_host.cc +--- a/chrome/browser/extensions/extension_view_host.cc ++++ b/chrome/browser/extensions/extension_view_host.cc +@@ -58,7 +58,8 @@ ExtensionViewHost::ExtensionViewHost(const Extension* extension, + base::BindRepeating( + &autofill::BrowserDriverInitHook, + autofill::ChromeAutofillClient::FromWebContents(host_contents()), +- g_browser_process->GetApplicationLocale())); ++ g_browser_process->GetApplicationLocale(), ++ /*enable_secondary_autofill_manager*/ false)); + + // The popup itself cannot be zoomed, but we must specify a zoom level to use. + // Otherwise, if a user zooms a page of the same extension, the popup would +diff --git a/chrome/browser/ui/views/media_router/presentation_receiver_window_view.cc b/chrome/browser/ui/views/media_router/presentation_receiver_window_view.cc +--- a/chrome/browser/ui/views/media_router/presentation_receiver_window_view.cc ++++ b/chrome/browser/ui/views/media_router/presentation_receiver_window_view.cc +@@ -176,7 +176,8 @@ void PresentationReceiverWindowView::Init() { + base::BindRepeating( + &autofill::BrowserDriverInitHook, + autofill::ChromeAutofillClient::FromWebContents(web_contents), +- g_browser_process->GetApplicationLocale())); ++ g_browser_process->GetApplicationLocale(), ++ /*enable_secondary_autofill_manager*/ false)); + ChromePasswordManagerClient::CreateForWebContentsWithAutofillClient( + web_contents, + autofill::ChromeAutofillClient::FromWebContents(web_contents)); +diff --git a/components/autofill/content/browser/content_autofill_driver_factory.cc b/components/autofill/content/browser/content_autofill_driver_factory.cc +--- a/components/autofill/content/browser/content_autofill_driver_factory.cc ++++ b/components/autofill/content/browser/content_autofill_driver_factory.cc +@@ -44,12 +44,18 @@ void BrowserDriverInitHook(AutofillClient* client, + const std::string& app_locale, + bool enable_secondary_autofill_manager, + ContentAutofillDriver* driver) { ++#if BUILDFLAG(IS_ANDROID) + driver->set_autofill_manager(std::make_unique( + driver, client, app_locale, + AutofillManager::EnableDownloadManager(false)), + enable_secondary_autofill_manager == false ? nullptr : + base::WrapUnique(new AndroidAutofillManager(driver, client, + AutofillManager::EnableDownloadManager(false)))); ++#else ++ driver->set_autofill_manager(std::make_unique( ++ driver, client, app_locale, ++ AutofillManager::EnableDownloadManager(false)), nullptr); ++#endif + if (client && ShouldEnableHeavyFormDataScraping(client->GetChannel())) + driver->GetAutofillAgent()->EnableHeavyFormDataScraping(); + } +-- +2.25.1 diff --git a/build/patches/00Experimental-user-scripts-support--win-fixup-.patch b/build/patches/00Experimental-user-scripts-support--win-fixup-.patch new file mode 100644 index 00000000..7b579bd8 --- /dev/null +++ b/build/patches/00Experimental-user-scripts-support--win-fixup-.patch @@ -0,0 +1,337 @@ +From: Your Name +Date: Wed, 12 Oct 2022 09:19:46 +0000 +Subject: Experimental user scripts support (win fixup) + +--- + chrome/browser/BUILD.gn | 12 +++++++----- + chrome/browser/about_flags.cc | 2 ++ + chrome/browser/prefs/browser_prefs.cc | 2 ++ + chrome/browser/profiles/BUILD.gn | 4 +++- + ...chrome_browser_main_extra_parts_profiles.cc | 4 ++++ + chrome/browser/profiles/profile_manager.cc | 4 ++++ + chrome/browser/profiles/renderer_updater.cc | 11 ++++++++++- + chrome/browser/profiles/renderer_updater.h | 2 ++ + .../webui/chrome_web_ui_controller_factory.cc | 2 ++ + chrome/renderer/BUILD.gn | 7 ++++++- + .../renderer/chrome_content_renderer_client.cc | 18 ++++++++++++++++++ + .../renderer/chrome_render_thread_observer.cc | 2 ++ + 12 files changed, 62 insertions(+), 8 deletions(-) + +diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn +--- a/chrome/browser/BUILD.gn ++++ b/chrome/browser/BUILD.gn +@@ -3492,11 +3492,13 @@ static_library("browser") { + ] + deps += [ "//chrome/android/modules/dev_ui/provider:native" ] + } +- deps += [ +- "//components/user_scripts/common", +- "//components/user_scripts/browser", +- "//components/user_scripts/android", +- ] ++ if (is_android) { ++ deps += [ ++ "//components/user_scripts/common", ++ "//components/user_scripts/browser", ++ "//components/user_scripts/android", ++ ] ++ } + } else { + #!is_android + sources += [ +diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc +--- a/chrome/browser/about_flags.cc ++++ b/chrome/browser/about_flags.cc +@@ -7398,9 +7398,11 @@ const FeatureEntry kFeatureEntries[] = { + chromeos::features::kClipboardHistoryNudgeSessionReset)}, + #endif // BUILDFLAG(IS_CHROMEOS_ASH) + ++#if BUILDFLAG(IS_ANDROID) + {"enable-userscripts-log", flag_descriptions::kEnableLoggingUserScriptsName, + flag_descriptions::kEnableLoggingUserScriptsDescription, kOsDesktop | kOsAndroid, + FEATURE_VALUE_TYPE(user_scripts::features::kEnableLoggingUserScripts)}, ++#endif + + #if BUILDFLAG(IS_WIN) + {"enable-media-foundation-video-capture", +diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc +--- a/chrome/browser/prefs/browser_prefs.cc ++++ b/chrome/browser/prefs/browser_prefs.cc +@@ -1324,7 +1324,9 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, + translate::TranslatePrefs::RegisterProfilePrefs(registry); + omnibox::RegisterProfilePrefs(registry); + ZeroSuggestProvider::RegisterProfilePrefs(registry); ++#if BUILDFLAG(IS_ANDROID) + user_scripts::UserScriptsPrefs::RegisterProfilePrefs(registry); ++#endif + + #if BUILDFLAG(ENABLE_SESSION_SERVICE) + RegisterSessionServiceLogProfilePrefs(registry); +diff --git a/chrome/browser/profiles/BUILD.gn b/chrome/browser/profiles/BUILD.gn +--- a/chrome/browser/profiles/BUILD.gn ++++ b/chrome/browser/profiles/BUILD.gn +@@ -44,10 +44,12 @@ source_set("profile") { + "//components/profile_metrics", + "//components/sync/driver", + "//components/variations", +- "//components/user_scripts/browser", + "//content/public/browser", + "//extensions/buildflags", + ] ++ if (is_android) { ++ deps += [ "//components/user_scripts/browser" ] ++ } + if (enable_extensions) { + deps += [ "//extensions/browser" ] + } +diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc +--- a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc ++++ b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc +@@ -270,7 +270,9 @@ + #include "chrome/browser/enterprise/idle/idle_service_factory.h" + #endif + ++#if BUILDFLAG(IS_ANDROID) + #include "components/user_scripts/browser/userscripts_browser_client.h" ++#endif + + namespace chrome { + +@@ -631,7 +633,9 @@ void ChromeBrowserMainExtraPartsProfiles:: + #endif + WebDataServiceFactory::GetInstance(); + webrtc_event_logging::WebRtcEventLogManagerKeyedServiceFactory::GetInstance(); ++#if BUILDFLAG(IS_ANDROID) + user_scripts::UserScriptsBrowserClient::GetInstance(); ++#endif + } + + void ChromeBrowserMainExtraPartsProfiles::PreProfileInit() { +diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc +--- a/chrome/browser/profiles/profile_manager.cc ++++ b/chrome/browser/profiles/profile_manager.cc +@@ -115,7 +115,9 @@ + #include "extensions/common/manifest.h" + #endif + ++#if BUILDFLAG(IS_ANDROID) + #include "components/user_scripts/browser/userscripts_browser_client.h" ++#endif + + #if BUILDFLAG(ENABLE_SESSION_SERVICE) + #include "chrome/browser/sessions/app_session_service_factory.h" +@@ -1715,11 +1717,13 @@ void ProfileManager::DoFinalInitForServices(Profile* profile, + + #endif + ++#if BUILDFLAG(IS_ANDROID) + user_scripts::UserScriptsBrowserClient* userscript_client = + user_scripts::UserScriptsBrowserClient::GetInstance(); + if (userscript_client) { + userscript_client->SetProfile(profile); + } ++#endif + + #if BUILDFLAG(ENABLE_SUPERVISED_USERS) + // Initialization needs to happen after extension system initialization (for +diff --git a/chrome/browser/profiles/renderer_updater.cc b/chrome/browser/profiles/renderer_updater.cc +--- a/chrome/browser/profiles/renderer_updater.cc ++++ b/chrome/browser/profiles/renderer_updater.cc +@@ -53,7 +53,9 @@ RendererUpdater::RendererUpdater(Profile* profile) + force_google_safesearch_.Init(prefs::kForceGoogleSafeSearch, pref_service); + force_youtube_restrict_.Init(prefs::kForceYouTubeRestrict, pref_service); + allowed_domains_for_apps_.Init(prefs::kAllowedDomainsForApps, pref_service); ++#if BUILDFLAG(IS_ANDROID) + activate_userscripts_.Init(user_scripts::prefs::kUserScriptsEnabled, pref_service); ++#endif + + pref_change_registrar_.Init(pref_service); + pref_change_registrar_.Add( +@@ -68,10 +70,12 @@ RendererUpdater::RendererUpdater(Profile* profile) + prefs::kAllowedDomainsForApps, + base::BindRepeating(&RendererUpdater::UpdateAllRenderers, + base::Unretained(this))); ++#if BUILDFLAG(IS_ANDROID) + pref_change_registrar_.Add( + user_scripts::prefs::kUserScriptsEnabled, + base::BindRepeating(&RendererUpdater::UpdateAllRenderers, + base::Unretained(this))); ++#endif + } + + RendererUpdater::~RendererUpdater() { +@@ -196,5 +200,10 @@ chrome::mojom::DynamicParamsPtr RendererUpdater::CreateRendererDynamicParams() + return chrome::mojom::DynamicParams::New( + force_google_safesearch_.GetValue(), force_youtube_restrict_.GetValue(), + allowed_domains_for_apps_.GetValue(), +- activate_userscripts_.GetValue()); ++#if BUILDFLAG(IS_ANDROID) ++ activate_userscripts_.GetValue() ++#else ++ false ++#endif ++ ); + } +diff --git a/chrome/browser/profiles/renderer_updater.h b/chrome/browser/profiles/renderer_updater.h +--- a/chrome/browser/profiles/renderer_updater.h ++++ b/chrome/browser/profiles/renderer_updater.h +@@ -93,7 +93,9 @@ class RendererUpdater : public KeyedService, + + // Prefs that we sync to the renderers. + BooleanPrefMember force_google_safesearch_; ++#if BUILDFLAG(IS_ANDROID) + BooleanPrefMember activate_userscripts_; ++#endif + IntegerPrefMember force_youtube_restrict_; + StringPrefMember allowed_domains_for_apps_; + }; +diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +--- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc ++++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +@@ -818,8 +818,10 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, + return &NewWebUI; + if (url.host_piece() == chrome::kChromeUIVersionHost) + return &NewWebUI; ++#if BUILDFLAG(IS_ANDROID) + if (url.host_piece() == user_scripts::kChromeUIUserScriptsHost) + return &NewWebUI; ++#endif + + #if !BUILDFLAG(IS_ANDROID) + #if !BUILDFLAG(IS_CHROMEOS) +diff --git a/chrome/renderer/BUILD.gn b/chrome/renderer/BUILD.gn +--- a/chrome/renderer/BUILD.gn ++++ b/chrome/renderer/BUILD.gn +@@ -141,7 +141,6 @@ static_library("renderer") { + "//components/content_capture/common", + "//components/content_capture/renderer", + "//components/content_settings/common:mojom", +- "//components/user_scripts/renderer", + "//components/content_settings/renderer", + "//components/continuous_search/renderer", + "//components/dom_distiller/content/renderer", +@@ -215,6 +214,12 @@ static_library("renderer") { + "//v8", + ] + ++ if (is_android) { ++ deps += [ ++ "//components/user_scripts/renderer", ++ ] ++ } ++ + data_deps = [ "//tools/v8_context_snapshot" ] + + configs += [ "//build/config/compiler:wexit_time_destructors" ] +diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc +--- a/chrome/renderer/chrome_content_renderer_client.cc ++++ b/chrome/renderer/chrome_content_renderer_client.cc +@@ -250,8 +250,10 @@ + #include "chrome/renderer/supervised_user/supervised_user_error_page_controller_delegate_impl.h" + #endif + ++#if BUILDFLAG(IS_ANDROID) + #include "components/user_scripts/common/user_scripts_features.h" + #include "components/user_scripts/renderer/user_scripts_renderer_client.h" ++#endif + + using autofill::AutofillAgent; + using autofill::PasswordAutofillAgent; +@@ -434,11 +436,13 @@ void ChromeContentRendererClient::RenderThreadStarted() { + WebString::FromASCII(extensions::kExtensionScheme)); + #endif + ++#if BUILDFLAG(IS_ANDROID) + user_scripts::UserScriptsRendererClient* userscript_client = + user_scripts::UserScriptsRendererClient::GetInstance(); + if (userscript_client) { + userscript_client->RenderThreadStarted(); + } ++#endif + + #if BUILDFLAG(ENABLE_SPELLCHECK) + if (!spellcheck_) +@@ -584,12 +588,14 @@ void ChromeContentRendererClient::RenderFrameCreated( + render_frame, registry); + #endif + ++#if BUILDFLAG(IS_ANDROID) + user_scripts::UserScriptsRendererClient* userscript_client = + user_scripts::UserScriptsRendererClient::GetInstance(); + if (userscript_client) { + userscript_client->RenderFrameCreated( + render_frame, registry); + } ++#endif + + #if BUILDFLAG(ENABLE_PPAPI) + new PepperHelper(render_frame); +@@ -1592,6 +1598,9 @@ void ChromeContentRendererClient::RunScriptsAtDocumentStart( + ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentStart( + render_frame); + // |render_frame| might be dead by now. ++#endif ++#if BUILDFLAG(IS_ANDROID) ++#if BUILDFLAG(ENABLE_EXTENSIONS) + static_assert(false, "Compiler error: extensions cannot be enabled with user scripts"); + #endif + user_scripts::UserScriptsRendererClient* userscript_client = +@@ -1600,6 +1609,7 @@ void ChromeContentRendererClient::RunScriptsAtDocumentStart( + userscript_client->RunScriptsAtDocumentStart( + render_frame); + } ++#endif + } + + void ChromeContentRendererClient::RunScriptsAtDocumentEnd( +@@ -1608,6 +1618,9 @@ void ChromeContentRendererClient::RunScriptsAtDocumentEnd( + ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentEnd( + render_frame); + // |render_frame| might be dead by now. ++#endif ++#if BUILDFLAG(IS_ANDROID) ++#if BUILDFLAG(ENABLE_EXTENSIONS) + static_assert(false, "Compiler error: extensions cannot be enabled with user scripts"); + #endif + user_scripts::UserScriptsRendererClient* userscript_client = +@@ -1616,6 +1629,7 @@ void ChromeContentRendererClient::RunScriptsAtDocumentEnd( + userscript_client->RunScriptsAtDocumentEnd( + render_frame); + } ++#endif + } + + void ChromeContentRendererClient::RunScriptsAtDocumentIdle( +@@ -1624,6 +1638,9 @@ void ChromeContentRendererClient::RunScriptsAtDocumentIdle( + ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentIdle( + render_frame); + // |render_frame| might be dead by now. ++#endif ++#if BUILDFLAG(IS_ANDROID) ++#if BUILDFLAG(ENABLE_EXTENSIONS) + static_assert(false, "Compiler error: extensions cannot be enabled with user scripts"); + #endif + user_scripts::UserScriptsRendererClient* userscript_client = +@@ -1632,6 +1649,7 @@ void ChromeContentRendererClient::RunScriptsAtDocumentIdle( + userscript_client->RunScriptsAtDocumentIdle( + render_frame); + } ++#endif + } + + void ChromeContentRendererClient:: +diff --git a/chrome/renderer/chrome_render_thread_observer.cc b/chrome/renderer/chrome_render_thread_observer.cc +--- a/chrome/renderer/chrome_render_thread_observer.cc ++++ b/chrome/renderer/chrome_render_thread_observer.cc +@@ -255,7 +255,9 @@ void ChromeRenderThreadObserver::SetInitialConfiguration( + void ChromeRenderThreadObserver::SetConfiguration( + chrome::mojom::DynamicParamsPtr params) { + *GetDynamicConfigParams() = std::move(*params); ++#if BUILDFLAG(IS_ANDROID) + user_scripts::UserScriptsRendererClient::GetInstance()->ConfigurationUpdated(); ++#endif + } + + void ChromeRenderThreadObserver::OnRendererConfigurationAssociatedRequest( +-- +2.25.1 diff --git a/build/patches/00Eyeo-Adblock--win-fixup-.patch b/build/patches/00Eyeo-Adblock--win-fixup-.patch new file mode 100644 index 00000000..5b95a7c5 --- /dev/null +++ b/build/patches/00Eyeo-Adblock--win-fixup-.patch @@ -0,0 +1,22 @@ +From: Your Name +Date: Thu, 13 Oct 2022 10:24:51 +0000 +Subject: Eyeo Adblock (win fixup) + +--- + chrome/browser/resources/settings/adblock_page/adblock_page.ts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chrome/browser/resources/settings/adblock_page/adblock_page.ts b/chrome/browser/resources/settings/adblock_page/adblock_page.ts +--- a/chrome/browser/resources/settings/adblock_page/adblock_page.ts ++++ b/chrome/browser/resources/settings/adblock_page/adblock_page.ts +@@ -15,7 +15,7 @@ + * along with eyeo Chromium SDK. If not, see . + */ + import 'chrome://resources/cr_elements/cr_button/cr_button.js'; +-import 'chrome://resources/cr_elements/cr_shared_style.css.js'; ++//import 'chrome://resources/cr_elements/cr_shared_style.css.js'; + import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js'; + import 'chrome://resources/polymer/v3_0/iron-flex-layout/iron-flex-layout-classes.js'; + import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; +-- +2.25.1 diff --git a/build/patches/00Fix-windows-build.patch b/build/patches/00Fix-windows-build.patch new file mode 100644 index 00000000..8f46a9f0 --- /dev/null +++ b/build/patches/00Fix-windows-build.patch @@ -0,0 +1,21 @@ +From: Your Name +Date: Thu, 13 Oct 2022 10:34:52 +0000 +Subject: Fix windows build + +--- + chrome/browser/devtools/devtools_window.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/chrome/browser/devtools/devtools_window.cc b/chrome/browser/devtools/devtools_window.cc +--- a/chrome/browser/devtools/devtools_window.cc ++++ b/chrome/browser/devtools/devtools_window.cc +@@ -80,6 +80,7 @@ + #include "ui/events/keycodes/dom/keycode_converter.h" + #include "ui/events/keycodes/keyboard_code_conversion.h" + #include "ui/events/keycodes/keyboard_codes.h" ++#include "net/cert/x509_certificate.h" + + // This should be after all other #includes. + #if defined(_WINDOWS_) // Detect whether windows.h was included. +-- +2.25.1 diff --git a/build/patches/00JIT-site-settings--win-fixup-.patch b/build/patches/00JIT-site-settings--win-fixup-.patch new file mode 100644 index 00000000..b08fd462 --- /dev/null +++ b/build/patches/00JIT-site-settings--win-fixup-.patch @@ -0,0 +1,273 @@ +From: Your Name +Date: Wed, 12 Oct 2022 14:03:37 +0000 +Subject: JIT site settings (win fixup) + +--- + chrome/app/settings_strings.grdp | 19 ++++++++++++++++ + chrome/browser/resources/settings/icons.html | 2 ++ + .../settings/privacy_page/privacy_page.html | 22 +++++++++++++++++++ + chrome/browser/resources/settings/route.ts | 1 + + .../resources/settings/settings_routes.ts | 1 + + .../site_settings/category_default_setting.ts | 1 + + .../settings/site_settings/constants.ts | 1 + + .../settings_category_default_radio_group.ts | 1 + + .../settings/site_settings/site_details.html | 5 +++++ + .../recent_site_permissions.ts | 2 ++ + .../site_settings_page/site_settings_page.ts | 9 ++++++++ + .../views/page_info/page_info_view_factory.cc | 3 +++ + .../settings_localized_strings_provider.cc | 7 ++++++ + .../ui/webui/settings/site_settings_helper.cc | 3 ++- + .../core/browser/content_settings_registry.cc | 7 +++++- + 15 files changed, 82 insertions(+), 2 deletions(-) + +diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp +--- a/chrome/app/settings_strings.grdp ++++ b/chrome/app/settings_strings.grdp +@@ -3677,6 +3677,25 @@ + Not allowed to autoplay + + ++ ++ Javascript JIT ++ ++ ++ Enable the JIT compiler in V8 ++ ++ ++ Javascript JIT is enabled ++ ++ ++ Javascript JIT is disabled ++ ++ ++ Allowed to Javascript JIT ++ ++ ++ Not allowed to Javascript JIT ++ ++ + + + +diff --git a/chrome/browser/resources/settings/icons.html b/chrome/browser/resources/settings/icons.html +--- a/chrome/browser/resources/settings/icons.html ++++ b/chrome/browser/resources/settings/icons.html +@@ -170,6 +170,8 @@ NOTE: Chrome OS icons go in ./chromeos/os_icons.html. + + + ++ ++ + + + +diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chrome/browser/resources/settings/privacy_page/privacy_page.html +--- a/chrome/browser/resources/settings/privacy_page/privacy_page.html ++++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html +@@ -1026,4 +1026,26 @@ + + + ++ + +diff --git a/chrome/browser/resources/settings/route.ts b/chrome/browser/resources/settings/route.ts +--- a/chrome/browser/resources/settings/route.ts ++++ b/chrome/browser/resources/settings/route.ts +@@ -103,6 +103,7 @@ function addPrivacyChildRoutes(r: Partial) { + r.SITE_SETTINGS_FILE_SYSTEM_WRITE = r.SITE_SETTINGS.createChild('filesystem'); + r.SITE_SETTINGS_LOCAL_FONTS = r.SITE_SETTINGS.createChild('localFonts'); + r.SITE_SETTINGS_AUTOPLAY = r.SITE_SETTINGS.createChild('autoplay'); ++ r.SITE_SETTINGS_JAVASCRIPT_JIT = r.SITE_SETTINGS.createChild('javascript-jit'); + } + + /** +diff --git a/chrome/browser/resources/settings/settings_routes.ts b/chrome/browser/resources/settings/settings_routes.ts +--- a/chrome/browser/resources/settings/settings_routes.ts ++++ b/chrome/browser/resources/settings/settings_routes.ts +@@ -96,4 +96,5 @@ export interface SettingsRoutes { + SYSTEM: Route; + TRIGGERED_RESET_DIALOG: Route; + SITE_SETTINGS_AUTOPLAY: Route; ++ SITE_SETTINGS_JAVASCRIPT_JIT: Route; + } +diff --git a/chrome/browser/resources/settings/site_settings/category_default_setting.ts b/chrome/browser/resources/settings/site_settings/category_default_setting.ts +--- a/chrome/browser/resources/settings/site_settings/category_default_setting.ts ++++ b/chrome/browser/resources/settings/site_settings/category_default_setting.ts +@@ -196,6 +196,7 @@ export class CategoryDefaultSettingElement extends + case ContentSettingsTypes.SENSORS: + case ContentSettingsTypes.SOUND: + case ContentSettingsTypes.AUTOPLAY: ++ case ContentSettingsTypes.JAVASCRIPT_JIT: + // "Allowed" vs "Blocked". + this.browserProxy.setDefaultValueForContentType( + this.category, +diff --git a/chrome/browser/resources/settings/site_settings/constants.ts b/chrome/browser/resources/settings/site_settings/constants.ts +--- a/chrome/browser/resources/settings/site_settings/constants.ts ++++ b/chrome/browser/resources/settings/site_settings/constants.ts +@@ -43,6 +43,7 @@ export enum ContentSettingsTypes { + WINDOW_PLACEMENT = 'window-placement', + ZOOM_LEVELS = 'zoom-levels', + AUTOPLAY = 'autoplay', ++ JAVASCRIPT_JIT = 'javascript-jit', + + // The following item is not in the C++ kContentSettingsTypeGroupNames, but it + // is used everywhere where ContentSettingsTypes is used in JS. +diff --git a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts +--- a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts ++++ b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts +@@ -140,6 +140,7 @@ export class SettingsCategoryDefaultRadioGroupElement extends + case ContentSettingsTypes.SENSORS: + case ContentSettingsTypes.SOUND: + case ContentSettingsTypes.AUTOPLAY: ++ case ContentSettingsTypes.JAVASCRIPT_JIT: + // "Allowed" vs "Blocked". + return ContentSetting.ALLOW; + case ContentSettingsTypes.AR: +diff --git a/chrome/browser/resources/settings/site_settings/site_details.html b/chrome/browser/resources/settings/site_settings/site_details.html +--- a/chrome/browser/resources/settings/site_settings/site_details.html ++++ b/chrome/browser/resources/settings/site_settings/site_details.html +@@ -228,4 +228,9 @@ + icon="settings:federated-identity-api" + label="$i18n{siteSettingsFederatedIdentityApi}"> + ++ ++ + +diff --git a/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts b/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts +--- a/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts ++++ b/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts +@@ -198,6 +198,8 @@ export class SettingsRecentSitePermissionsElement extends + return this.i18n('siteSettingsIdleDetectionMidSentence'); + case ContentSettingsTypes.AUTOPLAY: + return this.i18n('siteSettingsAutoplayMidSentence'); ++ case ContentSettingsTypes.JAVASCRIPT_JIT: ++ return this.i18n('siteSettingsJavascriptJITMidSentence'); + default: + return ''; + } +diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts +--- a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts ++++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts +@@ -321,6 +321,14 @@ function getCategoryItemMap(): Map { + enabledLabel: 'siteSettingsAutoplayAllowed', + disabledLabel: 'siteSettingsAutoplayBlocked', + }, ++ { ++ route: routes.SITE_SETTINGS_JAVASCRIPT_JIT, ++ id: Id.JAVASCRIPT_JIT, ++ label: 'siteSettingsJavascriptJIT', ++ icon: 'settings:javascript-jit', ++ enabledLabel: 'siteSettingsJavascriptJITAllowed', ++ disabledLabel: 'siteSettingsJavascriptJITBlocked', ++ }, + ]; + + categoryItemMap = new Map(categoryList.map(item => [item.id, item])); +@@ -404,6 +412,7 @@ export class SettingsSiteSettingsPageElement extends PolymerElement { + Id.MIXEDSCRIPT, + Id.FEDERATED_IDENTITY_API, + Id.AUTOPLAY, ++ Id.JAVASCRIPT_JIT, + ]), + }; + }, +diff --git a/chrome/browser/ui/views/page_info/page_info_view_factory.cc b/chrome/browser/ui/views/page_info/page_info_view_factory.cc +--- a/chrome/browser/ui/views/page_info/page_info_view_factory.cc ++++ b/chrome/browser/ui/views/page_info/page_info_view_factory.cc +@@ -332,6 +332,9 @@ const ui::ImageModel PageInfoViewFactory::GetPermissionIcon( + case ContentSettingsType::AUTOPLAY: + icon = &vector_icons::kProtectedContentIcon; + break; ++ case ContentSettingsType::JAVASCRIPT_JIT: ++ icon = &vector_icons::kCodeIcon; ++ break; + default: + // All other |ContentSettingsType|s do not have icons on desktop or are + // not shown in the Page Info bubble. +diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc ++++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +@@ -2090,6 +2090,13 @@ void AddSiteSettingsStrings(content::WebUIDataSource* html_source, + {"siteSettingsAutoplayAllowedExceptions",IDS_SETTINGS_SITE_SETTINGS_AUTOPLAY_ALLOWED_EXCEPTIONS}, + {"siteSettingsAutoplayBlockedExceptions", IDS_SETTINGS_SITE_SETTINGS_AUTOPLAY_BLOCKED_EXCEPTIONS}, + {"siteSettingsAutoplayMidSentence", IDS_SITE_SETTINGS_TYPE_AUTOPLAY}, ++ {"siteSettingsJavascriptJIT", IDS_SITE_SETTINGS_JAVASCRIPT_JIT_TITLE}, ++ {"siteSettingsJavascriptJITDescription", IDS_SETTINGS_SITE_SETTINGS_JAVASCRIPT_JIT_DESCRIPTION}, ++ {"siteSettingsJavascriptJITAllowed", IDS_SETTINGS_SITE_SETTINGS_JAVASCRIPT_JIT_ALLOWED}, ++ {"siteSettingsJavascriptJITBlocked", IDS_SETTINGS_SITE_SETTINGS_JAVASCRIPT_JIT_BLOCKED}, ++ {"siteSettingsJavascriptJITAllowedExceptions",IDS_SETTINGS_SITE_SETTINGS_JAVASCRIPT_JIT_ALLOWED_EXCEPTIONS}, ++ {"siteSettingsJavascriptJITBlockedExceptions", IDS_SETTINGS_SITE_SETTINGS_JAVASCRIPT_JIT_BLOCKED_EXCEPTIONS}, ++ {"siteSettingsJavascriptJITMidSentence", IDS_SITE_SETTINGS_TYPE_JAVASCRIPT_JIT}, + {"addSite", IDS_SETTINGS_ADD_SITE}, + {"addSiteTitle", IDS_SETTINGS_ADD_SITE_TITLE}, + #if BUILDFLAG(IS_CHROMEOS_ASH) +diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/browser/ui/webui/settings/site_settings_helper.cc +--- a/chrome/browser/ui/webui/settings/site_settings_helper.cc ++++ b/chrome/browser/ui/webui/settings/site_settings_helper.cc +@@ -116,6 +116,7 @@ const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = { + "file-system-access-handles-data"}, + {ContentSettingsType::FEDERATED_IDENTITY_API, "federated-identity-api"}, + {ContentSettingsType::AUTOPLAY, "autoplay"}, ++ {ContentSettingsType::JAVASCRIPT_JIT, "javascript-jit"}, + + // Add new content settings here if a corresponding Javascript string + // representation for it is not required, for example if the content setting +@@ -153,7 +154,6 @@ const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = { + {ContentSettingsType::FILE_SYSTEM_LAST_PICKED_DIRECTORY, nullptr}, + {ContentSettingsType::DISPLAY_CAPTURE, nullptr}, + {ContentSettingsType::FEDERATED_IDENTITY_SHARING, nullptr}, +- {ContentSettingsType::JAVASCRIPT_JIT, nullptr}, + {ContentSettingsType::HTTP_ALLOWED, nullptr}, + {ContentSettingsType::FORMFILL_METADATA, nullptr}, + {ContentSettingsType::FEDERATED_IDENTITY_ACTIVE_SESSION, nullptr}, +@@ -447,6 +447,7 @@ const std::vector& GetVisiblePermissionCategories() { + } + + base_types->push_back(ContentSettingsType::AUTOPLAY); ++ base_types->push_back(ContentSettingsType::JAVASCRIPT_JIT); + + initialized = true; + } +diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc +--- a/components/content_settings/core/browser/content_settings_registry.cc ++++ b/components/content_settings/core/browser/content_settings_registry.cc +@@ -621,7 +621,12 @@ void ContentSettingsRegistry::Init() { + ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY); + + Register(ContentSettingsType::JAVASCRIPT_JIT, "javascript-jit", +- CONTENT_SETTING_BLOCK, WebsiteSettingsInfo::UNSYNCABLE, ++#if BUILDFLAG(IS_ANDROID) ++ CONTENT_SETTING_BLOCK, ++#else ++ CONTENT_SETTING_ALLOW, ++#endif ++ WebsiteSettingsInfo::UNSYNCABLE, + AllowlistedSchemes(), + ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK), + WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE, +-- +2.25.1 diff --git a/build/patches/00Logcat-crash-reports-UI--win-fixup-.patch b/build/patches/00Logcat-crash-reports-UI--win-fixup-.patch new file mode 100644 index 00000000..8722df13 --- /dev/null +++ b/build/patches/00Logcat-crash-reports-UI--win-fixup-.patch @@ -0,0 +1,81 @@ +From: Your Name +Date: Thu, 13 Oct 2022 11:27:08 +0000 +Subject: Logcat crash reports UI (win fixup) + +--- + chrome/browser/ui/webui/crashes_ui.cc | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/chrome/browser/ui/webui/crashes_ui.cc b/chrome/browser/ui/webui/crashes_ui.cc +--- a/chrome/browser/ui/webui/crashes_ui.cc ++++ b/chrome/browser/ui/webui/crashes_ui.cc +@@ -44,7 +44,9 @@ + #include "base/files/scoped_temp_dir.h" + #include "base/task/task_traits.h" + #include "base/task/thread_pool.h" ++#if BUILDFLAG(IS_ANDROID) + #include "base/android/path_utils.h" ++#endif + #include "net/base/filename_util.h" + #include "third_party/zlib/google/zip.h" + +@@ -147,6 +149,9 @@ CrashesDOMHandler::CrashesDOMHandler(content::WebContents* web_contents) + : list_available_(false), first_load_(true), + web_contents_(web_contents) { + upload_list_ = CreateCrashUploadList(); ++#if !BUILDFLAG(IS_ANDROID) ++ web_contents_ = nullptr; ++#endif + } + + CrashesDOMHandler::~CrashesDOMHandler() { +@@ -285,6 +290,7 @@ void CrashesDOMHandler::HandleRequestSingleCrashUpload( + } + + std::string CrashesDOMHandler::RequestSingleUpload(const std::string& local_id) const { ++#if BUILDFLAG(IS_ANDROID) + // get crash file path + std::string info_file_path = upload_list_->GetFilePathByLocalId(local_id); + if (info_file_path.empty()) { +@@ -332,13 +338,14 @@ std::string CrashesDOMHandler::RequestSingleUpload(const std::string& local_id) + if (result) { + return zip_file_name.value(); + } +- ++#endif + LOG(ERROR) << "Crash report: cannot create zip content"; + return std::string(); + } + + void CrashesDOMHandler::RequestSingleUploadCallback(const std::string& local_id, + const std::string& file_name) { ++#if BUILDFLAG(IS_ANDROID) + if (!file_name.empty()) { + upload_list_->RequestSingleUploadAsync(local_id); + +@@ -346,6 +353,7 @@ void CrashesDOMHandler::RequestSingleUploadCallback(const std::string& local_id, + web_contents_->GetController().LoadURL( + net::FilePathToFileURL(file_path), {}, {}, {}); + } ++#endif + } + + void CrashesDOMHandler::HandleRequestNewExtraction( +@@ -370,6 +378,7 @@ void CrashesDOMHandler::HandleRequestClearAll( + } + + void CrashesDOMHandler::ClearAll() { ++#if BUILDFLAG(IS_ANDROID) + // get android crash report dir + base::FilePath cache_dir; + base::android::GetCacheDirectory(&cache_dir); +@@ -383,6 +392,7 @@ void CrashesDOMHandler::ClearAll() { + // remove all files, don't care for result + base::DeleteFile(full_name); + } ++#endif + } + + } // namespace +-- +2.25.1 diff --git a/build/patches/00Remove-EV-certificates--win-fixup-.patch b/build/patches/00Remove-EV-certificates--win-fixup-.patch new file mode 100644 index 00000000..9f74b7d6 --- /dev/null +++ b/build/patches/00Remove-EV-certificates--win-fixup-.patch @@ -0,0 +1,22 @@ +From: Your Name +Date: Wed, 12 Oct 2022 11:35:41 +0000 +Subject: Remove EV certificates (win fixup) + +--- + net/cert/ev_root_ca_metadata.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/cert/ev_root_ca_metadata.cc b/net/cert/ev_root_ca_metadata.cc +--- a/net/cert/ev_root_ca_metadata.cc ++++ b/net/cert/ev_root_ca_metadata.cc +@@ -67,7 +67,7 @@ EVRootCAMetadata* EVRootCAMetadata::GetInstance() { + return g_ev_root_ca_metadata.Pointer(); + } + +-#if BUILDFLAG(IS_WIN) ++#if BUILDFLAG(IS_WIN) && defined(PLATFORM_USES_CHROMIUM_EV_METADATA) + + namespace { + +-- +2.25.1 diff --git a/build/patches/00Remove-binary-blob-integrations--win-fixup-.patch b/build/patches/00Remove-binary-blob-integrations--win-fixup-.patch new file mode 100644 index 00000000..249406b6 --- /dev/null +++ b/build/patches/00Remove-binary-blob-integrations--win-fixup-.patch @@ -0,0 +1,49 @@ +From: Your Name +Date: Wed, 12 Oct 2022 11:41:35 +0000 +Subject: Remove binary blob integrations (win fixup) + +--- + components/gcm_driver/gcm_client_impl.cc | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc +--- a/components/gcm_driver/gcm_client_impl.cc ++++ b/components/gcm_driver/gcm_client_impl.cc +@@ -465,7 +465,7 @@ void GCMClientImpl::StartGCM() { + + void GCMClientImpl::InitializeMCSClient() { + DCHECK(network_connection_tracker_); +- return; ++ if ((true)) return; + std::vector endpoints; + endpoints.push_back(gservices_settings_.GetMCSMainEndpoint()); + GURL fallback_endpoint = gservices_settings_.GetMCSFallbackEndpoint(); +@@ -660,7 +660,7 @@ void GCMClientImpl::AddHeartbeatInterval(const std::string& scope, + int interval_ms) { + DCHECK(io_task_runner_->RunsTasksInCurrentSequence()); + DCHECK(mcs_client_); +- return; ++ if ((true)) return; + mcs_client_->AddHeartbeatInterval(scope, interval_ms); + } + +@@ -672,7 +672,7 @@ void GCMClientImpl::RemoveHeartbeatInterval(const std::string& scope) { + + void GCMClientImpl::StartCheckin() { + DCHECK(io_task_runner_->RunsTasksInCurrentSequence()); +- return; ++ if ((true)) return; + + // Make sure no checkin is in progress. + if (checkin_request_) +@@ -755,7 +755,7 @@ void GCMClientImpl::SetGServicesSettingsCallback(bool success) { + + void GCMClientImpl::SchedulePeriodicCheckin() { + DCHECK(io_task_runner_->RunsTasksInCurrentSequence()); +- return; ++ if ((true)) return; + + // Make sure no checkin is in progress. + if (checkin_request_.get() || !device_checkin_info_.accounts_set) +-- +2.25.1 diff --git a/build/patches/00Remove-signin-and-sync-integrations--win-fixup-.patch b/build/patches/00Remove-signin-and-sync-integrations--win-fixup-.patch new file mode 100644 index 00000000..a76df59b --- /dev/null +++ b/build/patches/00Remove-signin-and-sync-integrations--win-fixup-.patch @@ -0,0 +1,1189 @@ +From: Your Name +Date: Wed, 12 Oct 2022 11:50:53 +0000 +Subject: Remove signin and sync integrations (win fixup) + +--- + chrome/browser/BUILD.gn | 8 - + .../signin/identity_manager_factory.cc | 7 - + .../identity_services_provider_android.cc | 12 +- + chrome/browser/signin/signin_ui_util.cc | 23 - + chrome/browser/ui/BUILD.gn | 6 - + .../startup/startup_browser_creator_impl.cc | 4 +- + .../profile_customization_bubble_view.cc | 1 - + ...rofile_picker_signed_in_flow_controller.cc | 36 -- + .../webui/signin/profile_customization_ui.cc | 3 +- + .../ui/webui/signin/profile_picker_handler.cc | 2 + + components/signin/public/android/BUILD.gn | 1 - + .../identitymanager/IdentityManager.java | 21 +- + .../identity_manager/identity_manager.cc | 472 ++---------------- + .../identity_manager/identity_manager.h | 47 +- + .../identity_manager_builder.cc | 3 + + 15 files changed, 45 insertions(+), 601 deletions(-) + +diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn +--- a/chrome/browser/BUILD.gn ++++ b/chrome/browser/BUILD.gn +@@ -4227,8 +4227,6 @@ static_library("browser") { + "sharing_hub/sharing_hub_service_factory.h", + "signin/signin_promo.cc", + "signin/signin_promo.h", +- "signin/signin_ui_delegate.cc", +- "signin/signin_ui_delegate.h", + "signin/signin_ui_util.cc", + "signin/signin_ui_util.h", + "speech/chrome_speech_recognition_service.cc", +@@ -6879,12 +6877,6 @@ static_library("browser") { + "signin/signin_ui_delegate_impl_dice.cc", + "signin/signin_ui_delegate_impl_dice.h", + ] +- if (is_win) { +- sources += [ +- "signin/signin_util_win.cc", +- "signin/signin_util_win.h", +- ] +- } + } + + if (enable_media_remoting) { +diff --git a/chrome/browser/signin/identity_manager_factory.cc b/chrome/browser/signin/identity_manager_factory.cc +--- a/chrome/browser/signin/identity_manager_factory.cc ++++ b/chrome/browser/signin/identity_manager_factory.cc +@@ -50,7 +50,6 @@ + + #if BUILDFLAG(IS_WIN) + #include "base/bind.h" +-#include "chrome/browser/signin/signin_util_win.h" + #endif + + void IdentityManagerFactory::RegisterProfilePrefs( +@@ -153,12 +152,6 @@ KeyedService* IdentityManagerFactory::BuildServiceInstanceFor( + params.is_regular_profile = is_regular_profile; + #endif + +-#if BUILDFLAG(IS_WIN) +- params.reauth_callback = +- base::BindRepeating(&signin_util::ReauthWithCredentialProviderIfPossible, +- base::Unretained(profile)); +-#endif +- + std::unique_ptr identity_manager = + signin::BuildIdentityManager(¶ms); + +diff --git a/chrome/browser/signin/identity_services_provider_android.cc b/chrome/browser/signin/identity_services_provider_android.cc +--- a/chrome/browser/signin/identity_services_provider_android.cc ++++ b/chrome/browser/signin/identity_services_provider_android.cc +@@ -16,24 +16,16 @@ static ScopedJavaLocalRef + JNI_IdentityServicesProvider_GetIdentityManager( + JNIEnv* env, + const JavaParamRef& j_profile_android) { +- Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile_android); +- signin::IdentityManager* identity_manager = +- IdentityManagerFactory::GetForProfile(profile); + // Ensuring that the pointer is not null here produces unactionable stack + // traces, so just let the Java side handle possible issues with null. +- return identity_manager ? identity_manager->GetJavaObject() : nullptr; ++ return nullptr; + } + + static ScopedJavaLocalRef + JNI_IdentityServicesProvider_GetAccountTrackerService( + JNIEnv* env, + const JavaParamRef& j_profile_android) { +- Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile_android); +- signin::IdentityManager* identity_manager = +- IdentityManagerFactory::GetForProfile(profile); + // Ensuring that the pointer is not null here produces unactionable stack + // traces, so just let the Java side handle possible issues with null. +- return identity_manager +- ? identity_manager->LegacyGetAccountTrackerServiceJavaObject() +- : nullptr; ++ return nullptr; + } +diff --git a/chrome/browser/signin/signin_ui_util.cc b/chrome/browser/signin/signin_ui_util.cc +--- a/chrome/browser/signin/signin_ui_util.cc ++++ b/chrome/browser/signin/signin_ui_util.cc +@@ -28,13 +28,11 @@ + #include "chrome/browser/signin/account_consistency_mode_manager.h" + #include "chrome/browser/signin/identity_manager_factory.h" + #include "chrome/browser/signin/signin_features.h" +-#include "chrome/browser/signin/signin_ui_delegate.h" + #include "chrome/browser/ui/browser.h" + #include "chrome/browser/ui/browser_navigator.h" + #include "chrome/browser/ui/browser_navigator_params.h" + #include "chrome/browser/ui/chrome_pages.h" + #include "chrome/browser/ui/ui_features.h" +-#include "chrome/browser/ui/webui/signin/turn_sync_on_helper.h" + #include "chrome/common/pref_names.h" + #include "components/feature_engagement/public/tracker.h" + #include "components/prefs/pref_service.h" +@@ -223,10 +221,6 @@ void ShowReauthForAccount(Profile* profile, + #else + // Pass `false` for `enable_sync`, as this function is not expected to start a + // sync setup flow after the reauth. +- GetSigninUiDelegate()->ShowReauthUI( +- profile, email, +- /*enable_sync=*/false, access_point, +- signin_metrics::PromoAction::PROMO_ACTION_NO_SIGNIN_PROMO); + #endif + } + +@@ -253,18 +247,10 @@ void ShowExtensionSigninPrompt(Profile* profile, + + if (email_hint.empty()) { + // Add a new account. +- GetSigninUiDelegate()->ShowSigninUI( +- profile, enable_sync, +- signin_metrics::AccessPoint::ACCESS_POINT_EXTENSIONS, +- signin_metrics::PromoAction::PROMO_ACTION_NO_SIGNIN_PROMO); + return; + } + + // Re-authenticate an existing account. +- GetSigninUiDelegate()->ShowReauthUI( +- profile, email_hint, enable_sync, +- signin_metrics::AccessPoint::ACCESS_POINT_EXTENSIONS, +- signin_metrics::PromoAction::PROMO_ACTION_NO_SIGNIN_PROMO); + #endif // BUILDFLAG(IS_CHROMEOS_ASH) + } + +@@ -298,8 +284,6 @@ void EnableSyncFromMultiAccountPromo(Profile* profile, + PROMO_ACTION_NEW_ACCOUNT_NO_EXISTING_ACCOUNT + : signin_metrics::PromoAction:: + PROMO_ACTION_NEW_ACCOUNT_EXISTING_ACCOUNT; +- GetSigninUiDelegate()->ShowSigninUI(profile, /*enable_sync=*/true, +- access_point, new_account_promo_action); + return; + } + +@@ -318,19 +302,12 @@ void EnableSyncFromMultiAccountPromo(Profile* profile, + identity_manager->HasAccountWithRefreshTokenInPersistentErrorState( + account.account_id); + if (needs_reauth_before_enable_sync) { +- GetSigninUiDelegate()->ShowReauthUI(profile, account.email, +- /*enable_sync=*/true, access_point, +- existing_account_promo_action); + return; + } + + signin_metrics::LogSigninAccessPointStarted(access_point, + existing_account_promo_action); + signin_metrics::RecordSigninUserActionForAccessPoint(access_point); +- GetSigninUiDelegate()->ShowTurnSyncOnUI( +- profile, access_point, existing_account_promo_action, +- signin_metrics::Reason::kSigninPrimaryAccount, account.account_id, +- TurnSyncOnHelper::SigninAbortedMode::KEEP_ACCOUNT); + #else + NOTREACHED(); + #endif // BUILDFLAG(ENABLE_DICE_SUPPORT) || BUILDFLAG(IS_CHROMEOS_LACROS) +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 +@@ -3544,12 +3544,6 @@ static_library("ui") { + "webui/signin/signin_ui_error.h", + "webui/signin/signin_utils_desktop.cc", + "webui/signin/signin_utils_desktop.h", +- "webui/signin/turn_sync_on_helper.cc", +- "webui/signin/turn_sync_on_helper.h", +- "webui/signin/turn_sync_on_helper_delegate_impl.cc", +- "webui/signin/turn_sync_on_helper_delegate_impl.h", +- "webui/signin/turn_sync_on_helper_policy_fetch_tracker.cc", +- "webui/signin/turn_sync_on_helper_policy_fetch_tracker.h", + ] + + deps += [ +diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc +--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc ++++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc +@@ -351,7 +351,6 @@ StartupBrowserCreatorImpl::DetermineURLsAndLaunch( + IncompatibleApplicationsUpdater::HasCachedApplications(); + } + #endif +- welcome::JoinOnboardingGroup(profile_); + #endif + + // Presentation of promotional and/or educational tabs may be controlled via +@@ -379,8 +378,7 @@ StartupBrowserCreatorImpl::DetermineURLsAndLaunch( + if (AccountConsistencyModeManager::IsMirrorEnabledForProfile(profile_)) + welcome_enabled = false; + #elif !BUILDFLAG(IS_CHROMEOS_ASH) +- welcome_enabled = +- welcome::IsEnabled(profile_) && welcome::HasModulesToShow(profile_); ++ welcome_enabled = false; + #endif // !BUILDFLAG(IS_CHROMEOS_ASH) + + const bool whats_new_enabled = +diff --git a/chrome/browser/ui/views/profiles/profile_customization_bubble_view.cc b/chrome/browser/ui/views/profiles/profile_customization_bubble_view.cc +--- a/chrome/browser/ui/views/profiles/profile_customization_bubble_view.cc ++++ b/chrome/browser/ui/views/profiles/profile_customization_bubble_view.cc +@@ -42,7 +42,6 @@ ProfileCustomizationBubbleView* ProfileCustomizationBubbleView::CreateBubble( + // Return value is only used in tests, so it's fine to return nullptr if a + // `ProfileCustomizationBubbleView` was not created. + if (base::FeatureList::IsEnabled(kSyncPromoAfterSigninIntercept)) { +- browser->signin_view_controller()->ShowModalProfileCustomizationDialog(); + return nullptr; + } + +diff --git a/chrome/browser/ui/views/profiles/profile_picker_signed_in_flow_controller.cc b/chrome/browser/ui/views/profiles/profile_picker_signed_in_flow_controller.cc +--- a/chrome/browser/ui/views/profiles/profile_picker_signed_in_flow_controller.cc ++++ b/chrome/browser/ui/views/profiles/profile_picker_signed_in_flow_controller.cc +@@ -9,10 +9,8 @@ + #include "chrome/browser/signin/identity_manager_factory.h" + #include "chrome/browser/themes/theme_service.h" + #include "chrome/browser/themes/theme_service_factory.h" +-#include "chrome/browser/ui/views/profiles/profile_picker_turn_sync_on_delegate.h" + #include "chrome/browser/ui/webui/signin/signin_url_utils.h" + #include "chrome/browser/ui/webui/signin/sync_confirmation_ui.h" +-#include "chrome/browser/ui/webui/signin/turn_sync_on_helper.h" + #include "chrome/common/webui_url_constants.h" + #include "components/signin/public/identity_manager/account_info.h" + #include "content/public/browser/context_menu_params.h" +@@ -45,27 +43,6 @@ ProfilePickerSignedInFlowController::~ProfilePickerSignedInFlowController() { + + void ProfilePickerSignedInFlowController::Init() { + contents()->SetDelegate(this); +- +- const CoreAccountInfo& account_info = +- IdentityManagerFactory::GetForProfile(profile_)->GetPrimaryAccountInfo( +- signin::ConsentLevel::kSignin); +- DCHECK(!account_info.IsEmpty()) << "A profile with valid (unconsented) " +- "primary account must be passed in."; +- email_ = account_info.email; +- +- base::OnceClosure sync_consent_completed_closure = base::BindOnce( +- &ProfilePickerSignedInFlowController::FinishAndOpenBrowser, +- weak_ptr_factory_.GetWeakPtr(), ProfilePicker::BrowserOpenedCallback()); +- +- // TurnSyncOnHelper deletes itself once done. +- new TurnSyncOnHelper( +- profile_, signin_metrics::AccessPoint::ACCESS_POINT_USER_MANAGER, +- signin_metrics::PromoAction::PROMO_ACTION_NO_SIGNIN_PROMO, +- signin_metrics::Reason::kSigninPrimaryAccount, account_info.account_id, +- TurnSyncOnHelper::SigninAbortedMode::KEEP_ACCOUNT, +- std::make_unique( +- weak_ptr_factory_.GetWeakPtr(), profile_), +- std::move(sync_consent_completed_closure)); + } + + void ProfilePickerSignedInFlowController::Cancel() {} +@@ -160,19 +137,6 @@ void ProfilePickerSignedInFlowController:: + signin::SigninChoiceCallback proceed_callback) { + DCHECK(IsInitialized()); + // Initialize the WebUI page once we know it's committed. +- EnterpriseProfileWelcomeUI* enterprise_profile_welcome_ui = +- contents() +- ->GetWebUI() +- ->GetController() +- ->GetAs(); +- +- enterprise_profile_welcome_ui->Initialize( +- /*browser=*/nullptr, type, +- IdentityManagerFactory::GetForProfile(profile_) +- ->FindExtendedAccountInfoByEmailAddress(email_), +- /*profile_creation_required_by_policy=*/false, +- /*show_link_data_option=*/false, GetProfileColor(), +- std::move(proceed_callback)); + } + + bool ProfilePickerSignedInFlowController::IsInitialized() const { +diff --git a/chrome/browser/ui/webui/signin/profile_customization_ui.cc b/chrome/browser/ui/webui/signin/profile_customization_ui.cc +--- a/chrome/browser/ui/webui/signin/profile_customization_ui.cc ++++ b/chrome/browser/ui/webui/signin/profile_customization_ui.cc +@@ -88,10 +88,11 @@ ProfileCustomizationUI::ProfileCustomizationUI(content::WebUI* web_ui) + "profileCustomizationInDialogDesign", + base::FeatureList::IsEnabled(kSyncPromoAfterSigninIntercept)); + const GURL& url = web_ui->GetWebContents()->GetVisibleURL(); ++#if BUILDFLAG(ENABLE_DICE_SUPPORT) + source->AddBoolean("isLocalProfileCreation", + GetProfileCustomizationStyle(url) == + ProfileCustomizationStyle::kLocalProfileCreation); +- ++#endif + if (url.query() == "debug") { + // Not intended to be hooked to anything. The bubble will not initialize it + // so we force it here. +diff --git a/chrome/browser/ui/webui/signin/profile_picker_handler.cc b/chrome/browser/ui/webui/signin/profile_picker_handler.cc +--- a/chrome/browser/ui/webui/signin/profile_picker_handler.cc ++++ b/chrome/browser/ui/webui/signin/profile_picker_handler.cc +@@ -893,8 +893,10 @@ void ProfilePickerHandler::HandleSelectAccountLacros( + const base::Value::List& args) { + AllowJavascript(); + CHECK_EQ(2U, args.size()); ++#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(ENABLE_DICE_SUPPORT) + absl::optional profile_color = args[0].GetIfInt(); + const std::string& gaia_id = args[1].GetString(); ++#endif + + #if BUILDFLAG(IS_CHROMEOS_LACROS) + if (IsSelectingSecondaryAccount(web_ui())) { +diff --git a/components/signin/public/android/BUILD.gn b/components/signin/public/android/BUILD.gn +--- a/components/signin/public/android/BUILD.gn ++++ b/components/signin/public/android/BUILD.gn +@@ -64,7 +64,6 @@ generate_jni("jni_headers") { + "java/src/org/chromium/components/signin/base/CoreAccountInfo.java", + "java/src/org/chromium/components/signin/base/GoogleServiceAuthError.java", + "java/src/org/chromium/components/signin/identitymanager/AccountTrackerService.java", +- "java/src/org/chromium/components/signin/identitymanager/IdentityManager.java", + "java/src/org/chromium/components/signin/identitymanager/IdentityMutator.java", + "java/src/org/chromium/components/signin/identitymanager/PrimaryAccountChangeEvent.java", + "java/src/org/chromium/components/signin/identitymanager/ProfileOAuth2TokenServiceDelegate.java", +diff --git a/components/signin/public/android/java/src/org/chromium/components/signin/identitymanager/IdentityManager.java b/components/signin/public/android/java/src/org/chromium/components/signin/identitymanager/IdentityManager.java +--- a/components/signin/public/android/java/src/org/chromium/components/signin/identitymanager/IdentityManager.java ++++ b/components/signin/public/android/java/src/org/chromium/components/signin/identitymanager/IdentityManager.java +@@ -153,7 +153,7 @@ public class IdentityManager { + */ + @VisibleForTesting + public CoreAccountInfo[] getAccountsWithRefreshTokens() { +- return IdentityManagerJni.get().getAccountsWithRefreshTokens(mNativeIdentityManager); ++ return new CoreAccountInfo[] {}; + } + + /** +@@ -164,7 +164,7 @@ public class IdentityManager { + * @param consentLevel {@link ConsentLevel} necessary for the caller. + */ + public @Nullable CoreAccountInfo getPrimaryAccountInfo(@ConsentLevel int consentLevel) { +- return IdentityManagerJni.get().getPrimaryAccountInfo(mNativeIdentityManager, consentLevel); ++ return null; + } + + /** +@@ -172,8 +172,7 @@ public class IdentityManager { + * cannot be found, return a null value. + */ + public @Nullable AccountInfo findExtendedAccountInfoByEmailAddress(String email) { +- return IdentityManagerJni.get().findExtendedAccountInfoByEmailAddress( +- mNativeIdentityManager, email); ++ return null; + } + + /** +@@ -181,10 +180,6 @@ public class IdentityManager { + * list of {@link CoreAccountInfo} if the existing ones are stale. + */ + public void refreshAccountInfoIfStale(List accountInfos) { +- for (CoreAccountInfo accountInfo : accountInfos) { +- IdentityManagerJni.get().refreshAccountInfoIfStale( +- mNativeIdentityManager, accountInfo.getId()); +- } + } + + /** +@@ -217,14 +212,4 @@ public class IdentityManager { + public void setRefreshTokenUpdateObserverForTests(Callback callback) { + mRefreshTokenUpdateObserver = callback; + } +- +- @NativeMethods +- public interface Natives { +- @Nullable +- CoreAccountInfo getPrimaryAccountInfo(long nativeIdentityManager, int consentLevel); +- @Nullable +- AccountInfo findExtendedAccountInfoByEmailAddress(long nativeIdentityManager, String email); +- CoreAccountInfo[] getAccountsWithRefreshTokens(long nativeIdentityManager); +- void refreshAccountInfoIfStale(long nativeIdentityManager, CoreAccountId coreAccountId); +- } + } +diff --git a/components/signin/public/identity_manager/identity_manager.cc b/components/signin/public/identity_manager/identity_manager.cc +--- a/components/signin/public/identity_manager/identity_manager.cc ++++ b/components/signin/public/identity_manager/identity_manager.cc +@@ -31,7 +31,6 @@ + #include "base/android/jni_string.h" + #include "base/metrics/histogram_functions.h" + #include "components/signin/internal/identity_manager/profile_oauth2_token_service_delegate.h" +-#include "components/signin/public/android/jni_headers/IdentityManager_jni.h" + #endif + + #if BUILDFLAG(ENABLE_DICE_SUPPORT) +@@ -46,179 +45,31 @@ + + namespace signin { + +-namespace { +- +-#if BUILDFLAG(IS_CHROMEOS_LACROS) +- +-void SetPrimaryAccount(IdentityManager* identity_manager, +- AccountTrackerService* account_tracker_service, +- SigninClient* signin_client, +- const account_manager::Account& device_account, +- signin::Tribool device_account_is_child, +- ConsentLevel requested_level) { +- if (device_account.key.account_type() != account_manager::AccountType::kGaia) +- return; +- +- // An account can be set as the Primary Account only if it exists in +- // `AccountTrackerService`. However, for the first run, when accounts have not +- // yet been received from `AccountManagerFacade`, entities can ask about the +- // Primary Account and expect it to be available pretty early. Manually seed +- // the account in `AccountTrackerService` to get around this issue. +- const CoreAccountId device_account_id = +- account_tracker_service->SeedAccountInfo( +- /*gaia=*/device_account.key.id(), device_account.raw_email); +- +- const CoreAccountId primary_account_id = +- identity_manager->GetPrimaryAccountId(requested_level); +- DCHECK(signin_client); +- +- if (primary_account_id == device_account_id) { +- identity_manager->GetAccountsMutator()->UpdateAccountInfo( +- device_account_id, device_account_is_child, signin::Tribool::kUnknown); +- +- return; // Already correct primary account set, nothing to do. +- } +- +- if (!primary_account_id.empty()) { +- // Different primary account found, have to clear it first. +- // TODO(https://crbug.com/1223364): Replace this if with a CHECK after all +- // the existing users have been migrated. +- identity_manager->GetPrimaryAccountMutator()->ClearPrimaryAccount( +- signin_metrics::ACCOUNT_REMOVED_FROM_DEVICE, +- signin_metrics::SignoutDelete::kIgnoreMetric); +- } +- +- PrimaryAccountMutator::PrimaryAccountError error = +- identity_manager->GetPrimaryAccountMutator()->SetPrimaryAccount( +- device_account_id, requested_level); +- identity_manager->GetAccountsMutator()->UpdateAccountInfo( +- device_account_id, device_account_is_child, signin::Tribool::kUnknown); +- CHECK_EQ(PrimaryAccountMutator::PrimaryAccountError::kNoError, error) +- << "SetPrimaryAccount error: " << static_cast(error); +- CHECK(identity_manager->HasPrimaryAccount(requested_level)); +- CHECK_EQ(identity_manager->GetPrimaryAccountInfo(requested_level).gaia, +- device_account.key.id()); +-} +-#endif +- +-} // namespace +- + IdentityManager::InitParameters::InitParameters() = default; + + IdentityManager::InitParameters::InitParameters(InitParameters&&) = default; + + IdentityManager::InitParameters::~InitParameters() = default; + +-IdentityManager::IdentityManager(IdentityManager::InitParameters&& parameters) +- : account_tracker_service_(std::move(parameters.account_tracker_service)), +- token_service_(std::move(parameters.token_service)), +- gaia_cookie_manager_service_( +- std::move(parameters.gaia_cookie_manager_service)), +- primary_account_manager_(std::move(parameters.primary_account_manager)), +- account_fetcher_service_(std::move(parameters.account_fetcher_service)), +-#if BUILDFLAG(IS_CHROMEOS_LACROS) +- signin_client_(parameters.signin_client), +-#endif +-#if BUILDFLAG(IS_CHROMEOS) +- account_manager_facade_(parameters.account_manager_facade), +-#endif +- identity_mutator_(std::move(parameters.primary_account_mutator), +- std::move(parameters.accounts_mutator), +- std::move(parameters.accounts_cookie_mutator), +- std::move(parameters.device_accounts_synchronizer)), +- diagnostics_provider_(std::move(parameters.diagnostics_provider)), +- account_consistency_(parameters.account_consistency) { +- DCHECK(account_fetcher_service_); +- DCHECK(diagnostics_provider_); +- +- primary_account_manager_observation_.Observe(primary_account_manager_.get()); +- token_service_observation_.Observe(token_service_.get()); +- token_service_->AddAccessTokenDiagnosticsObserver(this); +- +- // IdentityManager owns the ATS, GCMS and PO2TS instances and will outlive +- // them, so base::Unretained is safe. +- account_tracker_service_->SetOnAccountUpdatedCallback(base::BindRepeating( +- &IdentityManager::OnAccountUpdated, base::Unretained(this))); +- account_tracker_service_->SetOnAccountRemovedCallback(base::BindRepeating( +- &IdentityManager::OnAccountRemoved, base::Unretained(this))); +- gaia_cookie_manager_service_->SetGaiaAccountsInCookieUpdatedCallback( +- base::BindRepeating(&IdentityManager::OnGaiaAccountsInCookieUpdated, +- base::Unretained(this))); +- gaia_cookie_manager_service_->SetGaiaCookieDeletedByUserActionCallback( +- base::BindRepeating(&IdentityManager::OnGaiaCookieDeletedByUserAction, +- base::Unretained(this))); +- token_service_->SetRefreshTokenAvailableFromSourceCallback( +- base::BindRepeating(&IdentityManager::OnRefreshTokenAvailableFromSource, +- base::Unretained(this))); +- token_service_->SetRefreshTokenRevokedFromSourceCallback( +- base::BindRepeating(&IdentityManager::OnRefreshTokenRevokedFromSource, +- base::Unretained(this))); +- +-#if BUILDFLAG(IS_ANDROID) +- java_identity_manager_ = Java_IdentityManager_create( +- base::android::AttachCurrentThread(), reinterpret_cast(this), +- token_service_->GetDelegate()->GetJavaObject()); +-#endif +- +-#if BUILDFLAG(IS_CHROMEOS_LACROS) +- // We need to set the Primary Account in Lacros. In Ash, this happens in +- // `UserSessionManager::InitProfilePreferences`, before anyone starts using +- // Profile / KeyedServices - but with the availability of IdentityManager. We +- // don't have such a place in Lacros - which guarantees that the Primary +- // Account will be available on startup - just like Ash. +- absl::optional initial_account = +- signin_client_->GetInitialPrimaryAccount(); +- if (initial_account.has_value()) { +- const absl::optional& initial_account_is_child = +- signin_client_->IsInitialPrimaryAccountChild(); +- CHECK(initial_account_is_child.has_value()); +- SetPrimaryAccount(this, account_tracker_service_.get(), signin_client_, +- initial_account.value(), +- initial_account_is_child.value() +- ? signin::Tribool::kTrue +- : signin::Tribool::kFalse, +- ConsentLevel::kSignin); +- } +-#endif ++IdentityManager::IdentityManager(IdentityManager::InitParameters&& parameters) { + } + + IdentityManager::~IdentityManager() { +-#if BUILDFLAG(IS_ANDROID) +- if (java_identity_manager_) +- Java_IdentityManager_destroy(base::android::AttachCurrentThread(), +- java_identity_manager_); +-#endif + } + + void IdentityManager::Shutdown() { +- for (auto& observer : observer_list_) +- observer.OnIdentityManagerShutdown(this); +- +- // It is no longer safe to use the SigninClient beyond this point, everything +- // depending on it must be destroyed. +- token_service_->RemoveAccessTokenDiagnosticsObserver(this); +- token_service_observation_.Reset(); +- primary_account_manager_observation_.Reset(); +- +- account_fetcher_service_.reset(); +- gaia_cookie_manager_service_.reset(); +- primary_account_manager_.reset(); +- token_service_.reset(); +- account_tracker_service_.reset(); + } + + void IdentityManager::AddObserver(Observer* observer) { +- observer_list_.AddObserver(observer); + } + + void IdentityManager::RemoveObserver(Observer* observer) { +- observer_list_.RemoveObserver(observer); + } + + // TODO(862619) change return type to absl::optional + CoreAccountInfo IdentityManager::GetPrimaryAccountInfo( + ConsentLevel consent) const { +- return primary_account_manager_->GetPrimaryAccountInfo(consent); ++ return CoreAccountInfo(); + } + + CoreAccountId IdentityManager::GetPrimaryAccountId(ConsentLevel consent) const { +@@ -226,7 +77,7 @@ CoreAccountId IdentityManager::GetPrimaryAccountId(ConsentLevel consent) const { + } + + bool IdentityManager::HasPrimaryAccount(ConsentLevel consent) const { +- return primary_account_manager_->HasPrimaryAccount(consent); ++ return false; + } + + std::unique_ptr +@@ -236,9 +87,7 @@ IdentityManager::CreateAccessTokenFetcherForAccount( + const ScopeSet& scopes, + AccessTokenFetcher::TokenCallback callback, + AccessTokenFetcher::Mode mode) { +- return std::make_unique( +- account_id, oauth_consumer_name, token_service_.get(), +- primary_account_manager_.get(), scopes, std::move(callback), mode); ++ return nullptr; + } + + std::unique_ptr +@@ -249,10 +98,7 @@ IdentityManager::CreateAccessTokenFetcherForAccount( + const ScopeSet& scopes, + AccessTokenFetcher::TokenCallback callback, + AccessTokenFetcher::Mode mode) { +- return std::make_unique( +- account_id, oauth_consumer_name, token_service_.get(), +- primary_account_manager_.get(), url_loader_factory, scopes, +- std::move(callback), mode); ++ return nullptr; + } + + std::unique_ptr +@@ -264,108 +110,68 @@ IdentityManager::CreateAccessTokenFetcherForClient( + const ScopeSet& scopes, + AccessTokenFetcher::TokenCallback callback, + AccessTokenFetcher::Mode mode) { +- return std::make_unique( +- account_id, client_id, client_secret, oauth_consumer_name, +- token_service_.get(), primary_account_manager_.get(), scopes, +- std::move(callback), mode); ++ return nullptr; + } + + void IdentityManager::RemoveAccessTokenFromCache( + const CoreAccountId& account_id, + const ScopeSet& scopes, + const std::string& access_token) { +- token_service_->InvalidateAccessToken(account_id, scopes, access_token); + } + + std::vector IdentityManager::GetAccountsWithRefreshTokens() + const { +- std::vector account_ids_with_tokens = +- token_service_->GetAccounts(); +- + std::vector accounts; +- accounts.reserve(account_ids_with_tokens.size()); +- +- for (const CoreAccountId& account_id : account_ids_with_tokens) { +- accounts.push_back(GetAccountInfoForAccountWithRefreshToken(account_id)); +- } +- + return accounts; + } + + std::vector + IdentityManager::GetExtendedAccountInfoForAccountsWithRefreshToken() const { +- std::vector account_ids_with_tokens = +- token_service_->GetAccounts(); +- +- std::vector accounts; +- accounts.reserve(account_ids_with_tokens.size()); +- +- for (const CoreAccountId& account_id : account_ids_with_tokens) { +- accounts.push_back(GetAccountInfoForAccountWithRefreshToken(account_id)); +- } +- +- return accounts; ++ return std::vector(); + } + + bool IdentityManager::HasPrimaryAccountWithRefreshToken( + ConsentLevel consent_level) const { +- return HasAccountWithRefreshToken(GetPrimaryAccountId(consent_level)); ++ return false; + } + + bool IdentityManager::HasAccountWithRefreshToken( + const CoreAccountId& account_id) const { +- return token_service_->RefreshTokenIsAvailable(account_id); ++ return false; + } + + bool IdentityManager::AreRefreshTokensLoaded() const { +- return token_service_->AreAllCredentialsLoaded(); ++ return false; + } + + bool IdentityManager::HasAccountWithRefreshTokenInPersistentErrorState( + const CoreAccountId& account_id) const { +- return GetErrorStateOfRefreshTokenForAccount(account_id).IsPersistentError(); ++ return true; + } + + GoogleServiceAuthError IdentityManager::GetErrorStateOfRefreshTokenForAccount( + const CoreAccountId& account_id) const { +- return token_service_->GetAuthError(account_id); ++ return GoogleServiceAuthError(GoogleServiceAuthError::USER_NOT_SIGNED_UP); + } + + AccountInfo IdentityManager::FindExtendedAccountInfo( + const CoreAccountInfo& account_info) const { +- return FindExtendedAccountInfoByAccountId(account_info.account_id); ++ return AccountInfo(); + } + + AccountInfo IdentityManager::FindExtendedAccountInfoByAccountId( + const CoreAccountId& account_id) const { +- if (!HasAccountWithRefreshToken(account_id)) +- return AccountInfo(); +- +- // AccountTrackerService returns an empty AccountInfo if the account is not +- // found. +- return account_tracker_service_->GetAccountInfo(account_id); ++ return AccountInfo(); + } + + AccountInfo IdentityManager::FindExtendedAccountInfoByEmailAddress( + const std::string& email_address) const { +- AccountInfo account_info = +- account_tracker_service_->FindAccountInfoByEmail(email_address); +- // AccountTrackerService always returns an AccountInfo, even on failure. In +- // case of failure, the AccountInfo will be unpopulated, thus we should not +- // be able to find a valid refresh token. +- return HasAccountWithRefreshToken(account_info.account_id) ? account_info +- : AccountInfo(); ++ return AccountInfo(); + } + + AccountInfo IdentityManager::FindExtendedAccountInfoByGaiaId( + const std::string& gaia_id) const { +- AccountInfo account_info = +- account_tracker_service_->FindAccountInfoByGaiaId(gaia_id); +- // AccountTrackerService always returns an AccountInfo, even on failure. In +- // case of failure, the AccountInfo will be unpopulated, thus we should not +- // be able to find a valid refresh token. +- return HasAccountWithRefreshToken(account_info.account_id) ? account_info +- : AccountInfo(); ++ return AccountInfo(); + } + + std::unique_ptr +@@ -374,62 +180,47 @@ IdentityManager::CreateUbertokenFetcherForAccount( + UbertokenFetcher::CompletionCallback callback, + gaia::GaiaSource source, + scoped_refptr url_loader_factory) { +- return std::make_unique( +- account_id, token_service_.get(), std::move(callback), source, +- url_loader_factory); ++ return nullptr; + } + + AccountsInCookieJarInfo IdentityManager::GetAccountsInCookieJar() const { + std::vector signed_in_accounts; + std::vector signed_out_accounts; +- bool accounts_are_fresh = gaia_cookie_manager_service_->ListAccounts( +- &signed_in_accounts, &signed_out_accounts); ++ bool accounts_are_fresh = false; + + return AccountsInCookieJarInfo(accounts_are_fresh, signed_in_accounts, + signed_out_accounts); + } + + PrimaryAccountMutator* IdentityManager::GetPrimaryAccountMutator() { +- return identity_mutator_.GetPrimaryAccountMutator(); ++ return nullptr; + } + + AccountsMutator* IdentityManager::GetAccountsMutator() { +- return identity_mutator_.GetAccountsMutator(); ++ return nullptr; + } + + AccountsCookieMutator* IdentityManager::GetAccountsCookieMutator() { +- return identity_mutator_.GetAccountsCookieMutator(); ++ return nullptr; + } + + DeviceAccountsSynchronizer* IdentityManager::GetDeviceAccountsSynchronizer() { +- return identity_mutator_.GetDeviceAccountsSynchronizer(); ++ return nullptr; + } + + void IdentityManager::AddDiagnosticsObserver(DiagnosticsObserver* observer) { +- diagnostics_observation_list_.AddObserver(observer); + } + + void IdentityManager::RemoveDiagnosticsObserver(DiagnosticsObserver* observer) { +- diagnostics_observation_list_.RemoveObserver(observer); + } + + void IdentityManager::OnNetworkInitialized() { +- gaia_cookie_manager_service_->InitCookieListener(); +- account_fetcher_service_->OnNetworkInitialized(); +-} +- +-#if BUILDFLAG(IS_CHROMEOS_ASH) +-IdentityManager::AccountIdMigrationState +-IdentityManager::GetAccountIdMigrationState() const { +- return static_cast( +- account_tracker_service_->GetMigrationState()); + } +-#endif + + CoreAccountId IdentityManager::PickAccountIdForAccount( + const std::string& gaia, + const std::string& email) const { +- return account_tracker_service_->PickAccountIdForAccount(gaia, email); ++ return CoreAccountId(); + } + + // static +@@ -447,235 +238,72 @@ void IdentityManager::RegisterProfilePrefs(PrefRegistrySimple* registry) { + } + + DiagnosticsProvider* IdentityManager::GetDiagnosticsProvider() { +- return diagnostics_provider_.get(); ++ return nullptr; + } + +-#if BUILDFLAG(IS_ANDROID) +-base::android::ScopedJavaLocalRef +-IdentityManager::LegacyGetAccountTrackerServiceJavaObject() { +- return account_tracker_service_->GetJavaObject(); +-} +- +-base::android::ScopedJavaLocalRef IdentityManager::GetJavaObject() { +- DCHECK(java_identity_manager_); +- return base::android::ScopedJavaLocalRef(java_identity_manager_); +-} +- +-base::android::ScopedJavaLocalRef +-IdentityManager::GetIdentityMutatorJavaObject() { +- return base::android::ScopedJavaLocalRef( +- identity_mutator_.GetJavaObject()); +-} +- +-void IdentityManager::RefreshAccountInfoIfStale( +- const CoreAccountId& account_id) { +- DCHECK(HasAccountWithRefreshToken(account_id)); +- AccountInfo account_info = +- account_tracker_service_->GetAccountInfo(account_id); +- if (account_info.account_image.IsEmpty()) { +- account_info_fetch_start_times_[account_id] = base::TimeTicks::Now(); +- } +- account_fetcher_service_->RefreshAccountInfoIfStale(account_id); +-} +- +-void IdentityManager::RefreshAccountInfoIfStale( +- JNIEnv* env, +- const base::android::JavaParamRef& j_core_account_id) { +- RefreshAccountInfoIfStale( +- ConvertFromJavaCoreAccountId(env, j_core_account_id)); +-} +- +-base::android::ScopedJavaLocalRef +-IdentityManager::GetPrimaryAccountInfo(JNIEnv* env, jint consent_level) const { +- CoreAccountInfo account_info = +- GetPrimaryAccountInfo(static_cast(consent_level)); +- if (account_info.IsEmpty()) +- return nullptr; +- return ConvertToJavaCoreAccountInfo(env, account_info); +-} +- +-base::android::ScopedJavaLocalRef +-IdentityManager::FindExtendedAccountInfoByEmailAddress( +- JNIEnv* env, +- const base::android::JavaParamRef& j_email) const { +- AccountInfo account_info = FindExtendedAccountInfoByEmailAddress( +- base::android::ConvertJavaStringToUTF8(env, j_email)); +- if (account_info.IsEmpty()) +- return nullptr; +- return ConvertToJavaAccountInfo(env, account_info); +-} +- +-base::android::ScopedJavaLocalRef +-IdentityManager::GetAccountsWithRefreshTokens(JNIEnv* env) const { +- std::vector accounts = GetAccountsWithRefreshTokens(); +- +- base::android::ScopedJavaLocalRef coreaccountinfo_clazz = +- base::android::GetClass( +- env, "org/chromium/components/signin/base/CoreAccountInfo"); +- base::android::ScopedJavaLocalRef array( +- env, env->NewObjectArray(accounts.size(), coreaccountinfo_clazz.obj(), +- nullptr)); +- base::android::CheckException(env); +- +- for (size_t i = 0; i < accounts.size(); ++i) { +- base::android::ScopedJavaLocalRef item = +- ConvertToJavaCoreAccountInfo(env, accounts[i]); +- env->SetObjectArrayElement(array.obj(), i, item.obj()); +- } +- return array; +-} +-#endif +- + AccountInfo IdentityManager::FindExtendedPrimaryAccountInfo( + ConsentLevel consent_level) { +- CoreAccountId account_id = GetPrimaryAccountId(consent_level); +- return account_tracker_service_->GetAccountInfo(account_id); ++ return AccountInfo(); + } + + PrimaryAccountManager* IdentityManager::GetPrimaryAccountManager() const { +- return primary_account_manager_.get(); ++ return nullptr; + } + + ProfileOAuth2TokenService* IdentityManager::GetTokenService() const { +- return token_service_.get(); ++ return nullptr; + } + + AccountTrackerService* IdentityManager::GetAccountTrackerService() const { +- return account_tracker_service_.get(); ++ return nullptr; + } + + AccountFetcherService* IdentityManager::GetAccountFetcherService() const { +- return account_fetcher_service_.get(); ++ return nullptr; + } + + GaiaCookieManagerService* IdentityManager::GetGaiaCookieManagerService() const { +- return gaia_cookie_manager_service_.get(); +-} +- +-#if BUILDFLAG(IS_CHROMEOS) +-account_manager::AccountManagerFacade* +-IdentityManager::GetAccountManagerFacade() const { +- return account_manager_facade_; ++ return nullptr; + } +-#endif + + AccountInfo IdentityManager::GetAccountInfoForAccountWithRefreshToken( + const CoreAccountId& account_id) const { +- // TODO(https://crbug.com/919793): This invariant is not currently possible to +- // enforce on Android due to the underlying relationship between +- // O2TS::GetAccounts(), O2TS::RefreshTokenIsAvailable(), and +- // O2TS::Observer::OnRefreshTokenAvailable(). +-#if !BUILDFLAG(IS_ANDROID) +- DCHECK(HasAccountWithRefreshToken(account_id)); +-#endif +- +- AccountInfo account_info = +- account_tracker_service_->GetAccountInfo(account_id); +- DCHECK(!account_info.IsEmpty()); +- +- return account_info; ++ return AccountInfo(); + } + + void IdentityManager::OnPrimaryAccountChanged( + const PrimaryAccountChangeEvent& event_details) { +- CoreAccountId event_primary_account_id = +- event_details.GetCurrentState().primary_account.account_id; +- DCHECK_EQ(event_primary_account_id, +- GetPrimaryAccountId(event_details.GetCurrentState().consent_level)); +- for (auto& observer : observer_list_) { +- observer.OnPrimaryAccountChanged(event_details); +- // Ensure that |observer| did not change the primary account as otherwise +- // |event_details| would not longer be correct. +- DCHECK_EQ( +- event_primary_account_id, +- GetPrimaryAccountId(event_details.GetCurrentState().consent_level)); +- } +- +-#if BUILDFLAG(IS_ANDROID) +- if (java_identity_manager_) { +- JNIEnv* env = base::android::AttachCurrentThread(); +- Java_IdentityManager_onPrimaryAccountChanged( +- env, java_identity_manager_, +- ConvertToJavaPrimaryAccountChangeEvent(env, event_details)); +- } +-#endif + } + + void IdentityManager::OnRefreshTokenAvailable(const CoreAccountId& account_id) { +- CoreAccountInfo account_info = +- GetAccountInfoForAccountWithRefreshToken(account_id); +- +- for (auto& observer : observer_list_) { +- observer.OnRefreshTokenUpdatedForAccount(account_info); +- } +-#if BUILDFLAG(IS_ANDROID) +- if (java_identity_manager_) { +- JNIEnv* env = base::android::AttachCurrentThread(); +- Java_IdentityManager_onRefreshTokenUpdatedForAccount( +- env, java_identity_manager_, +- ConvertToJavaCoreAccountInfo(env, account_info)); +- } +-#endif + } + + void IdentityManager::OnRefreshTokenRevoked(const CoreAccountId& account_id) { +- for (auto& observer : observer_list_) { +- observer.OnRefreshTokenRemovedForAccount(account_id); +- } + } + + void IdentityManager::OnRefreshTokensLoaded() { +- for (auto& observer : observer_list_) +- observer.OnRefreshTokensLoaded(); + } + + void IdentityManager::OnEndBatchChanges() { +- for (auto& observer : observer_list_) +- observer.OnEndBatchOfRefreshTokenStateChanges(); + } + + void IdentityManager::OnAuthErrorChanged( + const CoreAccountId& account_id, + const GoogleServiceAuthError& auth_error) { +- CoreAccountInfo account_info = +- GetAccountInfoForAccountWithRefreshToken(account_id); +- +- for (auto& observer : observer_list_) +- observer.OnErrorStateOfRefreshTokenUpdatedForAccount(account_info, +- auth_error); + } + + void IdentityManager::OnGaiaAccountsInCookieUpdated( + const std::vector& signed_in_accounts, + const std::vector& signed_out_accounts, + const GoogleServiceAuthError& error) { +- AccountsInCookieJarInfo accounts_in_cookie_jar_info( +- error == GoogleServiceAuthError::AuthErrorNone(), signed_in_accounts, +- signed_out_accounts); +- +- for (auto& observer : observer_list_) { +- observer.OnAccountsInCookieUpdated(accounts_in_cookie_jar_info, error); +- } + } + + void IdentityManager::OnGaiaCookieDeletedByUserAction() { +- for (auto& observer : observer_list_) { +- observer.OnAccountsCookieDeletedByUserAction(); +- } +-#if BUILDFLAG(IS_ANDROID) +- if (java_identity_manager_) { +- Java_IdentityManager_onAccountsCookieDeletedByUserAction( +- base::android::AttachCurrentThread(), java_identity_manager_); +- } +-#endif + } + + void IdentityManager::OnAccessTokenRequested(const CoreAccountId& account_id, + const std::string& consumer_id, + const ScopeSet& scopes) { +- for (auto& observer : diagnostics_observation_list_) { +- observer.OnAccessTokenRequested(account_id, consumer_id, scopes); +- } + } + + void IdentityManager::OnFetchAccessTokenComplete( +@@ -684,65 +312,27 @@ void IdentityManager::OnFetchAccessTokenComplete( + const ScopeSet& scopes, + GoogleServiceAuthError error, + base::Time expiration_time) { +- for (auto& observer : diagnostics_observation_list_) +- observer.OnAccessTokenRequestCompleted(account_id, consumer_id, scopes, +- error, expiration_time); + } + + void IdentityManager::OnAccessTokenRemoved(const CoreAccountId& account_id, + const ScopeSet& scopes) { +- for (auto& observer : diagnostics_observation_list_) +- observer.OnAccessTokenRemovedFromCache(account_id, scopes); + } + + void IdentityManager::OnRefreshTokenAvailableFromSource( + const CoreAccountId& account_id, + bool is_refresh_token_valid, + const std::string& source) { +- for (auto& observer : diagnostics_observation_list_) +- observer.OnRefreshTokenUpdatedForAccountFromSource( +- account_id, is_refresh_token_valid, source); + } + + void IdentityManager::OnRefreshTokenRevokedFromSource( + const CoreAccountId& account_id, + const std::string& source) { +- for (auto& observer : diagnostics_observation_list_) +- observer.OnRefreshTokenRemovedForAccountFromSource(account_id, source); + } + + void IdentityManager::OnAccountUpdated(const AccountInfo& info) { +- if (HasPrimaryAccount(signin::ConsentLevel::kSignin)) { +- const CoreAccountId primary_account_id = +- GetPrimaryAccountId(ConsentLevel::kSignin); +- if (primary_account_id == info.account_id) { +- primary_account_manager_->UpdatePrimaryAccountInfo(); +- } +- } +- +- for (auto& observer : observer_list_) { +- observer.OnExtendedAccountInfoUpdated(info); +- } +-#if BUILDFLAG(IS_ANDROID) +- if (java_identity_manager_) { +- if (account_info_fetch_start_times_.count(info.account_id) && +- !info.account_image.IsEmpty()) { +- base::UmaHistogramTimes( +- "Signin.AndroidAccountInfoFetchTime", +- base::TimeTicks::Now() - +- account_info_fetch_start_times_[info.account_id]); +- account_info_fetch_start_times_.erase(info.account_id); +- } +- JNIEnv* env = base::android::AttachCurrentThread(); +- Java_IdentityManager_onExtendedAccountInfoUpdated( +- env, java_identity_manager_, ConvertToJavaAccountInfo(env, info)); +- } +-#endif + } + + void IdentityManager::OnAccountRemoved(const AccountInfo& info) { +- for (auto& observer : observer_list_) +- observer.OnExtendedAccountInfoRemoved(info); + } + + } // namespace signin +diff --git a/components/signin/public/identity_manager/identity_manager.h b/components/signin/public/identity_manager/identity_manager.h +--- a/components/signin/public/identity_manager/identity_manager.h ++++ b/components/signin/public/identity_manager/identity_manager.h +@@ -436,7 +436,7 @@ class IdentityManager : public KeyedService, + + // Returns account consistency method for this profile. + AccountConsistencyMethod GetAccountConsistency() { +- return account_consistency_; ++ return AccountConsistencyMethod::kDisabled; + } + + #if BUILDFLAG(IS_ANDROID) +@@ -680,51 +680,6 @@ class IdentityManager : public KeyedService, + // AccountTrackerService callbacks: + void OnAccountUpdated(const AccountInfo& info); + void OnAccountRemoved(const AccountInfo& info); +- +- // Backing signin classes. +- std::unique_ptr account_tracker_service_; +- std::unique_ptr token_service_; +- std::unique_ptr gaia_cookie_manager_service_; +- std::unique_ptr primary_account_manager_; +- std::unique_ptr account_fetcher_service_; +-#if BUILDFLAG(IS_CHROMEOS_LACROS) +- const raw_ptr signin_client_; +-#endif +-#if BUILDFLAG(IS_CHROMEOS) +- const raw_ptr account_manager_facade_; +-#endif +- +- IdentityMutator identity_mutator_; +- +- // DiagnosticsProvider instance. +- std::unique_ptr diagnostics_provider_; +- +- // Scoped observers. +- base::ScopedObservation +- primary_account_manager_observation_{this}; +- base::ScopedObservation +- token_service_observation_{this}; +- +- // Lists of observers. +- // Makes sure lists are empty on destruction. +- base::ObserverList::Unchecked observer_list_; +- base::ObserverList::Unchecked +- diagnostics_observation_list_; +- +- AccountConsistencyMethod account_consistency_ = +- AccountConsistencyMethod::kDisabled; +- +-#if BUILDFLAG(IS_ANDROID) +- // Java-side IdentityManager object. +- base::android::ScopedJavaGlobalRef java_identity_manager_; +- +- // CoreAccountId and the corresponding fetch start time, this is only +- // used to record account information fetch duration. +- base::flat_map +- account_info_fetch_start_times_; +-#endif + }; + + } // namespace signin +diff --git a/components/signin/public/identity_manager/identity_manager_builder.cc b/components/signin/public/identity_manager/identity_manager_builder.cc +--- a/components/signin/public/identity_manager/identity_manager_builder.cc ++++ b/components/signin/public/identity_manager/identity_manager_builder.cc +@@ -105,6 +105,9 @@ IdentityManagerBuildParams::~IdentityManagerBuildParams() = default; + + IdentityManager::InitParameters BuildIdentityManagerInitParameters( + IdentityManagerBuildParams* params) { ++ IdentityManager::InitParameters empty_init_params; ++ if ((true)) return empty_init_params; ++ + std::unique_ptr account_tracker_service = + BuildAccountTrackerService(params->pref_service, params->profile_path); + +-- +2.25.1 diff --git a/build/patches/00Restore-Search-Ready-Omnibox-flag--win-fixup-.patch b/build/patches/00Restore-Search-Ready-Omnibox-flag--win-fixup-.patch new file mode 100644 index 00000000..b48e5048 --- /dev/null +++ b/build/patches/00Restore-Search-Ready-Omnibox-flag--win-fixup-.patch @@ -0,0 +1,25 @@ +From: Your Name +Date: Wed, 12 Oct 2022 12:01:37 +0000 +Subject: Restore Search Ready Omnibox flag (win fixup) + +--- + chrome/browser/about_flags.cc | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc +--- a/chrome/browser/about_flags.cc ++++ b/chrome/browser/about_flags.cc +@@ -8780,9 +8780,11 @@ const FeatureEntry kFeatureEntries[] = { + flag_descriptions::kPervasiveSystemAccentColorDescription, kOsWin, + SINGLE_VALUE_TYPE(switches::kPervasiveSystemAccentColor)}, + #endif ++#if BUILDFLAG(IS_ANDROID) + {"enable-search-ready-omnibox", flag_descriptions::kSearchReadyOmniboxName, + flag_descriptions::kSearchReadyOmniboxDescription, kOsAndroid, + FEATURE_VALUE_TYPE(chrome::android::kSearchReadyOmniboxFeature)}, ++#endif + + {"site-engagement", + flag_descriptions::kSiteEngagementName, +-- +2.25.1 diff --git a/build/patches/00Revert-flags--remove-num-raster-thre--win-fixup-.patch b/build/patches/00Revert-flags--remove-num-raster-thre--win-fixup-.patch new file mode 100644 index 00000000..6a2a9f55 --- /dev/null +++ b/build/patches/00Revert-flags--remove-num-raster-thre--win-fixup-.patch @@ -0,0 +1,29 @@ +From: Your Name +Date: Wed, 12 Oct 2022 11:59:30 +0000 +Subject: Revert flags: remove num-raster-thre (win fixup) + +--- + chrome/browser/about_flags.cc | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc +--- a/chrome/browser/about_flags.cc ++++ b/chrome/browser/about_flags.cc +@@ -355,6 +355,7 @@ const FeatureEntry::Choice kOverlayStrategiesChoices[] = { + "single-fullscreen,single-on-top,underlay"}, + }; + ++#if BUILDFLAG(IS_ANDROID) + const FeatureEntry::Choice kNumRasterThreadsChoices[] = { + {flags_ui::kGenericExperimentChoiceDefault, "", ""}, + {flag_descriptions::kNumRasterThreadsOne, blink::switches::kNumRasterThreads, "1"}, +@@ -363,6 +364,7 @@ const FeatureEntry::Choice kNumRasterThreadsChoices[] = { + "3"}, + {flag_descriptions::kNumRasterThreadsFour, blink::switches::kNumRasterThreads, + "4"}}; ++#endif + + const FeatureEntry::Choice kTouchTextSelectionStrategyChoices[] = { + {flags_ui::kGenericExperimentChoiceDefault, "", ""}, +-- +2.25.1 diff --git a/build/patches/00Revert-the-removal-to-block-autoplay--win-fixup-.patch b/build/patches/00Revert-the-removal-to-block-autoplay--win-fixup-.patch new file mode 100644 index 00000000..63a2681c --- /dev/null +++ b/build/patches/00Revert-the-removal-to-block-autoplay--win-fixup-.patch @@ -0,0 +1,256 @@ +From: Your Name +Date: Wed, 12 Oct 2022 12:49:31 +0000 +Subject: Revert the removal to block autoplay (win fixup) + +--- + chrome/app/settings_strings.grdp | 19 ++++++++++++++++ + chrome/browser/resources/settings/icons.html | 2 ++ + .../settings/privacy_page/privacy_page.html | 22 +++++++++++++++++++ + chrome/browser/resources/settings/route.ts | 1 + + .../resources/settings/settings_routes.ts | 1 + + .../site_settings/category_default_setting.ts | 1 + + .../settings/site_settings/constants.ts | 1 + + .../settings_category_default_radio_group.ts | 1 + + .../settings/site_settings/site_details.html | 5 +++++ + .../recent_site_permissions.ts | 2 ++ + .../site_settings_page/site_settings_page.ts | 9 ++++++++ + .../views/page_info/page_info_view_factory.cc | 3 +++ + .../settings_localized_strings_provider.cc | 7 ++++++ + .../ui/webui/settings/site_settings_helper.cc | 4 +++- + 14 files changed, 77 insertions(+), 1 deletion(-) + +diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp +--- a/chrome/app/settings_strings.grdp ++++ b/chrome/app/settings_strings.grdp +@@ -3658,6 +3658,25 @@ + Control how your browsing history is used to personalize Search and more + + ++ ++ Autoplay ++ ++ ++ Allow automatic start of video contents ++ ++ ++ Autoplay is enabled ++ ++ ++ Autoplay is disabled ++ ++ ++ Allowed to autoplay ++ ++ ++ Not allowed to autoplay ++ ++ + + + +diff --git a/chrome/browser/resources/settings/icons.html b/chrome/browser/resources/settings/icons.html +--- a/chrome/browser/resources/settings/icons.html ++++ b/chrome/browser/resources/settings/icons.html +@@ -168,6 +168,8 @@ NOTE: Chrome OS icons go in ./chromeos/os_icons.html. + + + ++ ++ + + + +diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chrome/browser/resources/settings/privacy_page/privacy_page.html +--- a/chrome/browser/resources/settings/privacy_page/privacy_page.html ++++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html +@@ -1004,4 +1004,26 @@ + + + ++ + +diff --git a/chrome/browser/resources/settings/route.ts b/chrome/browser/resources/settings/route.ts +--- a/chrome/browser/resources/settings/route.ts ++++ b/chrome/browser/resources/settings/route.ts +@@ -102,6 +102,7 @@ function addPrivacyChildRoutes(r: Partial) { + r.SITE_SETTINGS.createChild('windowPlacement'); + r.SITE_SETTINGS_FILE_SYSTEM_WRITE = r.SITE_SETTINGS.createChild('filesystem'); + r.SITE_SETTINGS_LOCAL_FONTS = r.SITE_SETTINGS.createChild('localFonts'); ++ r.SITE_SETTINGS_AUTOPLAY = r.SITE_SETTINGS.createChild('autoplay'); + } + + /** +diff --git a/chrome/browser/resources/settings/settings_routes.ts b/chrome/browser/resources/settings/settings_routes.ts +--- a/chrome/browser/resources/settings/settings_routes.ts ++++ b/chrome/browser/resources/settings/settings_routes.ts +@@ -95,4 +95,5 @@ export interface SettingsRoutes { + SYNC_ADVANCED: Route; + SYSTEM: Route; + TRIGGERED_RESET_DIALOG: Route; ++ SITE_SETTINGS_AUTOPLAY: Route; + } +diff --git a/chrome/browser/resources/settings/site_settings/category_default_setting.ts b/chrome/browser/resources/settings/site_settings/category_default_setting.ts +--- a/chrome/browser/resources/settings/site_settings/category_default_setting.ts ++++ b/chrome/browser/resources/settings/site_settings/category_default_setting.ts +@@ -195,6 +195,7 @@ export class CategoryDefaultSettingElement extends + case ContentSettingsTypes.PROTOCOL_HANDLERS: + case ContentSettingsTypes.SENSORS: + case ContentSettingsTypes.SOUND: ++ case ContentSettingsTypes.AUTOPLAY: + // "Allowed" vs "Blocked". + this.browserProxy.setDefaultValueForContentType( + this.category, +diff --git a/chrome/browser/resources/settings/site_settings/constants.ts b/chrome/browser/resources/settings/site_settings/constants.ts +--- a/chrome/browser/resources/settings/site_settings/constants.ts ++++ b/chrome/browser/resources/settings/site_settings/constants.ts +@@ -42,6 +42,7 @@ export enum ContentSettingsTypes { + VR = 'vr', + WINDOW_PLACEMENT = 'window-placement', + ZOOM_LEVELS = 'zoom-levels', ++ AUTOPLAY = 'autoplay', + + // The following item is not in the C++ kContentSettingsTypeGroupNames, but it + // is used everywhere where ContentSettingsTypes is used in JS. +diff --git a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts +--- a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts ++++ b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts +@@ -139,6 +139,7 @@ export class SettingsCategoryDefaultRadioGroupElement extends + case ContentSettingsTypes.PROTOCOL_HANDLERS: + case ContentSettingsTypes.SENSORS: + case ContentSettingsTypes.SOUND: ++ case ContentSettingsTypes.AUTOPLAY: + // "Allowed" vs "Blocked". + return ContentSetting.ALLOW; + case ContentSettingsTypes.AR: +diff --git a/chrome/browser/resources/settings/site_settings/site_details.html b/chrome/browser/resources/settings/site_settings/site_details.html +--- a/chrome/browser/resources/settings/site_settings/site_details.html ++++ b/chrome/browser/resources/settings/site_settings/site_details.html +@@ -223,4 +223,9 @@ + category="[[contentSettingsTypesEnum_.LOCAL_FONTS]]" + icon="settings:local-fonts" label="$i18n{fonts}"> + ++ ++ + +diff --git a/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts b/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts +--- a/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts ++++ b/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts +@@ -196,6 +196,8 @@ export class SettingsRecentSitePermissionsElement extends + return this.i18n('siteSettingsFontAccessMidSentence'); + case ContentSettingsTypes.IDLE_DETECTION: + return this.i18n('siteSettingsIdleDetectionMidSentence'); ++ case ContentSettingsTypes.AUTOPLAY: ++ return this.i18n('siteSettingsAutoplayMidSentence'); + default: + return ''; + } +diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts +--- a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts ++++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts +@@ -313,6 +313,14 @@ function getCategoryItemMap(): Map { + label: 'siteSettingsZoomLevels', + icon: 'settings:zoom-in', + }, ++ { ++ route: routes.SITE_SETTINGS_AUTOPLAY, ++ id: Id.AUTOPLAY, ++ label: 'siteSettingsAutoplay', ++ icon: 'settings:autoplay', ++ enabledLabel: 'siteSettingsAutoplayAllowed', ++ disabledLabel: 'siteSettingsAutoplayBlocked', ++ }, + ]; + + categoryItemMap = new Map(categoryList.map(item => [item.id, item])); +@@ -395,6 +403,7 @@ export class SettingsSiteSettingsPageElement extends PolymerElement { + Id.PROTECTED_CONTENT, + Id.MIXEDSCRIPT, + Id.FEDERATED_IDENTITY_API, ++ Id.AUTOPLAY, + ]), + }; + }, +diff --git a/chrome/browser/ui/views/page_info/page_info_view_factory.cc b/chrome/browser/ui/views/page_info/page_info_view_factory.cc +--- a/chrome/browser/ui/views/page_info/page_info_view_factory.cc ++++ b/chrome/browser/ui/views/page_info/page_info_view_factory.cc +@@ -329,6 +329,9 @@ const ui::ImageModel PageInfoViewFactory::GetPermissionIcon( + case ContentSettingsType::IDLE_DETECTION: + icon = &vector_icons::kDevicesIcon; + break; ++ case ContentSettingsType::AUTOPLAY: ++ icon = &vector_icons::kProtectedContentIcon; ++ break; + default: + // All other |ContentSettingsType|s do not have icons on desktop or are + // not shown in the Page Info bubble. +diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc ++++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +@@ -2083,6 +2083,13 @@ void AddSearchEnginesStrings(content::WebUIDataSource* html_source) { + void AddSiteSettingsStrings(content::WebUIDataSource* html_source, + Profile* profile) { + static constexpr webui::LocalizedString kLocalizedStrings[] = { ++ {"siteSettingsAutoplay", IDS_SITE_SETTINGS_AUTOPLAY_TITLE}, ++ {"siteSettingsAutoplayDescription", IDS_SETTINGS_SITE_SETTINGS_AUTOPLAY_DESCRIPTION}, ++ {"siteSettingsAutoplayAllowed", IDS_SETTINGS_SITE_SETTINGS_AUTOPLAY_ALLOWED}, ++ {"siteSettingsAutoplayBlocked", IDS_SETTINGS_SITE_SETTINGS_AUTOPLAY_BLOCKED}, ++ {"siteSettingsAutoplayAllowedExceptions",IDS_SETTINGS_SITE_SETTINGS_AUTOPLAY_ALLOWED_EXCEPTIONS}, ++ {"siteSettingsAutoplayBlockedExceptions", IDS_SETTINGS_SITE_SETTINGS_AUTOPLAY_BLOCKED_EXCEPTIONS}, ++ {"siteSettingsAutoplayMidSentence", IDS_SITE_SETTINGS_TYPE_AUTOPLAY}, + {"addSite", IDS_SETTINGS_ADD_SITE}, + {"addSiteTitle", IDS_SETTINGS_ADD_SITE_TITLE}, + #if BUILDFLAG(IS_CHROMEOS_ASH) +diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/browser/ui/webui/settings/site_settings_helper.cc +--- a/chrome/browser/ui/webui/settings/site_settings_helper.cc ++++ b/chrome/browser/ui/webui/settings/site_settings_helper.cc +@@ -115,6 +115,7 @@ const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = { + {ContentSettingsType::FILE_SYSTEM_ACCESS_CHOOSER_DATA, + "file-system-access-handles-data"}, + {ContentSettingsType::FEDERATED_IDENTITY_API, "federated-identity-api"}, ++ {ContentSettingsType::AUTOPLAY, "autoplay"}, + + // Add new content settings here if a corresponding Javascript string + // representation for it is not required, for example if the content setting +@@ -126,7 +127,6 @@ const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = { + {ContentSettingsType::APP_BANNER, nullptr}, + {ContentSettingsType::SITE_ENGAGEMENT, nullptr}, + {ContentSettingsType::DURABLE_STORAGE, nullptr}, +- {ContentSettingsType::AUTOPLAY, nullptr}, + {ContentSettingsType::IMPORTANT_SITE_INFO, nullptr}, + {ContentSettingsType::PERMISSION_AUTOBLOCKER_DATA, nullptr}, + {ContentSettingsType::ADS_DATA, nullptr}, +@@ -446,6 +446,8 @@ const std::vector& GetVisiblePermissionCategories() { + base_types->push_back(ContentSettingsType::ADS); + } + ++ base_types->push_back(ContentSettingsType::AUTOPLAY); ++ + initialized = true; + } + +-- +2.25.1 diff --git a/build/patches/00Timezone-customization--win-fixup-.patch b/build/patches/00Timezone-customization--win-fixup-.patch new file mode 100644 index 00000000..18b9beea --- /dev/null +++ b/build/patches/00Timezone-customization--win-fixup-.patch @@ -0,0 +1,252 @@ +From: Your Name +Date: Wed, 12 Oct 2022 16:03:16 +0000 +Subject: Timezone customization (win fixup) + +--- + chrome/app/settings_strings.grdp | 19 ++++++++++++++++ + chrome/browser/resources/settings/icons.html | 2 ++ + .../settings/privacy_page/privacy_page.html | 22 +++++++++++++++++++ + chrome/browser/resources/settings/route.ts | 1 + + .../resources/settings/settings_routes.ts | 1 + + .../site_settings/category_default_setting.ts | 1 + + .../settings/site_settings/constants.ts | 1 + + .../settings_category_default_radio_group.ts | 1 + + .../settings/site_settings/site_details.html | 5 +++++ + .../recent_site_permissions.ts | 2 ++ + .../site_settings_page/site_settings_page.ts | 9 ++++++++ + .../views/page_info/page_info_view_factory.cc | 3 +++ + .../settings_localized_strings_provider.cc | 7 ++++++ + .../ui/webui/settings/site_settings_helper.cc | 1 + + .../core/browser/content_settings_registry.cc | 2 +- + 15 files changed, 76 insertions(+), 1 deletion(-) + +diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp +--- a/chrome/app/settings_strings.grdp ++++ b/chrome/app/settings_strings.grdp +@@ -3696,6 +3696,25 @@ + Not allowed to Javascript JIT + + ++ ++ Timezone override ++ ++ ++ Enable the Timezone override ++ ++ ++ System Timezone ++ ++ ++ Random Timezone ++ ++ ++ System Timezone override ++ ++ ++ Random Timezone override ++ ++ + + + +diff --git a/chrome/browser/resources/settings/icons.html b/chrome/browser/resources/settings/icons.html +--- a/chrome/browser/resources/settings/icons.html ++++ b/chrome/browser/resources/settings/icons.html +@@ -172,6 +172,8 @@ NOTE: Chrome OS icons go in ./chromeos/os_icons.html. + + + ++ ++ + + + +diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chrome/browser/resources/settings/privacy_page/privacy_page.html +--- a/chrome/browser/resources/settings/privacy_page/privacy_page.html ++++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html +@@ -1048,4 +1048,26 @@ + + + ++ + +diff --git a/chrome/browser/resources/settings/route.ts b/chrome/browser/resources/settings/route.ts +--- a/chrome/browser/resources/settings/route.ts ++++ b/chrome/browser/resources/settings/route.ts +@@ -104,6 +104,7 @@ function addPrivacyChildRoutes(r: Partial) { + r.SITE_SETTINGS_LOCAL_FONTS = r.SITE_SETTINGS.createChild('localFonts'); + r.SITE_SETTINGS_AUTOPLAY = r.SITE_SETTINGS.createChild('autoplay'); + r.SITE_SETTINGS_JAVASCRIPT_JIT = r.SITE_SETTINGS.createChild('javascript-jit'); ++ r.SITE_SETTINGS_TIMEZONE_OVERRIDE = r.SITE_SETTINGS.createChild('timezone-override'); + } + + /** +diff --git a/chrome/browser/resources/settings/settings_routes.ts b/chrome/browser/resources/settings/settings_routes.ts +--- a/chrome/browser/resources/settings/settings_routes.ts ++++ b/chrome/browser/resources/settings/settings_routes.ts +@@ -97,4 +97,5 @@ export interface SettingsRoutes { + TRIGGERED_RESET_DIALOG: Route; + SITE_SETTINGS_AUTOPLAY: Route; + SITE_SETTINGS_JAVASCRIPT_JIT: Route; ++ SITE_SETTINGS_TIMEZONE_OVERRIDE: Route; + } +diff --git a/chrome/browser/resources/settings/site_settings/category_default_setting.ts b/chrome/browser/resources/settings/site_settings/category_default_setting.ts +--- a/chrome/browser/resources/settings/site_settings/category_default_setting.ts ++++ b/chrome/browser/resources/settings/site_settings/category_default_setting.ts +@@ -197,6 +197,7 @@ export class CategoryDefaultSettingElement extends + case ContentSettingsTypes.SOUND: + case ContentSettingsTypes.AUTOPLAY: + case ContentSettingsTypes.JAVASCRIPT_JIT: ++ case ContentSettingsTypes.TIMEZONE_OVERRIDE: + // "Allowed" vs "Blocked". + this.browserProxy.setDefaultValueForContentType( + this.category, +diff --git a/chrome/browser/resources/settings/site_settings/constants.ts b/chrome/browser/resources/settings/site_settings/constants.ts +--- a/chrome/browser/resources/settings/site_settings/constants.ts ++++ b/chrome/browser/resources/settings/site_settings/constants.ts +@@ -44,6 +44,7 @@ export enum ContentSettingsTypes { + ZOOM_LEVELS = 'zoom-levels', + AUTOPLAY = 'autoplay', + JAVASCRIPT_JIT = 'javascript-jit', ++ TIMEZONE_OVERRIDE = 'timezone-override', + + // The following item is not in the C++ kContentSettingsTypeGroupNames, but it + // is used everywhere where ContentSettingsTypes is used in JS. +diff --git a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts +--- a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts ++++ b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts +@@ -141,6 +141,7 @@ export class SettingsCategoryDefaultRadioGroupElement extends + case ContentSettingsTypes.SOUND: + case ContentSettingsTypes.AUTOPLAY: + case ContentSettingsTypes.JAVASCRIPT_JIT: ++ case ContentSettingsTypes.TIMEZONE_OVERRIDE: + // "Allowed" vs "Blocked". + return ContentSetting.ALLOW; + case ContentSettingsTypes.AR: +diff --git a/chrome/browser/resources/settings/site_settings/site_details.html b/chrome/browser/resources/settings/site_settings/site_details.html +--- a/chrome/browser/resources/settings/site_settings/site_details.html ++++ b/chrome/browser/resources/settings/site_settings/site_details.html +@@ -233,4 +233,9 @@ + icon="settings:javascript-jit" + label="$i18n{siteSettingsJavascriptJIT}"> + ++ ++ + +diff --git a/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts b/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts +--- a/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts ++++ b/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts +@@ -200,6 +200,8 @@ export class SettingsRecentSitePermissionsElement extends + return this.i18n('siteSettingsAutoplayMidSentence'); + case ContentSettingsTypes.JAVASCRIPT_JIT: + return this.i18n('siteSettingsJavascriptJITMidSentence'); ++ case ContentSettingsTypes.TIMEZONE_OVERRIDE: ++ return this.i18n('siteSettingsTimezoneOverrideMidSentence'); + default: + return ''; + } +diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts +--- a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts ++++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts +@@ -329,6 +329,14 @@ function getCategoryItemMap(): Map { + enabledLabel: 'siteSettingsJavascriptJITAllowed', + disabledLabel: 'siteSettingsJavascriptJITBlocked', + }, ++ { ++ route: routes.SITE_SETTINGS_TIMEZONE_OVERRIDE, ++ id: Id.TIMEZONE_OVERRIDE, ++ label: 'siteSettingsTimezoneOverride', ++ icon: 'settings:timezone-override', ++ enabledLabel: 'siteSettingsTimezoneOverrideAllowed', ++ disabledLabel: 'siteSettingsTimezoneOverrideBlocked', ++ }, + ]; + + categoryItemMap = new Map(categoryList.map(item => [item.id, item])); +@@ -413,6 +421,7 @@ export class SettingsSiteSettingsPageElement extends PolymerElement { + Id.FEDERATED_IDENTITY_API, + Id.AUTOPLAY, + Id.JAVASCRIPT_JIT, ++ Id.TIMEZONE_OVERRIDE, + ]), + }; + }, +diff --git a/chrome/browser/ui/views/page_info/page_info_view_factory.cc b/chrome/browser/ui/views/page_info/page_info_view_factory.cc +--- a/chrome/browser/ui/views/page_info/page_info_view_factory.cc ++++ b/chrome/browser/ui/views/page_info/page_info_view_factory.cc +@@ -335,6 +335,9 @@ const ui::ImageModel PageInfoViewFactory::GetPermissionIcon( + case ContentSettingsType::JAVASCRIPT_JIT: + icon = &vector_icons::kCodeIcon; + break; ++ case ContentSettingsType::TIMEZONE_OVERRIDE: ++ icon = &vector_icons::kAccountCircleIcon; ++ break; + default: + // All other |ContentSettingsType|s do not have icons on desktop or are + // not shown in the Page Info bubble. +diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc ++++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +@@ -2097,6 +2097,13 @@ void AddSiteSettingsStrings(content::WebUIDataSource* html_source, + {"siteSettingsJavascriptJITAllowedExceptions",IDS_SETTINGS_SITE_SETTINGS_JAVASCRIPT_JIT_ALLOWED_EXCEPTIONS}, + {"siteSettingsJavascriptJITBlockedExceptions", IDS_SETTINGS_SITE_SETTINGS_JAVASCRIPT_JIT_BLOCKED_EXCEPTIONS}, + {"siteSettingsJavascriptJITMidSentence", IDS_SITE_SETTINGS_TYPE_JAVASCRIPT_JIT}, ++ {"siteSettingsTimezoneOverride", IDS_SITE_SETTINGS_TIMEZONE_OVERRIDE_TITLE}, ++ {"siteSettingsTimezoneOverrideDescription", IDS_SETTINGS_SITE_SETTINGS_TIMEZONE_OVERRIDE_DESCRIPTION}, ++ {"siteSettingsTimezoneOverrideAllowed", IDS_SETTINGS_SITE_SETTINGS_TIMEZONE_OVERRIDE_ALLOWED}, ++ {"siteSettingsTimezoneOverrideBlocked", IDS_SETTINGS_SITE_SETTINGS_TIMEZONE_OVERRIDE_BLOCKED}, ++ {"siteSettingsTimezoneOverrideAllowedExceptions",IDS_SETTINGS_SITE_SETTINGS_TIMEZONE_OVERRIDE_ALLOWED_EXCEPTIONS}, ++ {"siteSettingsTimezoneOverrideBlockedExceptions", IDS_SETTINGS_SITE_SETTINGS_TIMEZONE_OVERRIDE_BLOCKED_EXCEPTIONS}, ++ {"siteSettingsTimezoneOverrideMidSentence", IDS_SITE_SETTINGS_TIMEZONE_OVERRIDE_TITLE}, + {"addSite", IDS_SETTINGS_ADD_SITE}, + {"addSiteTitle", IDS_SETTINGS_ADD_SITE_TITLE}, + #if BUILDFLAG(IS_CHROMEOS_ASH) +diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/browser/ui/webui/settings/site_settings_helper.cc +--- a/chrome/browser/ui/webui/settings/site_settings_helper.cc ++++ b/chrome/browser/ui/webui/settings/site_settings_helper.cc +@@ -117,6 +117,7 @@ const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = { + {ContentSettingsType::FEDERATED_IDENTITY_API, "federated-identity-api"}, + {ContentSettingsType::AUTOPLAY, "autoplay"}, + {ContentSettingsType::JAVASCRIPT_JIT, "javascript-jit"}, ++ {ContentSettingsType::TIMEZONE_OVERRIDE, "timezone-override"}, + + // Add new content settings here if a corresponding Javascript string + // representation for it is not required, for example if the content setting +diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc +--- a/components/content_settings/core/browser/content_settings_registry.cc ++++ b/components/content_settings/core/browser/content_settings_registry.cc +@@ -673,7 +673,7 @@ void ContentSettingsRegistry::Init() { + CONTENT_SETTING_ASK, // custom timezone, default UTC + CONTENT_SETTING_BLOCK), // random + WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE, +- WebsiteSettingsRegistry::PLATFORM_ANDROID, ++ WebsiteSettingsRegistry::ALL_PLATFORMS, + ContentSettingsInfo::INHERIT_IN_INCOGNITO, + ContentSettingsInfo::PERSISTENT, + ContentSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS); +-- +2.25.1 diff --git a/build/patches/00Viewport-Protection--win-fixup-.patch b/build/patches/00Viewport-Protection--win-fixup-.patch new file mode 100644 index 00000000..bcfc07be --- /dev/null +++ b/build/patches/00Viewport-Protection--win-fixup-.patch @@ -0,0 +1,252 @@ +From: Your Name +Date: Thu, 13 Oct 2022 10:10:26 +0000 +Subject: Viewport Protection (win fixup) + +--- + chrome/app/settings_strings.grdp | 19 ++++++++++++++++ + chrome/browser/resources/settings/icons.html | 2 ++ + .../settings/privacy_page/privacy_page.html | 22 +++++++++++++++++++ + chrome/browser/resources/settings/route.ts | 1 + + .../resources/settings/settings_routes.ts | 1 + + .../site_settings/category_default_setting.ts | 1 + + .../settings/site_settings/constants.ts | 1 + + .../settings_category_default_radio_group.ts | 1 + + .../settings/site_settings/site_details.html | 5 +++++ + .../recent_site_permissions.ts | 2 ++ + .../site_settings_page/site_settings_page.ts | 9 ++++++++ + .../views/page_info/page_info_view_factory.cc | 3 +++ + .../settings_localized_strings_provider.cc | 7 ++++++ + .../ui/webui/settings/site_settings_helper.cc | 1 + + .../core/browser/content_settings_registry.cc | 2 +- + 15 files changed, 76 insertions(+), 1 deletion(-) + +diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp +--- a/chrome/app/settings_strings.grdp ++++ b/chrome/app/settings_strings.grdp +@@ -3753,6 +3753,25 @@ + Not allowed to use WebRTC + + ++ ++ Viewport Protection ++ ++ ++ Enable Viewport Protection ++ ++ ++ Viewport Protection is enabled ++ ++ ++ Viewport Protection is disabled ++ ++ ++ Allowed to use Viewport Protection ++ ++ ++ Not allowed to use Viewport Protection ++ ++ + + + +diff --git a/chrome/browser/resources/settings/icons.html b/chrome/browser/resources/settings/icons.html +--- a/chrome/browser/resources/settings/icons.html ++++ b/chrome/browser/resources/settings/icons.html +@@ -178,6 +178,8 @@ NOTE: Chrome OS icons go in ./chromeos/os_icons.html. + + + ++ ++ + + + +diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chrome/browser/resources/settings/privacy_page/privacy_page.html +--- a/chrome/browser/resources/settings/privacy_page/privacy_page.html ++++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html +@@ -1114,4 +1114,26 @@ + + + ++ + +diff --git a/chrome/browser/resources/settings/route.ts b/chrome/browser/resources/settings/route.ts +--- a/chrome/browser/resources/settings/route.ts ++++ b/chrome/browser/resources/settings/route.ts +@@ -107,6 +107,7 @@ function addPrivacyChildRoutes(r: Partial) { + r.SITE_SETTINGS_TIMEZONE_OVERRIDE = r.SITE_SETTINGS.createChild('timezone-override'); + r.SITE_SETTINGS_WEBGL = r.SITE_SETTINGS.createChild('webgl'); + r.SITE_SETTINGS_WEBRTC = r.SITE_SETTINGS.createChild('webrtc'); ++ r.SITE_SETTINGS_VIEWPORT = r.SITE_SETTINGS.createChild('viewport-protection'); + } + + /** +diff --git a/chrome/browser/resources/settings/settings_routes.ts b/chrome/browser/resources/settings/settings_routes.ts +--- a/chrome/browser/resources/settings/settings_routes.ts ++++ b/chrome/browser/resources/settings/settings_routes.ts +@@ -100,4 +100,5 @@ export interface SettingsRoutes { + SITE_SETTINGS_TIMEZONE_OVERRIDE: Route; + SITE_SETTINGS_WEBGL: Route; + SITE_SETTINGS_WEBRTC: Route; ++ SITE_SETTINGS_VIEWPORT: Route; + } +diff --git a/chrome/browser/resources/settings/site_settings/category_default_setting.ts b/chrome/browser/resources/settings/site_settings/category_default_setting.ts +--- a/chrome/browser/resources/settings/site_settings/category_default_setting.ts ++++ b/chrome/browser/resources/settings/site_settings/category_default_setting.ts +@@ -200,6 +200,7 @@ export class CategoryDefaultSettingElement extends + case ContentSettingsTypes.TIMEZONE_OVERRIDE: + case ContentSettingsTypes.WEBGL: + case ContentSettingsTypes.WEBRTC: ++ case ContentSettingsTypes.VIEWPORT: + // "Allowed" vs "Blocked". + this.browserProxy.setDefaultValueForContentType( + this.category, +diff --git a/chrome/browser/resources/settings/site_settings/constants.ts b/chrome/browser/resources/settings/site_settings/constants.ts +--- a/chrome/browser/resources/settings/site_settings/constants.ts ++++ b/chrome/browser/resources/settings/site_settings/constants.ts +@@ -47,6 +47,7 @@ export enum ContentSettingsTypes { + TIMEZONE_OVERRIDE = 'timezone-override', + WEBGL = 'webgl', + WEBRTC = 'webrtc', ++ VIEWPORT = 'viewport', + + // The following item is not in the C++ kContentSettingsTypeGroupNames, but it + // is used everywhere where ContentSettingsTypes is used in JS. +diff --git a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts +--- a/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts ++++ b/chrome/browser/resources/settings/site_settings/settings_category_default_radio_group.ts +@@ -144,6 +144,7 @@ export class SettingsCategoryDefaultRadioGroupElement extends + case ContentSettingsTypes.TIMEZONE_OVERRIDE: + case ContentSettingsTypes.WEBGL: + case ContentSettingsTypes.WEBRTC: ++ case ContentSettingsTypes.VIEWPORT: + // "Allowed" vs "Blocked". + return ContentSetting.ALLOW; + case ContentSettingsTypes.AR: +diff --git a/chrome/browser/resources/settings/site_settings/site_details.html b/chrome/browser/resources/settings/site_settings/site_details.html +--- a/chrome/browser/resources/settings/site_settings/site_details.html ++++ b/chrome/browser/resources/settings/site_settings/site_details.html +@@ -248,4 +248,9 @@ + icon="settings:webrtc" + label="$i18n{siteSettingsWebRTC}"> + ++ ++ + +diff --git a/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts b/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts +--- a/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts ++++ b/chrome/browser/resources/settings/site_settings_page/recent_site_permissions.ts +@@ -206,6 +206,8 @@ export class SettingsRecentSitePermissionsElement extends + return this.i18n('siteSettingsWebglMidSentence'); + case ContentSettingsTypes.WEBRTC: + return this.i18n('siteSettingsWebRTCMidSentence'); ++ case ContentSettingsTypes.VIEWPORT: ++ return this.i18n('siteSettingsViewportProtectionMidSentence'); + default: + return ''; + } +diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts +--- a/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts ++++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page.ts +@@ -353,6 +353,14 @@ function getCategoryItemMap(): Map { + enabledLabel: 'siteSettingsWebRTCAllowed', + disabledLabel: 'siteSettingsWebRTCBlocked', + }, ++ { ++ route: routes.SITE_SETTINGS_VIEWPORT, ++ id: Id.VIEWPORT, ++ label: 'siteSettingsViewportProtection', ++ icon: 'settings:viewport-protection', ++ enabledLabel: 'siteSettingsViewportProtectionAllowed', ++ disabledLabel: 'siteSettingsViewportProtectionBlocked', ++ }, + ]; + + categoryItemMap = new Map(categoryList.map(item => [item.id, item])); +@@ -440,6 +448,7 @@ export class SettingsSiteSettingsPageElement extends PolymerElement { + Id.TIMEZONE_OVERRIDE, + Id.WEBGL, + Id.WEBRTC, ++ Id.VIEWPORT, + ]), + }; + }, +diff --git a/chrome/browser/ui/views/page_info/page_info_view_factory.cc b/chrome/browser/ui/views/page_info/page_info_view_factory.cc +--- a/chrome/browser/ui/views/page_info/page_info_view_factory.cc ++++ b/chrome/browser/ui/views/page_info/page_info_view_factory.cc +@@ -344,6 +344,9 @@ const ui::ImageModel PageInfoViewFactory::GetPermissionIcon( + case ContentSettingsType::WEBRTC: + icon = &vector_icons::kProtectedContentIcon; + break; ++ case ContentSettingsType::VIEWPORT: ++ icon = &vector_icons::kProtectedContentIcon; ++ break; + default: + // All other |ContentSettingsType|s do not have icons on desktop or are + // not shown in the Page Info bubble. +diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc ++++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +@@ -2118,6 +2118,13 @@ void AddSiteSettingsStrings(content::WebUIDataSource* html_source, + {"siteSettingsWebRTCAllowedExceptions",IDS_SETTINGS_SITE_SETTINGS_WEBRTC_ALLOWED_EXCEPTIONS}, + {"siteSettingsWebRTCBlockedExceptions", IDS_SETTINGS_SITE_SETTINGS_WEBRTC_BLOCKED_EXCEPTIONS}, + {"siteSettingsWebRTCMidSentence", IDS_SITE_SETTINGS_WEBRTC_TITLE}, ++ {"siteSettingsViewportProtection", IDS_SITE_SETTINGS_VIEWPORT_PROTECTION_TITLE}, ++ {"siteSettingsViewportProtectionDescription", IDS_SETTINGS_SITE_SETTINGS_VIEWPORT_PROTECTION_DESCRIPTION}, ++ {"siteSettingsViewportProtectionAllowed", IDS_SETTINGS_SITE_SETTINGS_VIEWPORT_PROTECTION_ALLOWED}, ++ {"siteSettingsViewportProtectionBlocked", IDS_SETTINGS_SITE_SETTINGS_VIEWPORT_PROTECTION_BLOCKED}, ++ {"siteSettingsViewportProtectionAllowedExceptions",IDS_SETTINGS_SITE_SETTINGS_VIEWPORT_PROTECTION_ALLOWED_EXCEPTIONS}, ++ {"siteSettingsViewportProtectionBlockedExceptions", IDS_SETTINGS_SITE_SETTINGS_VIEWPORT_PROTECTION_BLOCKED_EXCEPTIONS}, ++ {"siteSettingsViewportProtectionMidSentence", IDS_SITE_SETTINGS_VIEWPORT_PROTECTION_TITLE}, + {"addSite", IDS_SETTINGS_ADD_SITE}, + {"addSiteTitle", IDS_SETTINGS_ADD_SITE_TITLE}, + #if BUILDFLAG(IS_CHROMEOS_ASH) +diff --git a/chrome/browser/ui/webui/settings/site_settings_helper.cc b/chrome/browser/ui/webui/settings/site_settings_helper.cc +--- a/chrome/browser/ui/webui/settings/site_settings_helper.cc ++++ b/chrome/browser/ui/webui/settings/site_settings_helper.cc +@@ -120,6 +120,7 @@ const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = { + {ContentSettingsType::TIMEZONE_OVERRIDE, "timezone-override"}, + {ContentSettingsType::WEBGL, "webgl"}, + {ContentSettingsType::WEBRTC, "webrtc"}, ++ {ContentSettingsType::VIEWPORT, "viewport"}, + + // Add new content settings here if a corresponding Javascript string + // representation for it is not required, for example if the content setting +diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc +--- a/components/content_settings/core/browser/content_settings_registry.cc ++++ b/components/content_settings/core/browser/content_settings_registry.cc +@@ -722,7 +722,7 @@ void ContentSettingsRegistry::Init() { + ValidSettings(CONTENT_SETTING_ALLOW, + CONTENT_SETTING_BLOCK), + WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE, +- WebsiteSettingsRegistry::PLATFORM_ANDROID, ++ WebsiteSettingsRegistry::ALL_PLATFORMS, + ContentSettingsInfo::INHERIT_IN_INCOGNITO, + ContentSettingsInfo::PERSISTENT, + ContentSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS, +-- +2.25.1 diff --git a/build/patches/00openH264--enable-ARM-ARM64-optimizati--win-fixup-.patch b/build/patches/00openH264--enable-ARM-ARM64-optimizati--win-fixup-.patch new file mode 100644 index 00000000..83c8e636 --- /dev/null +++ b/build/patches/00openH264--enable-ARM-ARM64-optimizati--win-fixup-.patch @@ -0,0 +1,26 @@ +From: Your Name +Date: Wed, 12 Oct 2022 11:31:11 +0000 +Subject: openH264: enable ARM/ARM64 optimizati (win fixup) + +--- + .../blink/renderer/modules/mediarecorder/h264_encoder.cc | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/third_party/blink/renderer/modules/mediarecorder/h264_encoder.cc b/third_party/blink/renderer/modules/mediarecorder/h264_encoder.cc +--- a/third_party/blink/renderer/modules/mediarecorder/h264_encoder.cc ++++ b/third_party/blink/renderer/modules/mediarecorder/h264_encoder.cc +@@ -219,9 +219,9 @@ bool H264Encoder::ConfigureEncoderOnEncodingTaskRunner(const gfx::Size& size) { + init_params.iRCMode = RC_OFF_MODE; + } + +-#if BUILDFLAG(OS_MACOSX) +- // Threading model: Set to 1 due to https://crbug.com/583348. +- init_params.iMultipleThreadIdc = 1; ++#if BUILDFLAG(IS_MAC) ++ // Threading model: Set to 1 due to https://crbug.com/583348. ++ init_params.iMultipleThreadIdc = 1; + #else + init_params.iMultipleThreadIdc = 0; + #endif +-- +2.25.1 diff --git a/build/patches/00ungoogled-chr--Disable-profile-avatar--win-fixup-.patch b/build/patches/00ungoogled-chr--Disable-profile-avatar--win-fixup-.patch new file mode 100644 index 00000000..26187d91 --- /dev/null +++ b/build/patches/00ungoogled-chr--Disable-profile-avatar--win-fixup-.patch @@ -0,0 +1,22 @@ +From: Your Name +Date: Wed, 12 Oct 2022 10:04:39 +0000 +Subject: ungoogled-chr: Disable profile avatar (win fixup) + +--- + chrome/browser/profiles/profile_attributes_storage.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chrome/browser/profiles/profile_attributes_storage.cc b/chrome/browser/profiles/profile_attributes_storage.cc +--- a/chrome/browser/profiles/profile_attributes_storage.cc ++++ b/chrome/browser/profiles/profile_attributes_storage.cc +@@ -800,7 +800,7 @@ void ProfileAttributesStorage::DownloadHighResAvatarIfNeeded( + void ProfileAttributesStorage::DownloadHighResAvatar( + size_t icon_index, + const base::FilePath& profile_path) { +-#if !BUILDFLAG(IS_ANDROID) ++#if false + const char* file_name = + profiles::GetDefaultAvatarIconFileNameAtIndex(icon_index); + DCHECK(file_name); +-- +2.25.1 diff --git a/build/patches/00ungoogled-chromium--no-special-hosts-d--win-fixup-.patch b/build/patches/00ungoogled-chromium--no-special-hosts-d--win-fixup-.patch new file mode 100644 index 00000000..9df8a9dd --- /dev/null +++ b/build/patches/00ungoogled-chromium--no-special-hosts-d--win-fixup-.patch @@ -0,0 +1,107 @@ +From: Your Name +Date: Thu, 13 Oct 2022 10:27:15 +0000 +Subject: ungoogled-chromium: no special hosts/d (win fixup) + +--- + components/domain_reliability/BUILD.gn | 47 ++++++++++++++---------- + components/domain_reliability/monitor.cc | 8 ---- + 2 files changed, 28 insertions(+), 27 deletions(-) + +diff --git a/components/domain_reliability/BUILD.gn b/components/domain_reliability/BUILD.gn +--- a/components/domain_reliability/BUILD.gn ++++ b/components/domain_reliability/BUILD.gn +@@ -2,11 +2,31 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-action("bake_in_configs") { ++action("bake_in_configs_EXCLUDED") { + visibility = [ ":*" ] + script = "bake_in_configs.py" + + inputs = [ ++ "baked_in_configs/c_android_clients_google_com.json", ++ "baked_in_configs/c_bigcache_googleapis_com.json", ++ "baked_in_configs/c_doc-0-0-sj_sj_googleusercontent_com.json", ++ "baked_in_configs/c_docs_google_com.json", ++ "baked_in_configs/c_drive_google_com.json", ++ "baked_in_configs/c_googlesyndication_com.json", ++ "baked_in_configs/c_pack_google_com.json", ++ "baked_in_configs/c_play_google_com.json", ++ "baked_in_configs/c_youtube_com.json", ++ "baked_in_configs/clients2_google_com.json", ++ "baked_in_configs/docs_google_com.json", ++ "baked_in_configs/gcp_gvt2_com.json", ++ "baked_in_configs/gcp_gvt6_com.json", ++ "baked_in_configs/google-analytics_com.json", ++ "baked_in_configs/googlevideo_com.json", ++ "baked_in_configs/gvt1_com.json", ++ "baked_in_configs/gvt2_com.json", ++ "baked_in_configs/gvt6_com.json", ++ "baked_in_configs/ssl_gstatic_com.json", ++ "baked_in_configs/www_google_com.json", + ] + + output_file = "$target_gen_dir/baked_in_configs.cc" +@@ -14,21 +34,13 @@ action("bake_in_configs") { + + # The JSON file list is too long for the command line on Windows, so put + # them in a response file. +- if (is_win) { +- args = [ +- "--file-list", +- "nul", +- "--output", +- rebase_path(output_file, root_build_dir), +- ] +- } else { +- args = [ +- "--file-list", +- "/dev/null", +- "--output", +- rebase_path(output_file, root_build_dir), +- ] +- } ++ response_file_contents = rebase_path(inputs, root_build_dir) ++ args = [ ++ "--file-list", ++ "{{response_file_name}}", ++ "--output", ++ rebase_path(output_file, root_build_dir), ++ ] + } + + component("domain_reliability") { +@@ -61,12 +73,9 @@ component("domain_reliability") { + "util.cc", + "util.h", + ] +- sources += get_target_outputs(":bake_in_configs") +- + defines = [ "DOMAIN_RELIABILITY_IMPLEMENTATION" ] + + deps = [ +- ":bake_in_configs", + "//base", + "//net", + "//url", +diff --git a/components/domain_reliability/monitor.cc b/components/domain_reliability/monitor.cc +--- a/components/domain_reliability/monitor.cc ++++ b/components/domain_reliability/monitor.cc +@@ -94,14 +94,6 @@ void DomainReliabilityMonitor::Shutdown() { + } + + void DomainReliabilityMonitor::AddBakedInConfigs() { +- for (size_t i = 0; kBakedInJsonConfigs[i]; ++i) { +- base::StringPiece json(kBakedInJsonConfigs[i]); +- std::unique_ptr config = +- DomainReliabilityConfig::FromJSON(json); +- // Guard against accidentally checking in malformed JSON configs. +- DCHECK(config->IsValid()); +- context_manager_.AddContextForConfig(std::move(config)); +- } + } + + void DomainReliabilityMonitor::SetDiscardUploads(bool discard_uploads) { +-- +2.25.1