From e42602af04531e4e86ee4ab7bf1cf4e73e5af0c2 Mon Sep 17 00:00:00 2001 From: Alexander Frick Date: Mon, 15 Jul 2024 14:14:42 -0500 Subject: [PATCH] M126 stage 1 --- arm/build/config/arm.gni | 2 +- arm/mac_arm.gni | 2 +- arm/raspi/build/config/arm.gni | 2 +- arm/woa_arm.gni | 2 +- infra/THORIUM_DEV_BOOKMARKS.html | 2 +- src/build/config/arm.gni | 2 +- .../background/background_mode_manager.cc | 2 +- .../net/stub_resolver_config_reader.cc | 6 +- src/chrome/browser/ui/browser_ui_prefs.cc | 19 ++-- .../browser/ui/startup/bad_flags_prompt.cc | 20 ++--- .../default_browser_prompt.cc | 86 ++++++++----------- .../browser/ui/startup/infobar_utils.cc | 7 +- src/chrome/installer/linux/BUILD.gn | 8 ++ .../installer/linux/common/installer.include | 6 +- src/chrome/installer/linux/debian/build.sh | 8 +- src/chrome/installer/linux/rpm/build.sh | 2 +- .../public/common/download_features.cc | 6 -- .../privacy_sandbox_settings_impl.cc | 49 +++++++++-- .../tracking_protection_prefs.cc | 12 +-- .../search_engines/prepopulated_engines.json | 6 +- .../search_engine_countries-inc.cc | 6 ++ 21 files changed, 149 insertions(+), 106 deletions(-) rename src/chrome/browser/ui/startup/{ => default_browser_prompt}/default_browser_prompt.cc (69%) diff --git a/arm/build/config/arm.gni b/arm/build/config/arm.gni index 316ab056..12d9e549 100644 --- a/arm/build/config/arm.gni +++ b/arm/build/config/arm.gni @@ -41,7 +41,7 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") { # For lacros build, we use ARM v8 by default. if (is_chromeos_lacros && arm_arch == "") { - # TODO(crbug.com/1467681) Enable i8mm and dotprod instructions for ffmpeg + # TODO(crbug.com/40276884) Enable i8mm and dotprod instructions for ffmpeg # if ever we update to a version of arm that supports these instructions. arm_version = 8 arm_arch = "armv8-a+crc" diff --git a/arm/mac_arm.gni b/arm/mac_arm.gni index 56900e4a..1ab5ffff 100644 --- a/arm/mac_arm.gni +++ b/arm/mac_arm.gni @@ -41,7 +41,7 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") { # For lacros build, we use ARM v8 by default. if (is_chromeos_lacros && arm_arch == "") { - # TODO(crbug.com/1467681) Enable i8mm and dotprod instructions for ffmpeg + # TODO(crbug.com/40276884) Enable i8mm and dotprod instructions for ffmpeg # if ever we update to a version of arm that supports these instructions. arm_version = 8 arm_arch = "armv8-a+crc" diff --git a/arm/raspi/build/config/arm.gni b/arm/raspi/build/config/arm.gni index 31019a0e..26f639eb 100644 --- a/arm/raspi/build/config/arm.gni +++ b/arm/raspi/build/config/arm.gni @@ -43,7 +43,7 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") { # For lacros build, we use ARM v8 by default. if (is_chromeos_lacros && arm_arch == "") { - # TODO(crbug.com/1467681) Enable i8mm and dotprod instructions for ffmpeg + # TODO(crbug.com/40276884) Enable i8mm and dotprod instructions for ffmpeg # if ever we update to a version of arm that supports these instructions. arm_version = 8 arm_arch = "armv8-a+crc" diff --git a/arm/woa_arm.gni b/arm/woa_arm.gni index edd45e09..99409c35 100644 --- a/arm/woa_arm.gni +++ b/arm/woa_arm.gni @@ -41,7 +41,7 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") { # For lacros build, we use ARM v8 by default. if (is_chromeos_lacros && arm_arch == "") { - # TODO(crbug.com/1467681) Enable i8mm and dotprod instructions for ffmpeg + # TODO(crbug.com/40276884) Enable i8mm and dotprod instructions for ffmpeg # if ever we update to a version of arm that supports these instructions. arm_version = 8 arm_arch = "armv8-a+crc" diff --git a/infra/THORIUM_DEV_BOOKMARKS.html b/infra/THORIUM_DEV_BOOKMARKS.html index e515415e..14b7d3f0 100644 --- a/infra/THORIUM_DEV_BOOKMARKS.html +++ b/infra/THORIUM_DEV_BOOKMARKS.html @@ -31,7 +31,7 @@
browser_ui_prefs.cc - Chromium Code Search
google_api_keys_infobar_delegate.cc - Chromium Code Search
infobar_utils.cc - Chromium Code Search -
default_browser_prompt.cc - Chromium Code Search +
default_browser_prompt.cc - Chromium Code Search
bad_flags_prompt.cc - Chromium Code Search
installer/linux - Chromium Code Search
chrome.release - Chromium Code Search diff --git a/src/build/config/arm.gni b/src/build/config/arm.gni index 316ab056..12d9e549 100644 --- a/src/build/config/arm.gni +++ b/src/build/config/arm.gni @@ -41,7 +41,7 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") { # For lacros build, we use ARM v8 by default. if (is_chromeos_lacros && arm_arch == "") { - # TODO(crbug.com/1467681) Enable i8mm and dotprod instructions for ffmpeg + # TODO(crbug.com/40276884) Enable i8mm and dotprod instructions for ffmpeg # if ever we update to a version of arm that supports these instructions. arm_version = 8 arm_arch = "armv8-a+crc" diff --git a/src/chrome/browser/background/background_mode_manager.cc b/src/chrome/browser/background/background_mode_manager.cc index ceb23e16..09077378 100644 --- a/src/chrome/browser/background/background_mode_manager.cc +++ b/src/chrome/browser/background/background_mode_manager.cc @@ -427,7 +427,7 @@ void BackgroundModeManager::LaunchBackgroundApplication( base::DoNothing()); #else // background mode is not used in Chrome OS platform. - // TODO(crbug.com/1291803): Remove the background mode manager from Chrome OS + // TODO(crbug.com/40212901): Remove the background mode manager from Chrome OS // build. NOTIMPLEMENTED(); #endif diff --git a/src/chrome/browser/net/stub_resolver_config_reader.cc b/src/chrome/browser/net/stub_resolver_config_reader.cc index b9527c30..374eb24f 100644 --- a/src/chrome/browser/net/stub_resolver_config_reader.cc +++ b/src/chrome/browser/net/stub_resolver_config_reader.cc @@ -236,9 +236,9 @@ bool StubResolverConfigReader::ShouldDisableDohForManaged() { if (android_has_owner_.value_or(false)) return true; #elif BUILDFLAG(IS_WIN) - // TODO(crbug.com/1339062): What is the correct function to use here? (This + // TODO(crbug.com/40229843): What is the correct function to use here? (This // may or may not obsolete the following TODO) - // TODO(crbug.com/1320766): For legacy compatibility, this uses + // TODO(crbug.com/40223626): For legacy compatibility, this uses // IsEnterpriseDevice() which effectively equates to a domain join check. // Consider whether this should use IsManagedDevice() instead. if (base::win::IsEnrolledToDomain()) @@ -401,7 +401,7 @@ void StubResolverConfigReader::OnAndroidOwnedStateCheckComplete( std::optional StubResolverConfigReader::GetDohWithIdentifiersDisplayServers() { ash::dns_over_https::TemplatesUriResolverImpl doh_template_uri_resolver; - doh_template_uri_resolver.UpdateFromPrefs(local_state_); + doh_template_uri_resolver.Update(local_state_); if (doh_template_uri_resolver.GetDohWithIdentifiersActive()) return doh_template_uri_resolver.GetDisplayTemplates(); diff --git a/src/chrome/browser/ui/browser_ui_prefs.cc b/src/chrome/browser/ui/browser_ui_prefs.cc index 3c5f1bf6..56ecb7fa 100644 --- a/src/chrome/browser/ui/browser_ui_prefs.cc +++ b/src/chrome/browser/ui/browser_ui_prefs.cc @@ -29,7 +29,7 @@ namespace { -uint32_t GetHomeButtonAndHomePageIsNewTabPageFlags() { +uint32_t GetHomeAndForwardButtonAndHomePageIsNewTabPageFlags() { #if BUILDFLAG(IS_ANDROID) return PrefRegistry::NO_REGISTRATION_FLAGS; #else @@ -69,15 +69,22 @@ void RegisterBrowserPrefs(PrefRegistrySimple* registry) { registry->RegisterTimePref(prefs::kDefaultBrowserLastDeclinedTime, base::Time()); - registry->RegisterIntegerPref(prefs::kDefaultBrowserDeclinedCount, 0); + registry->RegisterTimePref(prefs::kDefaultBrowserFirstShownTime, + base::Time()); } void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) { - registry->RegisterBooleanPref(prefs::kHomePageIsNewTabPage, true, - GetHomeButtonAndHomePageIsNewTabPageFlags()); - registry->RegisterBooleanPref(prefs::kShowHomeButton, true, - GetHomeButtonAndHomePageIsNewTabPageFlags()); + registry->RegisterBooleanPref( + prefs::kHomePageIsNewTabPage, true, + GetHomeAndForwardButtonAndHomePageIsNewTabPageFlags()); + registry->RegisterBooleanPref( + prefs::kShowHomeButton, true, + GetHomeAndForwardButtonAndHomePageIsNewTabPageFlags()); + + registry->RegisterBooleanPref( + prefs::kShowForwardButton, true, + GetHomeAndForwardButtonAndHomePageIsNewTabPageFlags()); registry->RegisterInt64Pref(prefs::kDefaultBrowserLastDeclined, 0); registry->RegisterBooleanPref(prefs::kWebAppCreateOnDesktop, true); diff --git a/src/chrome/browser/ui/startup/bad_flags_prompt.cc b/src/chrome/browser/ui/startup/bad_flags_prompt.cc index 52c586b7..4cf8c196 100644 --- a/src/chrome/browser/ui/startup/bad_flags_prompt.cc +++ b/src/chrome/browser/ui/startup/bad_flags_prompt.cc @@ -6,6 +6,7 @@ #include #include +#include #include "base/base_switches.h" #include "base/command_line.h" @@ -28,6 +29,7 @@ #include "components/history_clusters/core/file_clustering_backend.h" #include "components/infobars/content/content_infobar_manager.h" #include "components/infobars/core/infobar_delegate.h" +#include "components/media_router/common/providers/cast/certificate/switches.h" #include "components/network_session_configurator/common/network_switches.h" #include "components/startup_metric_utils/browser/startup_metric_utils.h" #include "components/translate/core/common/translate_switches.h" @@ -73,7 +75,7 @@ const char* const kBadFlags[] = { // These flags disable sandbox-related security. sandbox::policy::switches::kDisableGpuSandbox, sandbox::policy::switches::kDisableSeccompFilterSandbox, - // sandbox::policy::switches::kDisableSetuidSandbox, (Disabled by Alex313031) + sandbox::policy::switches::kDisableSetuidSandbox, sandbox::policy::switches::kNoSandbox, #if BUILDFLAG(IS_WIN) sandbox::policy::switches::kAllowThirdPartyModules, @@ -103,7 +105,7 @@ const char* const kBadFlags[] = { extensions::switches::kExtensionsOnChromeURLs, #endif -// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch +// TODO(crbug.com/40118868): Revisit the macro expression once build flag switch // of lacros-chrome is complete. #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) // Speech dispatcher is buggy, it can crash and it can make Chrome freeze. @@ -111,12 +113,6 @@ const char* const kBadFlags[] = { switches::kEnableSpeechDispatcher, #endif -#if BUILDFLAG(IS_MAC) - // This flag is only used for performance tests in mac, to ensure that - // calculated values are reliable. Should not be used elsewhere. - switches::kUseHighGPUThreadPriorityForPerfTests, -#endif - // These flags control Blink feature state, which is not supported and is // intended only for use by Chromium developers. // switches::kDisableBlinkFeatures, (Disabled by Alex313031) @@ -178,6 +174,10 @@ const char* const kBadFlags[] = { // in tests and performance benchmarks. Using it could allow faking user // interaction across origins. cc::switches::kEnableGpuBenchmarking, + + // This flag enables loading a developer-signed certificate for Cast + // streaming receivers and should only be used for testing purposes. + cast_certificate::switches::kCastDeveloperCertificatePath, }; #endif // !BUILDFLAG(IS_ANDROID) @@ -199,12 +199,12 @@ static const base::Feature* kBadFeatureFlagsInAboutFlags[] = { // This flag disables security for the Page Embedded Permission Control, for // testing purposes. Can only be enabled via the command line. - &blink::features::kDisablePepcSecurityForTesting, + &blink::features::kBypassPepcSecurityForTesting, }; void ShowBadFlagsInfoBarHelper(content::WebContents* web_contents, int message_id, - base::StringPiece flag) { + std::string_view flag) { // Animating the infobar also animates the content area size which can trigger // a flood of page layout, compositing, texture reallocations, etc. Do not // animate the infobar to reduce noise in perf benchmarks because they pass diff --git a/src/chrome/browser/ui/startup/default_browser_prompt.cc b/src/chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt.cc similarity index 69% rename from src/chrome/browser/ui/startup/default_browser_prompt.cc rename to src/chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt.cc index f32ea731..4ff8e6f8 100644 --- a/src/chrome/browser/ui/startup/default_browser_prompt.cc +++ b/src/chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt.cc @@ -2,18 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/startup/default_browser_prompt.h" +#include "chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt.h" #include #include #include "base/check_is_test.h" -#include "base/feature_list.h" #include "base/functional/bind.h" -#include "base/functional/callback_helpers.h" #include "base/location.h" #include "base/memory/weak_ptr.h" -#include "base/metrics/field_trial.h" #include "base/strings/string_number_conversions.h" #include "base/task/single_thread_task_runner.h" #include "base/time/time.h" @@ -25,8 +22,10 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_list.h" -#include "chrome/browser/ui/startup/default_browser_infobar_delegate.h" -#include "chrome/browser/ui/startup/default_browser_prompt_manager.h" +#include "chrome/browser/ui/startup/default_browser_prompt/default_browser_infobar_delegate.h" +#include "chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt_manager.h" +#include "chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt_prefs.h" +#include "chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt_trial.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/ui_features.h" #include "chrome/common/pref_names.h" @@ -36,21 +35,25 @@ #include "components/version_info/version_info.h" #include "content/public/browser/visibility.h" #include "content/public/browser/web_contents.h" -#include "ui/base/ui_base_features.h" namespace { -void ResetCheckDefaultBrowserPref(const base::FilePath& profile_path) { - Profile* profile = - g_browser_process->profile_manager()->GetProfileByPath(profile_path); - if (profile) - ResetDefaultBrowserPrompt(profile); -} - void ShowPrompt() { return; } +// Do not show the prompt if "suppress_default_browser_prompt_for_version" in +// the initial preferences is set to the current version. +bool ShouldShowDefaultBrowserPromptForCurrentVersion() { + const std::string disable_version_string = + g_browser_process->local_state()->GetString( + prefs::kBrowserSuppressDefaultBrowserPrompt); + const base::Version disable_version(disable_version_string); + DCHECK(disable_version_string.empty() || disable_version.IsValid()); + return !(disable_version.IsValid() && + disable_version == version_info::GetVersion()); +} + // Returns true if the default browser prompt should be shown if Chrome is not // the user's default browser. bool ShouldShowDefaultBrowserPrompt(Profile* profile) { @@ -58,27 +61,37 @@ bool ShouldShowDefaultBrowserPrompt(Profile* profile) { } void OnCheckIsDefaultBrowserFinished( - const base::FilePath& profile_path, - bool show_prompt, + Profile* profile, shell_integration::DefaultWebClientState state) { if (state == shell_integration::IS_DEFAULT) { // Notify the user in the future if Chrome ceases to be the user's chosen // default browser. - ResetCheckDefaultBrowserPref(profile_path); - } else if (show_prompt && state == shell_integration::NOT_DEFAULT && - shell_integration::CanSetAsDefaultBrowser()) { + chrome::startup::default_prompt::ResetPromptPrefs(profile); + } else if (state == shell_integration::NOT_DEFAULT && + shell_integration::CanSetAsDefaultBrowser() && + ShouldShowDefaultBrowserPromptForCurrentVersion()) { + // If the user is in the control or an experiment arm, move them into the + // synthetic trial cohort. + DefaultBrowserPromptTrial::MaybeJoinDefaultBrowserPromptCohort(); + + chrome::startup::default_prompt::MaybeResetAppMenuPromptPrefs(profile); + // Only show the prompt if some other program is the user's default browser. // In particular, don't show it if another install mode is default (e.g., // don't prompt for Chrome Beta if stable Chrome is the default). - ShowPrompt(); + if (base::FeatureList::IsEnabled(features::kDefaultBrowserPromptRefresh)) { + DefaultBrowserPromptManager::GetInstance()->MaybeShowPrompt(); + } else if (ShouldShowDefaultBrowserPrompt(profile)) { + ShowPrompt(); + } } } } // namespace void RegisterDefaultBrowserPromptPrefs(PrefRegistrySimple* registry) { - registry->RegisterStringPref( - prefs::kBrowserSuppressDefaultBrowserPrompt, std::string()); + registry->RegisterStringPref(prefs::kBrowserSuppressDefaultBrowserPrompt, + std::string()); registry->RegisterStringPref(prefs::kDefaultBrowserPromptRefreshStudyGroup, std::string()); } @@ -128,7 +141,7 @@ void ShowDefaultBrowserPrompt(Profile* profile) { // Do not check if Chrome is the default browser if there is a policy in // control of this setting. if (g_browser_process->local_state()->IsManagedPreference( - prefs::kDefaultBrowserSettingEnabled)) { + prefs::kDefaultBrowserSettingEnabled)) { // Handling of the browser.default_browser_setting_enabled policy setting is // taken care of in BrowserProcessImpl. return; @@ -137,34 +150,9 @@ void ShowDefaultBrowserPrompt(Profile* profile) { scoped_refptr( new shell_integration::DefaultBrowserWorker()) ->StartCheckIsDefault( - base::BindOnce(&OnCheckIsDefaultBrowserFinished, profile->GetPath(), - ShouldShowDefaultBrowserPrompt(profile))); -} - -void DefaultBrowserPromptDeclined(Profile* profile) { - base::Time now = base::Time::Now(); - profile->GetPrefs()->SetInt64(prefs::kDefaultBrowserLastDeclined, - now.ToInternalValue()); - - PrefService* local_state = g_browser_process->local_state(); - local_state->SetTime(prefs::kDefaultBrowserLastDeclinedTime, now); - local_state->SetInteger( - prefs::kDefaultBrowserDeclinedCount, - local_state->GetInteger(prefs::kDefaultBrowserDeclinedCount) + 1); -} - -void ResetDefaultBrowserPrompt(Profile* profile) { - profile->GetPrefs()->ClearPref(prefs::kDefaultBrowserLastDeclined); - - PrefService* local_state = g_browser_process->local_state(); - local_state->ClearPref(prefs::kDefaultBrowserLastDeclinedTime); - local_state->ClearPref(prefs::kDefaultBrowserDeclinedCount); + base::BindOnce(&OnCheckIsDefaultBrowserFinished, profile)); } void ShowPromptForTesting() { ShowPrompt(); } - -bool ShouldShowDefaultBrowserPromptForTesting(Profile* profile) { - return ShouldShowDefaultBrowserPrompt(profile); -} diff --git a/src/chrome/browser/ui/startup/infobar_utils.cc b/src/chrome/browser/ui/startup/infobar_utils.cc index eca275e0..f3f5a178 100644 --- a/src/chrome/browser/ui/startup/infobar_utils.cc +++ b/src/chrome/browser/ui/startup/infobar_utils.cc @@ -16,7 +16,6 @@ #include "chrome/browser/ui/startup/automation_infobar_delegate.h" #include "chrome/browser/ui/startup/bad_flags_prompt.h" #include "chrome/browser/ui/startup/bidding_and_auction_consented_debugging_infobar_delegate.h" -#include "chrome/browser/ui/startup/default_browser_prompt.h" #include "chrome/browser/ui/startup/google_api_keys_infobar_delegate.h" #include "chrome/browser/ui/startup/obsolete_system_infobar_delegate.h" #include "chrome/browser/ui/startup/startup_browser_creator.h" @@ -30,6 +29,10 @@ #include "google_apis/google_api_keys.h" #include "services/network/public/cpp/network_switches.h" +#if !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID) +#include "chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt.h" +#endif + #if BUILDFLAG(CHROME_FOR_TESTING) #include "chrome/browser/ui/startup/chrome_for_testing_infobar_delegate.h" #endif @@ -151,7 +154,7 @@ void AddInfoBarsIfNecessary(Browser* browser, //infobars::ContentInfoBarManager* infobar_manager = // infobars::ContentInfoBarManager::FromWebContents(web_contents); -#if !BUILDFLAG(IS_CHROMEOS_ASH) +#if !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID) if (!is_web_app && !startup_command_line.HasSwitch(switches::kNoDefaultBrowserCheck)) { // The default browser prompt should only be shown after the first run. diff --git a/src/chrome/installer/linux/BUILD.gn b/src/chrome/installer/linux/BUILD.gn index 37e68d97..6259c30e 100644 --- a/src/chrome/installer/linux/BUILD.gn +++ b/src/chrome/installer/linux/BUILD.gn @@ -301,20 +301,28 @@ copy("theme_files") { if (is_chrome_branded) { sources += [ "$branding_dir/linux/product_logo_128_beta.png", + "$branding_dir/linux/product_logo_128_canary.png", "$branding_dir/linux/product_logo_128_dev.png", "$branding_dir/linux/product_logo_24_beta.png", + "$branding_dir/linux/product_logo_24_canary.png", "$branding_dir/linux/product_logo_24_dev.png", "$branding_dir/linux/product_logo_256_beta.png", + "$branding_dir/linux/product_logo_256_canary.png", "$branding_dir/linux/product_logo_256_dev.png", "$branding_dir/linux/product_logo_32_beta.xpm", + "$branding_dir/linux/product_logo_32_canary.xpm", "$branding_dir/linux/product_logo_32_dev.xpm", "$branding_dir/linux/product_logo_48_beta.png", + "$branding_dir/linux/product_logo_48_canary.png", "$branding_dir/linux/product_logo_48_dev.png", "$branding_dir/linux/product_logo_64_beta.png", + "$branding_dir/linux/product_logo_64_canary.png", "$branding_dir/linux/product_logo_64_dev.png", "$branding_dir_100/linux/product_logo_16_beta.png", + "$branding_dir_100/linux/product_logo_16_canary.png", "$branding_dir_100/linux/product_logo_16_dev.png", "$branding_dir_100/linux/product_logo_32_beta.png", + "$branding_dir_100/linux/product_logo_32_canary.png", "$branding_dir_100/linux/product_logo_32_dev.png", ] } diff --git a/src/chrome/installer/linux/common/installer.include b/src/chrome/installer/linux/common/installer.include index 9c75e5cb..92495110 100644 --- a/src/chrome/installer/linux/common/installer.include +++ b/src/chrome/installer/linux/common/installer.include @@ -192,7 +192,7 @@ stage_install_common() { # V8 snapshot files; Necessary when the GN v8_use_external_startup_data flag # is true. # Use v8_context_snapshot.bin instead of snapshot_blob.bin if it is available. - # TODO(crbug.com/764576): Unship snapshot_blob.bin on ChromeOS and drop this branch + # TODO(crbug.com/40539769): Unship snapshot_blob.bin on ChromeOS and drop this branch if [ -f "${OUTPUTDIR}/v8_context_snapshot.bin" ]; then install -m 644 "${OUTPUTDIR}/v8_context_snapshot.bin" "${STAGEDIR}/${INSTALLDIR}/" else @@ -214,7 +214,7 @@ stage_install_common() { cp -a '{}' "${STAGEDIR}/${INSTALLDIR}/locales/" \; find "${STAGEDIR}/${INSTALLDIR}/locales" -type f -exec chmod 644 '{}' \; - # TODO(https://crbug.com/1077934): The below conditions check for the + # TODO(crbug.com/40688962): The below conditions check for the # existence of files to determine if they should be copied to the staging # directory. However, these may be stale if the build config no longer # builds these files. The build config should be obtained from gn rather than @@ -332,6 +332,8 @@ stage_install_common() { icon_regex=".*product_logo_[0-9]\+_beta\." elif [ "$CHANNEL" = "unstable" ]; then icon_regex=".*product_logo_[0-9]\+_dev\." + elif [ "$CHANNEL" = "canary" ]; then + icon_regex=".*product_logo_[0-9]\+_canary\." fi fi LOGO_RESOURCES_PNG=$(find "${OUTPUTDIR}/installer/theme/" \ diff --git a/src/chrome/installer/linux/debian/build.sh b/src/chrome/installer/linux/debian/build.sh index 188bd365..ad09f0f2 100755 --- a/src/chrome/installer/linux/debian/build.sh +++ b/src/chrome/installer/linux/debian/build.sh @@ -145,7 +145,7 @@ usage() { echo "usage: $(basename $0) [-a target_arch] -c channel -d branding" echo " [-f] [-o 'dir'] -s 'dir' -t target_os" echo "-a arch deb package architecture" - echo "-c channel the package channel (unstable, beta, stable)" + echo "-c channel the package channel (canary, unstable, beta, stable)" echo "-d brand either chromium or google_chrome" echo "-f indicates that this is an official build" echo "-h this help message" @@ -169,6 +169,12 @@ verify_channel() { CHANNEL=unstable RELEASENOTES="https://chromereleases.googleblog.com/search/label/Dev%20updates" ;; + # Canary is released twice a day automatically, so no release notes + # attached. + canary ) + CHANNEL=canary + RELEASENOTES="N/A" + ;; * ) echo echo "ERROR: '$CHANNEL' is not a valid channel type." diff --git a/src/chrome/installer/linux/rpm/build.sh b/src/chrome/installer/linux/rpm/build.sh index caac54ab..ea4538c3 100755 --- a/src/chrome/installer/linux/rpm/build.sh +++ b/src/chrome/installer/linux/rpm/build.sh @@ -132,7 +132,7 @@ usage() { echo "usage: $(basename $0) [-a target_arch] -c channel -d branding" echo " [-f] [-o 'dir'] -t target_os" echo "-a arch rpm package architecture" - echo "-c channel the package channel (unstable, beta, stable)" + echo "-c channel the package channel (canary, unstable, beta, stable)" echo "-d brand either chromium or google_chrome" echo "-f indicates that this is an official build" echo "-h this help message" diff --git a/src/components/download/public/common/download_features.cc b/src/components/download/public/common/download_features.cc index 083cb7b5..3657c3ff 100644 --- a/src/components/download/public/common/download_features.cc +++ b/src/components/download/public/common/download_features.cc @@ -73,12 +73,6 @@ BASE_FEATURE(kDeleteOverwrittenDownloads, BASE_FEATURE(kAllowFileBufferSizeControl, "AllowFileBufferSizeControl", base::FEATURE_ENABLED_BY_DEFAULT); - -#if BUILDFLAG(IS_ANDROID) -BASE_FEATURE(kTransientPdfLinkDownload, - "TransientPdfLinkDownload", - base::FEATURE_DISABLED_BY_DEFAULT); -#endif // BUILDFLAG(IS_ANDROID) } // namespace features } // namespace download diff --git a/src/components/privacy_sandbox/privacy_sandbox_settings_impl.cc b/src/components/privacy_sandbox/privacy_sandbox_settings_impl.cc index c67d1f2f..caab03fd 100644 --- a/src/components/privacy_sandbox/privacy_sandbox_settings_impl.cc +++ b/src/components/privacy_sandbox/privacy_sandbox_settings_impl.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "components/privacy_sandbox/privacy_sandbox_settings_impl.h" + #include #include @@ -24,6 +25,7 @@ #include "components/content_settings/core/browser/cookie_settings.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/pref_names.h" +#include "components/prefs/pref_change_registrar.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" #include "components/privacy_sandbox/canonical_topic.h" @@ -191,6 +193,17 @@ PrivacySandboxSettingsImpl::PrivacySandboxSettingsImpl( PrivacySandboxSettingsImpl::~PrivacySandboxSettingsImpl() = default; +void PrivacySandboxSettingsImpl::Shutdown() { + observers_.Clear(); + delegate_.reset(); + host_content_settings_map_ = nullptr; + cookie_settings_.reset(); + tracking_protection_settings_ = nullptr; + pref_service_ = nullptr; + pref_change_registrar_.Reset(); + tracking_protection_settings_observation_.Reset(); +} + PrivacySandboxSettingsImpl::Status PrivacySandboxSettingsImpl::GetM1TopicAllowedStatus() const { auto control_status = GetM1PrivacySandboxApiEnabledStatus( @@ -617,12 +630,15 @@ bool PrivacySandboxSettingsImpl::IsSharedStorageAllowed( const url::Origin& top_frame_origin, const url::Origin& accessing_origin, std::string* out_debug_message, - content::RenderFrameHost* console_frame) const { + content::RenderFrameHost* console_frame, + bool* out_block_is_site_setting_specific) const { // Check for attestation on the caller's site. Status attestation_status = PrivacySandboxAttestations::GetInstance()->IsSiteAttested( net::SchemefulSite(accessing_origin), PrivacySandboxAttestationsGatedAPI::kSharedStorage); + SetOutBlockIsSiteSettingSpecificFromStatus( + attestation_status, out_block_is_site_setting_specific); if (!IsAllowed(attestation_status)) { JoinHistogram(kIsSharedStorageAllowedHistogram, attestation_status); std::string error_message = @@ -644,9 +660,13 @@ bool PrivacySandboxSettingsImpl::IsSharedStorageAllowed( } Status status = GetPrivacySandboxAllowedStatus(); + SetOutBlockIsSiteSettingSpecificFromStatus( + status, out_block_is_site_setting_specific); if (IsAllowed(status)) { status = GetSiteAccessAllowedStatus(top_frame_origin, accessing_origin.GetURL()); + SetOutBlockIsSiteSettingSpecificFromStatus( + status, out_block_is_site_setting_specific); if (out_debug_message) { *out_debug_message = base::StrCat( {"Site access settings returned status ", @@ -672,8 +692,11 @@ bool PrivacySandboxSettingsImpl::IsSharedStorageAllowed( bool PrivacySandboxSettingsImpl::IsSharedStorageSelectURLAllowed( const url::Origin& top_frame_origin, const url::Origin& accessing_origin, - std::string* out_debug_message) const { + std::string* out_debug_message, + bool* out_block_is_site_setting_specific) const { Status status = GetM1FledgeAllowedStatus(top_frame_origin, accessing_origin); + SetOutBlockIsSiteSettingSpecificFromStatus( + status, out_block_is_site_setting_specific); JoinHistogram(kIsSharedStorageSelectURLAllowedHistogram, status); if (out_debug_message) { *out_debug_message = base::StrCat( @@ -690,12 +713,15 @@ bool PrivacySandboxSettingsImpl::IsSharedStorageSelectURLAllowed( bool PrivacySandboxSettingsImpl::IsPrivateAggregationAllowed( const url::Origin& top_frame_origin, - const url::Origin& reporting_origin) const { + const url::Origin& reporting_origin, + bool* out_block_is_site_setting_specific) const { // Check for attestation on the worklet's site. Status attestation_status = PrivacySandboxAttestations::GetInstance()->IsSiteAttested( net::SchemefulSite(reporting_origin), PrivacySandboxAttestationsGatedAPI::kPrivateAggregation); + SetOutBlockIsSiteSettingSpecificFromStatus( + attestation_status, out_block_is_site_setting_specific); if (!IsAllowed(attestation_status)) { JoinHistogram(kIsPrivateAggregationAllowedHistogram, attestation_status); return false; @@ -703,6 +729,8 @@ bool PrivacySandboxSettingsImpl::IsPrivateAggregationAllowed( Status status = GetM1AdMeasurementAllowedStatus(top_frame_origin, reporting_origin); + SetOutBlockIsSiteSettingSpecificFromStatus( + status, out_block_is_site_setting_specific); JoinHistogram(kIsPrivateAggregationAllowedHistogram, status); return IsAllowed(status); } @@ -710,7 +738,9 @@ bool PrivacySandboxSettingsImpl::IsPrivateAggregationAllowed( bool PrivacySandboxSettingsImpl::IsPrivateAggregationDebugModeAllowed( const url::Origin& top_frame_origin, const url::Origin& reporting_origin) const { - if (!IsPrivateAggregationAllowed(top_frame_origin, reporting_origin)) { + if (!IsPrivateAggregationAllowed( + top_frame_origin, reporting_origin, + /*out_block_is_site_setting_specific=*/nullptr)) { return false; } @@ -756,7 +786,7 @@ bool PrivacySandboxSettingsImpl::IsSubjectToM1NoticeRestricted() const { } bool PrivacySandboxSettingsImpl::IsRestrictedNoticeEnabled() const { - return privacy_sandbox::kPrivacySandboxSettings4RestrictedNotice.Get(); + return delegate_->IsRestrictedNoticeEnabled(); } void PrivacySandboxSettingsImpl::OnCookiesCleared() { @@ -889,4 +919,13 @@ bool PrivacySandboxSettingsImpl::AreRelatedWebsiteSetsEnabled() const { prefs::kPrivacySandboxRelatedWebsiteSetsEnabled); } +void PrivacySandboxSettingsImpl::SetOutBlockIsSiteSettingSpecificFromStatus( + Status status, + bool* out_block_is_site_setting_specific) const { + if (out_block_is_site_setting_specific != nullptr) { + *out_block_is_site_setting_specific = + status == Status::kSiteDataAccessBlocked; + } +} + } // namespace privacy_sandbox diff --git a/src/components/privacy_sandbox/tracking_protection_prefs.cc b/src/components/privacy_sandbox/tracking_protection_prefs.cc index cd447b44..93a3f868 100644 --- a/src/components/privacy_sandbox/tracking_protection_prefs.cc +++ b/src/components/privacy_sandbox/tracking_protection_prefs.cc @@ -66,6 +66,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { registry->RegisterBooleanPref( prefs::kBlockAll3pcToggleEnabled, false, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + registry->RegisterBooleanPref(prefs::kAllowAll3pcToggleEnabled, false); registry->RegisterIntegerPref( prefs::kTrackingProtectionLevel, static_cast(TrackingProtectionLevel::kStandard), @@ -80,17 +81,6 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { registry->RegisterBooleanPref( prefs::kEnableDoNotTrack, true, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); - - // Sentiment Survey - registry->RegisterIntegerPref( - prefs::kTrackingProtectionSentimentSurveyGroup, - static_cast(TrackingProtectionSentimentSurveyGroup::kNotSet)); - - registry->RegisterTimePref(prefs::kTrackingProtectionSentimentSurveyStartTime, - base::Time()); - - registry->RegisterTimePref(prefs::kTrackingProtectionSentimentSurveyEndTime, - base::Time()); } } // namespace privacy_sandbox::tracking_protection diff --git a/src/components/search_engines/prepopulated_engines.json b/src/components/search_engines/prepopulated_engines.json index 29e809dc..ce56e151 100644 --- a/src/components/search_engines/prepopulated_engines.json +++ b/src/components/search_engines/prepopulated_engines.json @@ -29,7 +29,7 @@ // existing data should get a new version. Otherwise, existing data may // continue to be used and updates made here will not always appear. // Also then run tools/search_engine_choice/generate_search_engine_icons.py. - "kCurrentDataVersion": 160 + "kCurrentDataVersion": 163 }, // The following engines are included in country lists and are added to the @@ -128,7 +128,7 @@ "name": "Google", "keyword": "google.com", "favicon_url": "https://www.google.com/images/branding/product/ico/googleg_alldp.ico", - "search_url": "{google:baseURL}search?q={searchTerms}&{google:RLZ}{google:originalQueryForSuggestion}{google:assistedQueryStats}{google:searchFieldtrialParameter}{google:iOSSearchLanguage}{google:prefetchSource}{google:searchClient}{google:sourceId}{google:contextualSearchVersion}ie={inputEncoding}", + "search_url": "{google:baseURL}search?q={searchTerms}&{google:RLZ}{google:originalQueryForSuggestion}{google:assistedQueryStats}{google:searchFieldtrialParameter}{google:language}{google:prefetchSource}{google:searchClient}{google:sourceId}{google:contextualSearchVersion}ie={inputEncoding}", "suggest_url": "{google:baseSuggestURL}search?{google:searchFieldtrialParameter}client={google:suggestClient}&gs_ri={google:suggestRid}&xssi=t&q={searchTerms}&{google:inputType}{google:omniboxFocusType}{google:cursorPosition}{google:currentPageUrl}{google:pageClassification}{google:clientCacheTimeToLive}{google:searchVersion}{google:sessionToken}{google:prefetchQuery}sugkey={google:suggestAPIKeyParameter}", "image_url": "{google:baseSearchByImageURL}upload", "image_translate_url": "{google:baseSearchByImageURL}upload?filtertype=tr&{imageTranslateSourceLocale}{imageTranslateTargetLocale}", @@ -348,7 +348,7 @@ }, "yahoo_au": { - "name": "Yahoo!7", + "name": "Yahoo! Australia", "keyword": "au.yahoo.com", "favicon_url": "https://au.search.yahoo.com/favicon.ico", "search_url": "https://au.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", diff --git a/src/components/search_engines/search_engine_countries-inc.cc b/src/components/search_engines/search_engine_countries-inc.cc index 4e5e6c96..48b8fa10 100644 --- a/src/components/search_engines/search_engine_countries-inc.cc +++ b/src/components/search_engines/search_engine_countries-inc.cc @@ -1281,6 +1281,10 @@ const std::vector GetPrepopulationSetFromCountryID( // Countries using the "Spain" engine set. UNHANDLED_COUNTRY(A, D) // Andorra + UNHANDLED_COUNTRY(E, A) // Ceuta & Melilla (not in ISO 3166-1 but included + // in some Chrome country code lists) + UNHANDLED_COUNTRY(I, C) // Canary Islands (not in ISO 3166-1 but included + // in some Chrome country code lists) END_UNHANDLED_COUNTRIES(E, S) // Countries using the "Finland" engine set. @@ -1290,6 +1294,7 @@ const std::vector GetPrepopulationSetFromCountryID( // Countries using the "France" engine set. UNHANDLED_COUNTRY(B, F) // Burkina Faso UNHANDLED_COUNTRY(B, J) // Benin + UNHANDLED_COUNTRY(B, L) // St. Barthélemy UNHANDLED_COUNTRY(C, D) // Congo - Kinshasa UNHANDLED_COUNTRY(C, F) // Central African Republic UNHANDLED_COUNTRY(C, G) // Congo - Brazzaville @@ -1305,6 +1310,7 @@ const std::vector GetPrepopulationSetFromCountryID( UNHANDLED_COUNTRY(I, P) // Clipperton Island ('IP' is an WinXP-ism; ISO // includes it with France) #endif + UNHANDLED_COUNTRY(M, F) // Saint Martin UNHANDLED_COUNTRY(M, L) // Mali UNHANDLED_COUNTRY(M, Q) // Martinique UNHANDLED_COUNTRY(N, C) // New Caledonia