[AUTO][FILECONTROL] - version 132.0.6834.83

This commit is contained in:
uazo
2025-01-09 03:32:50 +00:00
committed by github-actions[bot]
parent 6398702a0f
commit adcbd3d213
183 changed files with 4895 additions and 4509 deletions
+1 -1
View File
@@ -1 +1 @@
131.0.6778.205
132.0.6834.83
@@ -34,6 +34,7 @@
#include "android_webview/browser/network_service/aw_proxying_restricted_cookie_manager.h"
#include "android_webview/browser/network_service/aw_proxying_url_loader_factory.h"
#include "android_webview/browser/network_service/aw_url_loader_throttle.h"
#include "android_webview/browser/prefetch/aw_prefetch_service_delegate.h"
#include "android_webview/browser/safe_browsing/aw_safe_browsing_navigation_throttle.h"
#include "android_webview/browser/safe_browsing/aw_url_checker_delegate_impl.h"
#include "android_webview/browser/supervised_user/aw_supervised_user_throttle.h"
@@ -94,6 +95,7 @@
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/navigation_throttle.h"
#include "content/public/browser/network_service_instance.h"
#include "content/public/browser/prefetch_service_delegate.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
@@ -587,21 +589,15 @@ void AwContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
content::PosixFileDescriptorInfo* mappings) {
base::MemoryMappedFile::Region region;
int fd = ui::GetMainAndroidPackFd(&region);
if (base::FeatureList::IsEnabled(features::kWebViewCheckPakFileDescriptors)) {
CHECK_GE(fd, 0);
}
CHECK_GE(fd, 0);
mappings->ShareWithRegion(kAndroidWebViewMainPakDescriptor, fd, region);
fd = ui::GetCommonResourcesPackFd(&region);
if (base::FeatureList::IsEnabled(features::kWebViewCheckPakFileDescriptors)) {
CHECK_GE(fd, 0);
}
CHECK_GE(fd, 0);
mappings->ShareWithRegion(kAndroidWebView100PercentPakDescriptor, fd, region);
fd = ui::GetLocalePackFd(&region);
if (base::FeatureList::IsEnabled(features::kWebViewCheckPakFileDescriptors)) {
CHECK_GE(fd, 0);
}
CHECK_GE(fd, 0);
mappings->ShareWithRegion(kAndroidWebViewLocalePakDescriptor, fd, region);
int crash_signal_fd =
@@ -618,8 +614,7 @@ void AwContentBrowserClient::OverrideWebkitPrefs(
if (aw_settings) {
aw_settings->PopulateWebPreferences(web_prefs);
}
web_prefs->modal_context_menu =
!base::FeatureList::IsEnabled(features::kWebViewImageDrag);
web_prefs->modal_context_menu = false;
}
std::vector<std::unique_ptr<content::NavigationThrottle>>
@@ -680,6 +675,14 @@ AwContentBrowserClient::CreateThrottlesForNavigation(
return throttles;
}
std::unique_ptr<content::PrefetchServiceDelegate>
AwContentBrowserClient::CreatePrefetchServiceDelegate(
content::BrowserContext* browser_context) {
AwBrowserContext* aw_browser_context =
static_cast<AwBrowserContext*>(browser_context);
return std::make_unique<AwPrefetchServiceDelegate>(aw_browser_context);
}
std::unique_ptr<content::DevToolsManagerDelegate>
AwContentBrowserClient::CreateDevToolsManagerDelegate() {
return std::make_unique<AwDevToolsManagerDelegate>();
@@ -913,6 +916,8 @@ bool AwContentBrowserClient::HandleExternalProtocol(
content::RenderFrameHost* initiator_document,
const net::IsolationInfo& isolation_info,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Sandbox flags
// =============
//
@@ -947,39 +952,28 @@ bool AwContentBrowserClient::HandleExternalProtocol(
// be schemes unrelated to the regular network stack so it doesn't make sense
// to look for cookies. Providing a nullopt for the cookie manager lets
// the AwProxyingURLLoaderFactory know to skip that work.
if (content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)) {
// Manages its own lifetime.
new android_webview::AwProxyingURLLoaderFactory(
std::nullopt /* cookie_manager */, nullptr /* cookie_access_policy */,
isolation_info, web_contents_key, frame_tree_node_id,
std::move(receiver), mojo::NullRemote(), true /* intercept_only */,
std::nullopt /* security_options */,
nullptr /* xrw_allowlist_matcher */, std::move(browser_context_handle),
std::nullopt /* navigation_id */);
} else {
content::GetIOThreadTaskRunner({})->PostTask(
FROM_HERE,
base::BindOnce(
[](mojo::PendingReceiver<network::mojom::URLLoaderFactory> receiver,
std::optional<WebContentsKey> web_contents_key,
content::FrameTreeNodeId frame_tree_node_id,
scoped_refptr<AwBrowserContextIoThreadHandle>
browser_context_handle,
const net::IsolationInfo& isolation_info) {
// Manages its own lifetime.
new android_webview::AwProxyingURLLoaderFactory(
std::nullopt /* cookie_manager */,
nullptr /* cookie_access_policy */, isolation_info,
web_contents_key, frame_tree_node_id, std::move(receiver),
mojo::NullRemote(), true /* intercept_only */,
std::nullopt /* security_options */,
nullptr /* xrw_allowlist_matcher */,
std::move(browser_context_handle),
std::nullopt /* navigation_id */);
},
std::move(receiver), web_contents_key, frame_tree_node_id,
std::move(browser_context_handle), isolation_info));
}
content::GetIOThreadTaskRunner({})->PostTask(
FROM_HERE,
base::BindOnce(
[](mojo::PendingReceiver<network::mojom::URLLoaderFactory> receiver,
std::optional<WebContentsKey> web_contents_key,
content::FrameTreeNodeId frame_tree_node_id,
scoped_refptr<AwBrowserContextIoThreadHandle>
browser_context_handle,
const net::IsolationInfo& isolation_info) {
// Manages its own lifetime.
new android_webview::AwProxyingURLLoaderFactory(
std::nullopt /* cookie_manager */,
nullptr /* cookie_access_policy */, isolation_info,
web_contents_key, frame_tree_node_id, std::move(receiver),
mojo::NullRemote(), true /* intercept_only */,
std::nullopt /* security_options */,
nullptr /* xrw_allowlist_matcher */,
std::move(browser_context_handle),
std::nullopt /* navigation_id */);
},
std::move(receiver), web_contents_key, frame_tree_node_id,
std::move(browser_context_handle), isolation_info));
return false;
}
@@ -1253,17 +1247,7 @@ blink::UserAgentMetadata AwContentBrowserClient::GetUserAgentMetadata() {
content::ContentBrowserClient::WideColorGamutHeuristic
AwContentBrowserClient::GetWideColorGamutHeuristic() {
if (base::FeatureList::IsEnabled(features::kWebViewWideColorGamutSupport)) {
return WideColorGamutHeuristic::kUseWindow;
}
if (display::HasForceDisplayColorProfile() &&
display::GetForcedDisplayColorProfile() ==
gfx::ColorSpace::CreateDisplayP3D65()) {
return WideColorGamutHeuristic::kUseWindow;
}
return WideColorGamutHeuristic::kNone;
return WideColorGamutHeuristic::kUseWindow;
}
void AwContentBrowserClient::LogWebFeatureForCurrentPage(
@@ -4,7 +4,9 @@
#include "android_webview/browser/aw_field_trials.h"
#include "android_webview/common/aw_features.h"
#include "android_webview/common/aw_switches.h"
#include "base/allocator/partition_alloc_features.h"
#include "base/base_paths_android.h"
#include "base/check.h"
#include "base/feature_list.h"
@@ -263,21 +265,30 @@ void AwFieldTrials::RegisterFeatureOverrides(base::FeatureList* feature_list) {
aw_feature_overrides.EnableFeature(network::features::kMaskedDomainList);
}
// Feature parameters can only be set via a field trial.
// Note: Performing a field trial here means we cannot include
// |kDIPSTtl| in the testing config json.
{
const char kDipsWebViewExperiment[] = "DipsWebViewExperiment";
const char kDipsWebViewGroup[] = "DipsWebViewGroup";
base::FieldTrial* dips_field_trial = base::FieldTrialList::CreateFieldTrial(
kDipsWebViewExperiment, kDipsWebViewGroup);
CHECK(dips_field_trial) << "Unexpected name conflict.";
base::FieldTrialParams params;
const std::string ttl_time_delta_30_days = "30d";
params.emplace(features::kDIPSInteractionTtl.name, ttl_time_delta_30_days);
base::AssociateFieldTrialParams(kDipsWebViewExperiment, kDipsWebViewGroup,
params);
aw_feature_overrides.OverrideFeatureWithFieldTrial(
features::kDIPSTtl,
base::FeatureList::OverrideState::OVERRIDE_ENABLE_FEATURE,
dips_field_trial);
}
// Delete Incidental Party State (DIPS) feature is not yet supported on
// WebView.
// TODO(b/344852824): Enable the feature for WebView
aw_feature_overrides.DisableFeature(::features::kDIPS);
// Async Safe Browsing check will be rolled out together with
// kHashPrefixRealTimeLookups on WebView.
aw_feature_overrides.DisableFeature(
safe_browsing::kSafeBrowsingAsyncRealTimeCheck);
aw_feature_overrides.DisableFeature(
safe_browsing::kHashPrefixRealTimeLookups);
// WebView does not currently support the Permissions API (crbug.com/490120)
aw_feature_overrides.DisableFeature(::features::kWebPermissionsApi);
// TODO(crbug.com/41492947): See crrev.com/c/5744034 for details, but I was
// unable to add this feature to fieldtrial_testing_config and pass all tests.
aw_feature_overrides.EnableFeature(blink::features::kElementGetInnerHTML);
@@ -293,4 +304,9 @@ void AwFieldTrials::RegisterFeatureOverrides(base::FeatureList* feature_list) {
// TODO(crbug.com/336852432): Enable this feature for WebView.
aw_feature_overrides.DisableFeature(
blink::features::kNavigationPredictorNewViewportFeatures);
// This feature is global for the process and thus should not be enabled by
// WebView.
aw_feature_overrides.DisableFeature(
base::features::kPartitionAllocMemoryTagging);
}
@@ -850,21 +850,6 @@ by a child template that "extends" this file.
</intent-filter>
</activity>
<!-- configChanges is set here to prevent the destruction of the
activity after configuration changes. Since the bulk of this
activity's logic is in a feature module, restoring the activity
via a Bundle doesn't work. -->
<activity
android:name="org.chromium.chrome.browser.webauth.authenticator.CableAuthenticatorActivity"
android:configChanges="density|fontScale|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
android:theme="@style/Theme.Chromium.Activity.Fullscreen"
android:label="@string/cablev2_activity_title"
android:permission="com.google.android.gms.auth.cryptauth.permission.CABLEV2_SERVER_LINK"
android:exported="true"
android:excludeFromRecents="true"
android:launchMode="singleTop">
</activity>
<receiver
android:name="org.chromium.chrome.browser.browserservices.ui.trustedwebactivity.DisclosureAcceptanceBroadcastReceiver"
android:exported="false" />
@@ -1101,6 +1086,13 @@ by a child template that "extends" this file.
android:documentLaunchMode="always"
android:noHistory="true"/>
<!-- Activities for task manager. -->
<activity
android:name="org.chromium.chrome.browser.task_manager.TaskManagerActivity"
android:exported="false"
android:theme="@style/Theme.Chromium.Activity">
</activity>
<receiver android:name="org.chromium.chrome.browser.notifications.scheduler.DisplayAgent$Receiver"
android:exported="false"/>
@@ -1183,7 +1175,7 @@ by a child template that "extends" this file.
android:screenOrientation="landscape"
android:label="WebXR"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
tools:ignore="NonResizeableActivity">
tools:ignore="NonResizeableActivity,DiscouragedApi">
<property android:name="android.window.PROPERTY_ACTIVITY_STARTS_IN_IMMERSIVE_XR"
android:value="true" />
<intent-filter>
@@ -42,6 +42,7 @@
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/crash_upload_list/crash_upload_list.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
#include "chrome/browser/dips/chrome_dips_delegate.h"
#include "chrome/browser/dips/dips_service_impl.h"
#include "chrome/browser/dips/dips_utils.h"
#include "chrome/browser/domain_reliability/service_factory.h"
@@ -113,6 +114,7 @@
#include "components/history/core/common/pref_names.h"
#include "components/keyed_service/core/service_access_type.h"
#include "components/language/core/browser/url_language_histogram.h"
#include "components/lens/lens_features.h"
#include "components/media_device_salt/media_device_salt_service.h"
#include "components/nacl/browser/nacl_browser.h"
#include "components/nacl/browser/pnacl_host.h"
@@ -150,6 +152,7 @@
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/browsing_data_filter_builder.h"
#include "content/public/browser/dips_delegate.h"
#include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/origin_trials_controller_delegate.h"
#include "content/public/browser/prefetch_service_delegate.h"
@@ -186,7 +189,7 @@
#if !BUILDFLAG(IS_ANDROID)
#include "chrome/browser/user_annotations/user_annotations_service_factory.h"
#include "chrome/browser/user_education/browser_feature_promo_storage_service.h"
#include "chrome/browser/user_education/browser_user_education_storage_service.h"
#include "chrome/browser/web_applications/web_app.h"
#include "chrome/browser/web_applications/web_app_command_scheduler.h"
#include "chrome/browser/web_applications/web_app_provider.h"
@@ -278,7 +281,8 @@ ChromeBrowsingDataRemoverDelegate::ChromeBrowsingDataRemoverDelegate(
webapp_registry_(std::make_unique<WebappRegistry>())
#endif
,
credential_store_(MakeCredentialStore()) {
credential_store_(MakeCredentialStore()),
dips_delegate_(ChromeDipsDelegate::Create()) {
domain_reliability_clearer_ = base::BindRepeating(
[](BrowserContext* browser_context,
content::BrowsingDataFilterBuilder* filter_builder,
@@ -542,6 +546,17 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
if (optimization_guide_keyed_service)
optimization_guide_keyed_service->ClearData();
#if !BUILDFLAG(IS_ANDROID)
// Remove localStorage data from Lens Overlay UI whenever any history is
// deleted.
if (lens::features::IsLensOverlayTranslateLanguagesFetchEnabled()) {
profile_->GetDefaultStoragePartition()->ClearDataForOrigin(
content::StoragePartition::REMOVE_DATA_MASK_LOCAL_STORAGE,
/*quota_storage_remove_mask=*/0,
GURL(chrome::kChromeUILensOverlayUntrustedURL), base::DoNothing());
}
#endif
content::PrefetchServiceDelegate::ClearData(profile_);
#if BUILDFLAG(IS_ANDROID)
@@ -611,7 +626,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
// Clear any stored User Education session data. Note that we can't clear a
// specific date range, as this is used for longitudinal metrics reporting,
// so selectively deleting entries would make the telemetry invalid.
BrowserFeaturePromoStorageService::ClearUsageHistory(profile_);
BrowserUserEducationStorageService::ClearUsageHistory(profile_);
#endif
// Cleared for DATA_TYPE_HISTORY, DATA_TYPE_COOKIES and DATA_TYPE_PASSWORDS.
@@ -896,9 +911,14 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
DIPSEventRemovalType dips_mask = DIPSEventRemovalType::kNone;
if ((remove_mask & content::BrowsingDataRemover::DATA_TYPE_COOKIES) &&
!filter_builder->PartitionedCookiesOnly()) {
dips_mask |= DIPSEventRemovalType::kStorage;
// If there's no delegate, delete everything whenever the user is deleting
// cookies.
dips_mask |= dips_delegate_ ? DIPSEventRemovalType::kStorage
: DIPSEventRemovalType::kAll;
}
if (remove_mask & constants::DATA_TYPE_HISTORY) {
// If there's a delegate, ask it whether to delete DIPS history.
if (dips_delegate_ &&
dips_delegate_->ShouldDeleteInteractionRecords(remove_mask)) {
dips_mask |= DIPSEventRemovalType::kHistory;
}
@@ -17,13 +17,10 @@
#include "chrome/browser/ash/drive/file_system_util.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/buildflags.h"
#include "chrome/browser/cart/commerce_hint_service.h"
#include "chrome/browser/companion/core/features.h"
#include "chrome/browser/dom_distiller/dom_distiller_service_factory.h"
#include "chrome/browser/history_clusters/history_clusters_service_factory.h"
#include "chrome/browser/media/media_engagement_score_details.mojom.h"
#include "chrome/browser/navigation_predictor/navigation_predictor.h"
#include "chrome/browser/on_device_translation/translation_manager_impl.h"
#include "chrome/browser/optimization_guide/optimization_guide_internals_ui.h"
#include "chrome/browser/password_manager/chrome_password_manager_client.h"
#include "chrome/browser/predictors/lcp_critical_path_predictor/lcp_critical_path_predictor_host.h"
@@ -37,7 +34,8 @@
#include "chrome/browser/translate/translate_frame_binder.h"
#include "chrome/browser/ui/search_engines/search_engine_tab_helper.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/views/side_panel/companion/companion_utils.h"
#include "chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals.mojom.h"
#include "chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals_ui.h"
#include "chrome/browser/ui/webui/browsing_topics/browsing_topics_internals_ui.h"
#include "chrome/browser/ui/webui/data_sharing_internals/data_sharing_internals_ui.h"
#include "chrome/browser/ui/webui/engagement/site_engagement_ui.h"
@@ -59,7 +57,6 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/services/speech/buildflags/buildflags.h"
#include "chromeos/ash/components/boca/boca_role_util.h"
#include "components/browsing_topics/mojom/browsing_topics_internals.mojom.h"
#include "components/commerce/content/browser/commerce_internals_ui.h"
#include "components/commerce/core/internals/mojom/commerce_internals.mojom.h"
@@ -89,6 +86,7 @@
#include "components/security_state/content/content_utils.h"
#include "components/security_state/content/security_state_tab_helper.h"
#include "components/security_state/core/security_state.h"
#include "components/services/on_device_translation/buildflags/buildflags.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/site_engagement/core/mojom/site_engagement_details.mojom.h"
#include "components/translate/content/common/translate.mojom.h"
@@ -110,7 +108,6 @@
#include "third_party/blink/public/mojom/facilitated_payments/payment_link_handler.mojom.h"
#include "third_party/blink/public/mojom/lcp_critical_path_predictor/lcp_critical_path_predictor.mojom.h"
#include "third_party/blink/public/mojom/loader/navigation_predictor.mojom.h"
#include "third_party/blink/public/mojom/on_device_translation/translation_manager.mojom.h"
#include "third_party/blink/public/mojom/payments/payment_credential.mojom.h"
#include "third_party/blink/public/mojom/payments/payment_request.mojom.h"
#include "third_party/blink/public/mojom/prerender/prerender.mojom.h"
@@ -154,7 +151,7 @@
#else
#include "chrome/browser/badging/badge_manager.h"
#include "chrome/browser/cart/chrome_cart.mojom.h"
#include "chrome/browser/new_tab_page/modules/file_suggestion/file_suggestion.mojom.h"
#include "chrome/browser/new_tab_page/modules/file_suggestion/drive_suggestion.mojom.h"
#include "chrome/browser/new_tab_page/modules/v2/calendar/google_calendar.mojom.h"
#include "chrome/browser/new_tab_page/modules/v2/calendar/outlook_calendar.mojom.h"
#include "chrome/browser/new_tab_page/modules/v2/most_relevant_tab_resumption/most_relevant_tab_resumption.mojom.h"
@@ -194,7 +191,6 @@
#include "chrome/browser/ui/webui/search_engine_choice/search_engine_choice_ui.h"
#include "chrome/browser/ui/webui/settings/settings_ui.h"
#include "chrome/browser/ui/webui/side_panel/bookmarks/bookmarks_side_panel_ui.h"
#include "chrome/browser/ui/webui/side_panel/companion/companion_side_panel_untrusted_ui.h"
#include "chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome.mojom.h"
#include "chrome/browser/ui/webui/side_panel/customize_chrome/customize_chrome_ui.h"
#include "chrome/browser/ui/webui/side_panel/customize_chrome/wallpaper_search/wallpaper_search.mojom.h"
@@ -207,11 +203,12 @@
#include "chrome/browser/ui/webui/webui_gallery/webui_gallery_ui.h"
#include "chrome/browser/web_applications/web_install_service_impl.h"
#include "chrome/common/webui_url_constants.h"
#include "components/commerce/core/mojom/product_specifications.mojom.h"
#include "components/commerce/core/mojom/shopping_service.mojom.h" // nogncheck crbug.com/1125897
#include "components/optimization_guide/core/optimization_guide_features.h"
#include "components/page_image_service/mojom/page_image_service.mojom.h"
#include "components/search/ntp_features.h"
#include "ui/webui/resources/cr_components/color_change_listener/color_change_listener.mojom.h"
#include "ui/webui/resources/cr_components/commerce/shopping_service.mojom.h" // nogncheck crbug.com/1125897
#include "ui/webui/resources/cr_components/customize_color_scheme_mode/customize_color_scheme_mode.mojom.h"
#include "ui/webui/resources/cr_components/help_bubble/help_bubble.mojom.h"
#include "ui/webui/resources/cr_components/history_clusters/history_clusters.mojom.h"
@@ -417,20 +414,6 @@
#include "ui/webui/resources/cr_components/app_management/app_management.mojom.h"
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chrome/browser/apps/digital_goods/digital_goods_factory_stub.h"
#include "chrome/browser/apps/digital_goods/digital_goods_lacros.h"
#include "chrome/browser/chromeos/cros_apps/api/cros_apps_api_frame_context.h"
#include "chrome/browser/chromeos/cros_apps/api/cros_apps_api_registry.h"
#include "chrome/browser/lacros/cros_apps/api/diagnostics/cros_diagnostics_impl.h"
#include "chromeos/constants/chromeos_features.h"
#include "chromeos/lacros/lacros_service.h"
#include "third_party/blink/public/mojom/chromeos/diagnostics/cros_diagnostics.mojom.h"
#else
#include "chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals.mojom.h" // nogncheck
#include "chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals_ui.h" // nogncheck
#endif // BUILDFLAG(IS_CHROMEOS_LACROS)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
@@ -455,10 +438,6 @@
#include "chrome/browser/speech/speech_recognition_service.h"
#include "media/mojo/mojom/renderer_extensions.mojom.h"
#include "media/mojo/mojom/speech_recognition.mojom.h" // nogncheck
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chrome/browser/accessibility/live_caption/live_caption_surface.h"
#include "chromeos/crosapi/mojom/speech_recognition.mojom.h"
#endif // BUILDFLAG(IS_CHROMEOS_LACROS)
#endif // BUILDFLAG(ENABLE_SPEECH_SERVICE)
#if BUILDFLAG(IS_WIN)
@@ -494,8 +473,8 @@
#endif
#if BUILDFLAG(IS_CHROMEOS)
#include "chrome/browser/ui/webui/dlp_internals/dlp_internals.mojom.h"
#include "chrome/browser/ui/webui/dlp_internals/dlp_internals_ui.h"
#include "chrome/browser/ui/webui/ash/dlp_internals/dlp_internals.mojom.h"
#include "chrome/browser/ui/webui/ash/dlp_internals/dlp_internals_ui.h"
#endif
#if BUILDFLAG(CHROME_ROOT_STORE_CERT_MANAGEMENT_UI)
@@ -509,6 +488,11 @@
#include "components/signin/public/base/signin_switches.h"
#endif // BUILDFLAG(ENABLE_DICE_SUPPORT)
#if BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION)
#include "chrome/browser/on_device_translation/translation_manager_impl.h"
#include "third_party/blink/public/mojom/on_device_translation/translation_manager.mojom.h"
#endif // BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION)
namespace chrome::internal {
using content::RegisterWebUIControllerInterfaceBinder;
@@ -545,68 +529,6 @@ void BindImageAnnotator(
->BindImageAnnotator(std::move(receiver));
}
void BindCommerceHintObserver(
content::RenderFrameHost* const frame_host,
mojo::PendingReceiver<cart::mojom::CommerceHintObserver> receiver) {
// This is specifically restricting this to main frames, whether they are the
// main frame of the tab, while preventing this from working in subframes and
// fenced frames.
if (frame_host->GetParent() || frame_host->IsFencedFrameRoot()) {
mojo::ReportBadMessage(
"Unexpected the message from subframe or fenced frame.");
return;
}
// Check if features require CommerceHint are enabled.
#if !BUILDFLAG(IS_ANDROID)
if (!IsCartModuleEnabled()) {
return;
}
#else
if (!base::FeatureList::IsEnabled(commerce::kCommerceHintAndroid)) {
return;
}
#endif
// On Android, commerce hint observer is enabled for all users with the feature
// enabled since the observer is only used for collecting metrics for now, and
// we want to maximize the user population exposed; on Desktop, ChromeCart is
// not available for non-signin single-profile users and therefore neither does
// commerce hint observer.
#if !BUILDFLAG(IS_ANDROID)
Profile* profile = Profile::FromBrowserContext(
frame_host->GetProcess()->GetBrowserContext());
auto* identity_manager = IdentityManagerFactory::GetForProfile(profile);
ProfileManager* profile_manager = g_browser_process->profile_manager();
if (!identity_manager || !profile_manager) {
return;
}
if (!identity_manager->HasPrimaryAccount(signin::ConsentLevel::kSignin) &&
profile_manager->GetNumberOfProfiles() <= 1) {
return;
}
#endif
auto* web_contents = content::WebContents::FromRenderFrameHost(frame_host);
if (!web_contents) {
return;
}
content::BrowserContext* browser_context = web_contents->GetBrowserContext();
if (!browser_context) {
return;
}
if (browser_context->IsOffTheRecord()) {
return;
}
cart::CommerceHintService::CreateForWebContents(web_contents);
cart::CommerceHintService* service =
cart::CommerceHintService::FromWebContents(web_contents);
if (!service) {
return;
}
service->BindCommerceHintObserver(frame_host, std::move(receiver));
}
void BindDistillabilityService(
content::RenderFrameHost* const frame_host,
mojo::PendingReceiver<dom_distiller::mojom::DistillabilityService>
@@ -653,9 +575,9 @@ void BindDistillerJavaScriptService(
std::move(receiver));
}
void BindPrerenderCanceler(
void BindNoStatePrefetchCanceler(
content::RenderFrameHost* frame_host,
mojo::PendingReceiver<prerender::mojom::PrerenderCanceler> receiver) {
mojo::PendingReceiver<prerender::mojom::NoStatePrefetchCanceler> receiver) {
auto* web_contents = content::WebContents::FromRenderFrameHost(frame_host);
if (!web_contents) {
return;
@@ -667,7 +589,8 @@ void BindPrerenderCanceler(
if (!no_state_prefetch_contents) {
return;
}
no_state_prefetch_contents->AddPrerenderCancelerReceiver(std::move(receiver));
no_state_prefetch_contents->AddNoStatePrefetchCancelerReceiver(
std::move(receiver));
}
void BindNoStatePrefetchProcessor(
@@ -738,15 +661,7 @@ void BindSpeechRecognitionContextHandler(
return;
}
#if BUILDFLAG(IS_CHROMEOS_LACROS)
// On LaCrOS, forward to Ash.
auto* service = chromeos::LacrosService::Get();
if (service && service->IsAvailable<crosapi::mojom::SpeechRecognition>()) {
service->GetRemote<crosapi::mojom::SpeechRecognition>()
->BindSpeechRecognitionContext(std::move(receiver));
}
#else
// On other platforms (Ash, desktop), bind via the appropriate factory.
// Bind via the appropriate factory.
Profile* profile = Profile::FromBrowserContext(
frame_host->GetProcess()->GetBrowserContext());
#if BUILDFLAG(ENABLE_BROWSER_SPEECH_SERVICE)
@@ -757,7 +672,6 @@ void BindSpeechRecognitionContextHandler(
#error "No speech recognition service factory on this platform."
#endif
factory->BindSpeechRecognitionContext(std::move(receiver));
#endif // BUILDFLAG(IS_CHROMEOS_LACROS)
}
void BindSpeechRecognitionClientBrowserInterfaceHandler(
@@ -765,20 +679,11 @@ void BindSpeechRecognitionClientBrowserInterfaceHandler(
mojo::PendingReceiver<media::mojom::SpeechRecognitionClientBrowserInterface>
receiver) {
if (captions::IsLiveCaptionFeatureSupported()) {
#if BUILDFLAG(IS_CHROMEOS_LACROS)
// On LaCrOS, forward to Ash.
auto* service = chromeos::LacrosService::Get();
if (service && service->IsAvailable<crosapi::mojom::SpeechRecognition>()) {
service->GetRemote<crosapi::mojom::SpeechRecognition>()
->BindSpeechRecognitionClientBrowserInterface(std::move(receiver));
}
#else
// On other platforms (Ash, desktop), bind in this process.
// Bind in this process.
Profile* profile = Profile::FromBrowserContext(
frame_host->GetProcess()->GetBrowserContext());
SpeechRecognitionClientBrowserInterfaceFactory::GetForProfile(profile)
->BindReceiver(std::move(receiver));
#endif // BUILDFLAG(IS_CHROMEOS_LACROS)
}
}
@@ -786,40 +691,6 @@ void BindSpeechRecognitionRecognizerClientHandler(
content::RenderFrameHost* frame_host,
mojo::PendingReceiver<media::mojom::SpeechRecognitionRecognizerClient>
client_receiver) {
#if BUILDFLAG(IS_CHROMEOS_LACROS)
// On LaCrOS, forward to Ash.
// Hold a client-browser interface just long enough to bootstrap a remote
// recognizer client.
mojo::Remote<media::mojom::SpeechRecognitionClientBrowserInterface>
interface_remote;
auto* service = chromeos::LacrosService::Get();
if (!service || !service->IsAvailable<crosapi::mojom::SpeechRecognition>()) {
return;
}
service->GetRemote<crosapi::mojom::SpeechRecognition>()
->BindSpeechRecognitionClientBrowserInterface(
interface_remote.BindNewPipeAndPassReceiver());
// Grab the per-web-contents logic on our end to drive the remote client.
auto* surface = captions::LiveCaptionSurface::GetOrCreateForWebContents(
content::WebContents::FromRenderFrameHost(frame_host));
mojo::PendingRemote<media::mojom::SpeechRecognitionSurface> surface_remote;
mojo::PendingReceiver<media::mojom::SpeechRecognitionSurfaceClient>
surface_client_receiver;
surface->BindToSurfaceClient(
surface_remote.InitWithNewPipeAndPassReceiver(),
surface_client_receiver.InitWithNewPipeAndPassRemote());
// Populate static info to send to the client.
auto metadata = media::mojom::SpeechRecognitionSurfaceMetadata::New();
metadata->session_id = surface->session_id();
// Bootstrap the recognizer client.
interface_remote->BindRecognizerToRemoteClient(
std::move(client_receiver), std::move(surface_client_receiver),
std::move(surface_remote), std::move(metadata));
#else
Profile* profile = Profile::FromBrowserContext(
frame_host->GetProcess()->GetBrowserContext());
PrefService* profile_prefs = profile->GetPrefs();
@@ -828,7 +699,6 @@ void BindSpeechRecognitionRecognizerClientHandler(
captions::LiveCaptionSpeechRecognitionHost::Create(
frame_host, std::move(client_receiver));
}
#endif
}
#if BUILDFLAG(IS_WIN)
@@ -886,69 +756,12 @@ void BindScreen2xMainContentExtractor(
}
#endif
#if BUILDFLAG(IS_CHROMEOS_LACROS)
// A helper class to register ChromeOS Apps API binders. This includes the logic
// that checks that the feature is allowed on Profile before registering a
// binder, and wraps the binder with per-frame feature enablement checks before
// binding the Mojo pipe.
class CrosAppsApiFrameBinderMap {
STACK_ALLOCATED();
public:
CrosAppsApiFrameBinderMap(
content::RenderFrameHost* rfh,
mojo::BinderMapWithContext<content::RenderFrameHost*>& map)
: api_registry_(CrosAppsApiRegistry::GetInstance(
Profile::FromBrowserContext(rfh->GetBrowserContext()))),
map_(map) {}
~CrosAppsApiFrameBinderMap() = default;
// If `api_feature` is enabled (e.g. base::Feature is enabled), and it can be
// enabled on the profile, registers a binder that performs context dependent
// checks (e.g. whether the frame's last committed URL is in the allowlist)
// before calling `binder_func`.
template <typename Interface,
auto binder_func,
blink::mojom::RuntimeFeature api_feature>
void MaybeAdd() {
if (!api_registry_->CanEnableApi(api_feature)) {
return;
}
map_->template Add<Interface>(
base::BindRepeating([](content::RenderFrameHost* rfh,
mojo::PendingReceiver<Interface> receiver) {
auto* profile = Profile::FromBrowserContext(rfh->GetBrowserContext());
const auto& api_registry = CrosAppsApiRegistry::GetInstance(profile);
if (!api_registry.IsApiEnabledForFrame(
api_feature, CrosAppsApiFrameContext(*rfh))) {
mojo::ReportBadMessage(base::StringPrintf(
"The requesting context isn't allowed to access interface %s "
"because it isn't allowed to access the corresponding API: %s",
Interface::Name_, base::ToString(api_feature).c_str()));
return;
}
binder_func(rfh, std::move(receiver));
}));
}
private:
const raw_ref<const CrosAppsApiRegistry> api_registry_;
raw_ref<mojo::BinderMapWithContext<content::RenderFrameHost*>> map_;
};
#endif
void PopulateChromeFrameBinders(
mojo::BinderMapWithContext<content::RenderFrameHost*>* map,
content::RenderFrameHost* render_frame_host) {
map->Add<image_annotation::mojom::Annotator>(
base::BindRepeating(&BindImageAnnotator));
map->Add<cart::mojom::CommerceHintObserver>(
base::BindRepeating(&BindCommerceHintObserver));
map->Add<blink::mojom::AnchorElementMetricsHost>(
base::BindRepeating(&NavigationPredictor::Create));
@@ -961,8 +774,8 @@ void PopulateChromeFrameBinders(
map->Add<dom_distiller::mojom::DistillerJavaScriptService>(
base::BindRepeating(&BindDistillerJavaScriptService));
map->Add<prerender::mojom::PrerenderCanceler>(
base::BindRepeating(&BindPrerenderCanceler));
map->Add<prerender::mojom::NoStatePrefetchCanceler>(
base::BindRepeating(&BindNoStatePrefetchCanceler));
map->Add<blink::mojom::NoStatePrefetchProcessor>(
base::BindRepeating(&BindNoStatePrefetchProcessor));
@@ -1027,24 +840,6 @@ void PopulateChromeFrameBinders(
&apps::DigitalGoodsFactoryImpl::BindDigitalGoodsFactory));
#endif
#if BUILDFLAG(IS_CHROMEOS_LACROS)
if (web_app::IsWebAppsCrosapiEnabled()) {
map->Add<payments::mojom::DigitalGoodsFactory>(
base::BindRepeating(&apps::DigitalGoodsFactoryLacros::Bind));
} else {
map->Add<payments::mojom::DigitalGoodsFactory>(
base::BindRepeating(&apps::DigitalGoodsFactoryStub::Bind));
}
if (chromeos::features::IsBlinkExtensionEnabled()) {
// Add frame binders for ChromeOS Apps APIs here using `binder_map_wrapper`.
CrosAppsApiFrameBinderMap binder_map_wrapper(render_frame_host, *map);
binder_map_wrapper
.MaybeAdd<blink::mojom::CrosDiagnostics, &CrosDiagnosticsImpl::Create,
blink::mojom::RuntimeFeature::kBlinkExtensionDiagnostics>();
}
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
if (base::FeatureList::IsEnabled(features::kWebShare)) {
map->Add<blink::mojom::ShareService>(
@@ -1088,10 +883,8 @@ void PopulateChromeFrameBinders(
base::BindRepeating(&web_app::SubAppsServiceImpl::CreateIfAllowed));
}
if (features::IsPdfOcrEnabled()) {
map->Add<screen_ai::mojom::ScreenAIAnnotator>(
base::BindRepeating(&BindScreenAIAnnotator));
}
map->Add<screen_ai::mojom::ScreenAIAnnotator>(
base::BindRepeating(&BindScreenAIAnnotator));
if (features::IsReadAnythingWithScreen2xEnabled()) {
map->Add<screen_ai::mojom::Screen2xMainContentExtractor>(
@@ -1109,10 +902,12 @@ void PopulateChromeFrameBinders(
base::BindRepeating(&printing::CreateWebPrintingServiceForFrame));
#endif
#if BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION)
if (base::FeatureList::IsEnabled(blink::features::kEnableTranslationAPI)) {
map->Add<blink::mojom::TranslationManager>(
base::BindRepeating(&TranslationManagerImpl::Create));
map->Add<blink::mojom::TranslationManager>(base::BindRepeating(
&on_device_translation::TranslationManagerImpl::Create));
}
#endif
#if BUILDFLAG(IS_ANDROID)
if (base::FeatureList::IsEnabled(blink::features::kPaymentLinkDetection)) {
@@ -1125,10 +920,8 @@ void PopulateChromeFrameBinders(
void PopulateChromeWebUIFrameBinders(
mojo::BinderMapWithContext<content::RenderFrameHost*>* map,
content::RenderFrameHost* render_frame_host) {
#if !BUILDFLAG(IS_CHROMEOS_LACROS)
RegisterWebUIControllerInterfaceBinder<::mojom::BluetoothInternalsHandler,
BluetoothInternalsUI>(map);
#endif
RegisterWebUIControllerInterfaceBinder<
media::mojom::MediaEngagementScoreDetailsProvider, MediaEngagementUI>(
@@ -1252,19 +1045,13 @@ void PopulateChromeWebUIFrameBinders(
render_frame_host->GetProcess()->GetBrowserContext());
if (history_clusters_service &&
history_clusters_service->is_journeys_feature_flag_enabled()) {
if (base::FeatureList::IsEnabled(history_clusters::kSidePanelJourneys)) {
RegisterWebUIControllerInterfaceBinder<
history_clusters::mojom::PageHandler, HistoryUI,
HistoryClustersSidePanelUI>(map);
} else {
RegisterWebUIControllerInterfaceBinder<
history_clusters::mojom::PageHandler, HistoryUI>(map);
}
RegisterWebUIControllerInterfaceBinder<history_clusters::mojom::PageHandler,
HistoryUI,
HistoryClustersSidePanelUI>(map);
}
if (history_embeddings::IsHistoryEmbeddingsEnabled()) {
if (history_clusters_service &&
history_clusters_service->is_journeys_feature_flag_enabled() &&
base::FeatureList::IsEnabled(history_clusters::kSidePanelJourneys)) {
history_clusters_service->is_journeys_feature_flag_enabled()) {
RegisterWebUIControllerInterfaceBinder<
history_embeddings::mojom::PageHandler, HistoryUI,
HistoryClustersSidePanelUI>(map);
@@ -1334,7 +1121,7 @@ void PopulateChromeWebUIFrameBinders(
if (IsDriveModuleEnabled()) {
RegisterWebUIControllerInterfaceBinder<
file_suggestion::mojom::FileSuggestionHandler, NewTabPageUI>(map);
file_suggestion::mojom::DriveSuggestionHandler, NewTabPageUI>(map);
}
if (base::FeatureList::IsEnabled(
@@ -1373,6 +1160,11 @@ void PopulateChromeWebUIFrameBinders(
BookmarksSidePanelUI, commerce::ProductSpecificationsUI,
ShoppingInsightsSidePanelUI, HistoryUI>(map);
RegisterWebUIControllerInterfaceBinder<
commerce::product_specifications::mojom::
ProductSpecificationsHandlerFactory,
commerce::ProductSpecificationsUI, HistoryUI>(map);
RegisterWebUIControllerInterfaceBinder<
side_panel::mojom::CustomizeChromePageHandlerFactory, CustomizeChromeUI>(
map);
@@ -1735,6 +1527,9 @@ void PopulateChromeWebUIFrameBinders(
ash::firmware_update::mojom::UpdateProvider, ash::FirmwareUpdateAppUI>(
map);
RegisterWebUIControllerInterfaceBinder<
ash::firmware_update::mojom::SystemUtils, ash::FirmwareUpdateAppUI>(map);
if (ash::features::IsDriveFsMirroringEnabled()) {
RegisterWebUIControllerInterfaceBinder<
ash::manage_mirrorsync::mojom::PageHandlerFactory,
@@ -1953,11 +1748,9 @@ void PopulateChromeWebUIFrameInterfaceBrokers(
// --- Section 2: chrome-untrusted:// WebUIs:
#if BUILDFLAG(IS_CHROMEOS_ASH)
if (ash::boca_util::IsEnabled()) {
registry.ForWebUI<ash::boca::BocaUI>()
.Add<ash::boca::mojom::BocaPageHandlerFactory>()
.Add<color_change_listener::mojom::PageHandler>();
}
registry.ForWebUI<ash::boca::BocaUI>()
.Add<ash::boca::mojom::BocaPageHandlerFactory>()
.Add<color_change_listener::mojom::PageHandler>();
if (chromeos::features::IsOrcaEnabled() ||
ash::features::IsLobsterEnabled()) {
@@ -1981,7 +1774,7 @@ void PopulateChromeWebUIFrameInterfaceBrokers(
registry.ForWebUI<ash::MediaAppGuestUI>()
.Add<color_change_listener::mojom::PageHandler>()
.Add<ash::media_app_ui::mojom::UntrustedPageHandlerFactory>();
.Add<ash::media_app_ui::mojom::UntrustedServiceFactory>();
registry.ForWebUI<ash::HelpAppUntrustedUI>()
.Add<color_change_listener::mojom::PageHandler>();
@@ -2001,6 +1794,7 @@ void PopulateChromeWebUIFrameInterfaceBrokers(
if (lens::features::IsLensOverlayEnabled()) {
registry.ForWebUI<lens::LensSidePanelUntrustedUI>()
.Add<lens::mojom::LensSidePanelPageHandlerFactory>()
.Add<lens::mojom::LensGhostLoaderPageHandlerFactory>()
.Add<searchbox::mojom::PageHandler>()
.Add<help_bubble::mojom::HelpBubbleHandlerFactory>()
.Add<color_change_listener::mojom::PageHandler>();
@@ -2008,6 +1802,7 @@ void PopulateChromeWebUIFrameInterfaceBrokers(
if (lens::features::IsLensOverlayEnabled()) {
registry.ForWebUI<lens::LensOverlayUntrustedUI>()
.Add<lens::mojom::LensPageHandlerFactory>()
.Add<lens::mojom::LensGhostLoaderPageHandlerFactory>()
.Add<color_change_listener::mojom::PageHandler>()
.Add<help_bubble::mojom::HelpBubbleHandlerFactory>()
.Add<searchbox::mojom::PageHandler>();
@@ -2018,10 +1813,6 @@ void PopulateChromeWebUIFrameInterfaceBrokers(
.Add<searchbox::mojom::PageHandler>()
.Add<color_change_listener::mojom::PageHandler>();
}
if (companion::IsCompanionFeatureEnabled()) {
registry.ForWebUI<CompanionSidePanelUntrustedUI>()
.Add<side_panel::mojom::CompanionPageHandlerFactory>();
}
registry.ForWebUI<ReadAnythingUntrustedUI>()
.Add<color_change_listener::mojom::PageHandler>();
if (base::FeatureList::IsEnabled(features::kHaTSWebUI)) {
@@ -108,7 +108,6 @@
#include "chrome/browser/net/profile_network_context_service.h"
#include "chrome/browser/net/profile_network_context_service_factory.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/on_device_translation/service_controller.h"
#include "chrome/browser/optimization_guide/chrome_browser_main_extra_parts_optimization_guide.h"
#include "chrome/browser/payments/payment_request_display_manager_factory.h"
#include "chrome/browser/performance_manager/public/chrome_browser_main_extra_parts_performance_manager.h"
@@ -264,7 +263,7 @@
#include "components/lens/buildflags.h"
#include "components/live_caption/caption_util.h"
#include "components/media_device_salt/media_device_salt_service.h"
#include "components/media_router/browser/presentation/presentation_service_delegate_impl.h"
#include "components/media_router/browser/presentation/controller_presentation_service_delegate_impl.h"
#include "components/media_router/browser/presentation/receiver_presentation_service_delegate_impl.h"
#include "components/media_router/browser/presentation/web_contents_presentation_manager.h"
#include "components/metrics/client_info.h"
@@ -282,7 +281,6 @@
#include "components/payments/content/payment_request_display_manager.h"
#include "components/pdf/common/pdf_util.h"
#include "components/performance_manager/embedder/performance_manager_registry.h"
#include "components/performance_manager/public/scenarios/performance_scenarios.h"
#include "components/permissions/permission_context_base.h"
#include "components/policy/content/policy_blocklist_navigation_throttle.h"
#include "components/policy/content/policy_blocklist_service.h"
@@ -292,7 +290,6 @@
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/privacy_sandbox/privacy_sandbox_attestations/privacy_sandbox_attestations.h"
#include "components/privacy_sandbox/privacy_sandbox_features.h"
#include "components/privacy_sandbox/privacy_sandbox_prefs.h"
#include "components/privacy_sandbox/privacy_sandbox_settings.h"
@@ -314,6 +311,7 @@
#include "components/security_interstitials/content/ssl_error_handler.h"
#include "components/security_interstitials/content/ssl_error_navigation_throttle.h"
#include "components/security_state/core/security_state.h"
#include "components/services/on_device_translation/buildflags/buildflags.h"
#include "components/site_isolation/pref_names.h"
#include "components/site_isolation/preloaded_isolated_origins.h"
#include "components/site_isolation/site_isolation_policy.h"
@@ -361,6 +359,7 @@
#include "content/public/browser/web_contents_view_delegate.h"
#include "content/public/browser/web_ui_url_loader_factory.h"
#include "content/public/browser/webui_config_map.h"
#include "content/public/common/buildflags.h"
#include "content/public/common/content_descriptors.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
@@ -487,7 +486,6 @@
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/webui/ash/kerberos/kerberos_in_browser_dialog.h"
#include "chrome/common/webui_url_constants.h"
#include "chromeos/ash/components/boca/boca_role_util.h"
#include "chromeos/ash/components/browser_context_helper/browser_context_types.h"
#include "chromeos/ash/components/http_auth_dialog/http_auth_dialog.h"
#include "chromeos/ash/components/settings/cros_settings.h"
@@ -646,8 +644,6 @@
// BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(TOOLKIT_VIEWS)
#include "chrome/browser/ui/side_search/side_search_side_contents_helper.h"
#include "chrome/browser/ui/side_search/side_search_utils.h"
#include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h"
#endif
@@ -809,6 +805,11 @@
#include "components/feed/feed_feature_list.h"
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION)
#include "chrome/browser/on_device_translation/component_manager.h"
#include "chrome/browser/on_device_translation/pref_names.h"
#endif // BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION)
using blink::mojom::EffectiveConnectionType;
using blink::web_pref::WebPreferences;
using content::BrowserThread;
@@ -840,22 +841,14 @@ using web_apps::ChromeContentBrowserClientIsolatedWebAppsPart;
namespace {
#if BUILDFLAG(IS_ANDROID)
// Kill switch that allows falling back to the legacy behavior on Android when
// it comes to site isolation for Gaia's origin (|GaiaUrls::gaia_origin()|).
BASE_FEATURE(kAllowGaiaOriginIsolationOnAndroid,
"AllowGaiaOriginIsolationOnAndroid",
base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE(kPrivateNetworkAccessRestrictionsForAutomotive,
"PrivateNetworkAccessRestrictionsForAutomotive",
base::FEATURE_ENABLED_BY_DEFAULT);
#endif // BUILDFLAG(IS_ANDROID)
BASE_FEATURE(kSkipPagehideInCommitForDSENavigation,
"SkipPagehideInCommitForDSENavigation",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kDisableJavascriptOptimizerByDefault,
"DisableJavascriptOptimizerByDefault",
base::FEATURE_DISABLED_BY_DEFAULT);
// A small ChromeBrowserMainExtraParts that invokes a callback when threads are
// ready. Used to initialize ChromeContentBrowserClient data that needs the UI
// thread.
@@ -1007,7 +1000,7 @@ blink::mojom::AutoplayPolicy GetAutoplayPolicyForWebContents(
switches::autoplay::kDocumentUserActivationRequiredPolicy) {
result = blink::mojom::AutoplayPolicy::kDocumentUserActivationRequired;
} else {
NOTREACHED_IN_MIGRATION();
NOTREACHED();
}
#if !BUILDFLAG(IS_ANDROID)
@@ -1099,12 +1092,14 @@ bool IsExtensionIdAllowedToUseIsolatedContext(std::string_view extension_id) {
#endif // BUILDFLAG(ENABLE_EXTENSIONS_CORE)
mojo::PendingRemote<prerender::mojom::PrerenderCanceler> GetPrerenderCanceler(
mojo::PendingRemote<prerender::mojom::NoStatePrefetchCanceler>
GetNoStatePrefetchCanceler(
base::OnceCallback<content::WebContents*()> wc_getter) {
mojo::PendingRemote<prerender::mojom::PrerenderCanceler> canceler;
mojo::PendingRemote<prerender::mojom::NoStatePrefetchCanceler> canceler;
prerender::ChromeNoStatePrefetchContentsDelegate::FromWebContents(
std::move(wc_getter).Run())
->AddPrerenderCancelerReceiver(canceler.InitWithNewPipeAndPassReceiver());
->AddNoStatePrefetchCancelerReceiver(
canceler.InitWithNewPipeAndPassReceiver());
return canceler;
}
@@ -1571,6 +1566,9 @@ void ChromeContentBrowserClient::RegisterLocalStatePrefs(
true);
#if BUILDFLAG(IS_CHROMEOS)
registry->RegisterBooleanPref(prefs::kNativeClientForceAllowed, false);
registry->RegisterBooleanPref(prefs::kDeviceNativeClientForceAllowed, false);
registry->RegisterBooleanPref(prefs::kDeviceNativeClientForceAllowedCache,
false);
#endif // BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID)
registry->RegisterBooleanPref(prefs::kOutOfProcessSystemDnsResolutionEnabled,
@@ -1598,19 +1596,24 @@ void ChromeContentBrowserClient::RegisterProfilePrefs(
#if !BUILDFLAG(IS_ANDROID)
registry->RegisterBooleanPref(prefs::kAutoplayAllowed, false);
registry->RegisterListPref(prefs::kAutoplayAllowlist);
registry->RegisterListPref(
prefs::kScreenCaptureWithoutGestureAllowedForOrigins);
registry->RegisterListPref(
prefs::kFileOrDirectoryPickerWithoutGestureAllowedForOrigins);
registry->RegisterIntegerPref(prefs::kFetchKeepaliveDurationOnShutdown, 0);
registry->RegisterBooleanPref(
prefs::kSharedArrayBufferUnrestrictedAccessAllowed, false);
#endif
#if BUILDFLAG(ENABLE_SCREEN_CAPTURE)
registry->RegisterListPref(
prefs::kScreenCaptureWithoutGestureAllowedForOrigins);
#endif
registry->RegisterBooleanPref(prefs::kSandboxExternalProtocolBlocked, true);
registry->RegisterBooleanPref(prefs::kSSLErrorOverrideAllowed, true);
registry->RegisterListPref(prefs::kSSLErrorOverrideAllowedForOrigins);
registry->RegisterBooleanPref(prefs::kCompressionDictionaryTransportEnabled,
true);
#if BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION)
registry->RegisterBooleanPref(prefs::kTranslatorAPIAllowed, true);
#endif
registry->RegisterBooleanPref(
prefs::kSuppressDifferentOriginSubframeJSDialogs, true);
#if BUILDFLAG(IS_ANDROID)
@@ -1668,6 +1671,7 @@ void ChromeContentBrowserClient::RegisterProfilePrefs(
#endif
registry->RegisterBooleanPref(prefs::kWebAudioOutputBufferingEnabled, false);
registry->RegisterBooleanPref(prefs::kSharedWorkerBlobURLFixEnabled, true);
}
// static
@@ -2299,8 +2303,12 @@ ChromeContentBrowserClient::DetermineAddressSpaceFromURL(const GURL& url) {
return network::mojom::IPAddressSpace::kUnknown;
}
bool ChromeContentBrowserClient::LogWebUIUrl(const GURL& web_ui_url) {
return webui::LogWebUIUrl(web_ui_url);
bool ChromeContentBrowserClient::LogWebUICreated(const GURL& web_ui_url) {
return webui::LogWebUICreated(web_ui_url);
}
bool ChromeContentBrowserClient::LogWebUIShown(const GURL& web_ui_url) {
return webui::LogWebUIShown(web_ui_url);
}
bool ChromeContentBrowserClient::IsWebUIAllowedToMakeNetworkRequests(
@@ -2943,10 +2951,6 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
webauthn::pref_names::kRemoteProxiedRequestsAllowed)) {
command_line->AppendSwitch(switches::kWebAuthRemoteDesktopSupport);
}
if (IsCartModuleEnabled()) {
command_line->AppendSwitch(commerce::switches::kEnableChromeCart);
}
#endif
}
@@ -3268,6 +3272,13 @@ bool ChromeContentBrowserClient::AllowCompressionDictionaryTransport(
prefs::kCompressionDictionaryTransportEnabled);
}
bool ChromeContentBrowserClient::AllowSharedWorkerBlobURLFix(
content::BrowserContext* browser_context) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
Profile* profile = Profile::FromBrowserContext(browser_context);
return profile->GetPrefs()->GetBoolean(prefs::kSharedWorkerBlobURLFixEnabled);
}
void ChromeContentBrowserClient::RequestFilesAccess(
const std::vector<base::FilePath>& files,
const GURL& destination_url,
@@ -3430,12 +3441,12 @@ std::string ChromeContentBrowserClient::GetWebBluetoothBlocklist() {
}
bool ChromeContentBrowserClient::IsInterestGroupAPIAllowed(
content::BrowserContext* browser_context,
content::RenderFrameHost* render_frame_host,
InterestGroupApiOperation operation,
const url::Origin& top_frame_origin,
const url::Origin& api_origin) {
Profile* profile =
Profile::FromBrowserContext(render_frame_host->GetBrowserContext());
Profile* profile = Profile::FromBrowserContext(browser_context);
auto* privacy_sandbox_settings =
PrivacySandboxSettingsFactory::GetForProfile(profile);
DCHECK(privacy_sandbox_settings);
@@ -3641,6 +3652,25 @@ bool ChromeContentBrowserClient::IsSharedStorageSelectURLAllowed(
out_block_is_site_setting_specific);
}
bool ChromeContentBrowserClient::IsFencedStorageReadAllowed(
content::BrowserContext* browser_context,
content::RenderFrameHost* rfh,
const url::Origin& top_frame_origin,
const url::Origin& accessing_origin) {
Profile* profile = Profile::FromBrowserContext(browser_context);
auto* privacy_sandbox_settings =
PrivacySandboxSettingsFactory::GetForProfile(profile);
DCHECK(privacy_sandbox_settings);
bool allowed = privacy_sandbox_settings->IsFencedStorageReadAllowed(
top_frame_origin, accessing_origin, rfh);
if (rfh) {
content_settings::PageSpecificContentSettings::BrowsingDataAccessed(
rfh, blink::StorageKey::CreateFirstParty(accessing_origin),
BrowsingDataModel::StorageType::kSharedStorage, !allowed);
}
return allowed;
}
bool ChromeContentBrowserClient::IsPrivateAggregationAllowed(
content::BrowserContext* browser_context,
const url::Origin& top_frame_origin,
@@ -3762,8 +3792,7 @@ void ChromeContentBrowserClient::OnTrustAnchorUsed(
policy::PolicyCertServiceFactory::GetForProfile(
Profile::FromBrowserContext(browser_context));
if (!service) {
NOTREACHED_IN_MIGRATION();
return;
NOTREACHED();
}
service->SetUsedPolicyCertificates();
}
@@ -4040,8 +4069,7 @@ bool UpdatePreferredColorScheme(WebPreferences* web_prefs,
bool CanPromptWithNonmatchingCertificates(const Profile* profile) {
#if BUILDFLAG(IS_CHROMEOS_ASH)
if (ash::ProfileHelper::IsSigninProfile(profile) ||
ash::ProfileHelper::IsLockScreenProfile(profile) ||
ash::ProfileHelper::IsLockScreenAppProfile(profile)) {
ash::ProfileHelper::IsLockScreenProfile(profile)) {
// On non-regular profiles (e.g. sign-in profile or lock-screen profile),
// never show certificate selection to the user. A client certificate is an
// identifier that can be stable for a long time, so only the administrator
@@ -5067,9 +5095,6 @@ std::wstring ChromeContentBrowserClient::GetAppContainerSidForSandboxType(
case sandbox::mojom::Sandbox::kPrintCompositor:
case sandbox::mojom::Sandbox::kAudio:
case sandbox::mojom::Sandbox::kScreenAI:
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
case sandbox::mojom::Sandbox::kVideoEffects:
#endif
case sandbox::mojom::Sandbox::kSpeechRecognition:
case sandbox::mojom::Sandbox::kPdfConversion:
case sandbox::mojom::Sandbox::kService:
@@ -5158,9 +5183,6 @@ bool ChromeContentBrowserClient::PreSpawnChild(
break;
case sandbox::mojom::Sandbox::kUtility:
case sandbox::mojom::Sandbox::kGpu:
#if BUILDFLAG(ENABLE_PPAPI)
case sandbox::mojom::Sandbox::kPpapi:
#endif
case sandbox::mojom::Sandbox::kNoSandbox:
case sandbox::mojom::Sandbox::kNoSandboxAndElevatedPrivileges:
case sandbox::mojom::Sandbox::kXrCompositing:
@@ -5169,12 +5191,7 @@ bool ChromeContentBrowserClient::PreSpawnChild(
case sandbox::mojom::Sandbox::kPrintBackend:
#endif
case sandbox::mojom::Sandbox::kPrintCompositor:
#if !BUILDFLAG(IS_ANDROID)
case sandbox::mojom::Sandbox::kScreenAI:
#endif
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
case sandbox::mojom::Sandbox::kVideoEffects:
#endif
case sandbox::mojom::Sandbox::kAudio:
case sandbox::mojom::Sandbox::kOnDeviceModelExecution:
case sandbox::mojom::Sandbox::kSpeechRecognition:
@@ -5204,7 +5221,7 @@ bool ChromeContentBrowserClient::PreSpawnChild(
// Allow loading Chrome's DLLs.
for (const auto* dll : {chrome::kBrowserResourcesDll, chrome::kElfDll}) {
result = config->AllowExtraDlls(GetModulePath(dll).value().c_str());
result = config->AllowExtraDll(GetModulePath(dll).value().c_str());
if (result != sandbox::SBOX_ALL_OK)
return false;
}
@@ -5298,7 +5315,7 @@ content::ControllerPresentationServiceDelegate*
ChromeContentBrowserClient::GetControllerPresentationServiceDelegate(
content::WebContents* web_contents) {
if (media_router::MediaRouterEnabled(web_contents->GetBrowserContext())) {
return media_router::PresentationServiceDelegateImpl::
return media_router::ControllerPresentationServiceDelegateImpl::
GetOrCreateForWebContents(web_contents);
}
return nullptr;
@@ -5338,18 +5355,6 @@ void ChromeContentBrowserClient::RemovePresentationObserver(
}
}
bool ChromeContentBrowserClient::AddPrivacySandboxAttestationsObserver(
content::PrivacySandboxAttestationsObserver* observer) {
return privacy_sandbox::PrivacySandboxAttestations::GetInstance()
->AddObserver(observer);
}
void ChromeContentBrowserClient::RemovePrivacySandboxAttestationsObserver(
content::PrivacySandboxAttestationsObserver* observer) {
privacy_sandbox::PrivacySandboxAttestations::GetInstance()->RemoveObserver(
observer);
}
std::vector<std::unique_ptr<content::NavigationThrottle>>
ChromeContentBrowserClient::CreateThrottlesForNavigation(
content::NavigationHandle* handle) {
@@ -5597,12 +5602,12 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
MaybeAddThrottle(
chromeos::KioskSettingsNavigationThrottle::MaybeCreateThrottleFor(handle),
&throttles);
if (ash::boca_util::IsEnabled()) {
MaybeAddThrottle(
ash::OnTaskLockedSessionNavigationThrottle::MaybeCreateThrottleFor(
handle),
&throttles);
}
MaybeAddThrottle(
ash::OnTaskLockedSessionNavigationThrottle::MaybeCreateThrottleFor(
handle),
&throttles);
#endif
#if BUILDFLAG(IS_MAC)
@@ -5642,14 +5647,6 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
handle),
&throttles);
#if defined(TOOLKIT_VIEWS)
if (profile && IsSideSearchEnabled(profile)) {
MaybeAddThrottle(
SideSearchSideContentsHelper::MaybeCreateThrottleFor(handle),
&throttles);
}
#endif
#if BUILDFLAG(ENABLE_LENS_DESKTOP_GOOGLE_BRANDED_FEATURES)
if (lens::features::IsLensSidePanelEnabled()) {
MaybeAddThrottle(
@@ -6006,7 +6003,8 @@ ChromeContentBrowserClient::MaybeCreateSafeBrowsingURLLoaderThrottle(
profile->IsOffTheRecord(), profile->GetPrefs(),
safe_browsing::hash_realtime_utils::GetCountryCode(
g_browser_process->variations_service()),
/*log_usage_histograms=*/true);
/*log_usage_histograms=*/true,
/*are_background_lookups_allowed=*/true);
safe_browsing::AsyncCheckTracker* async_check_tracker =
GetAsyncCheckTracker(wc_getter, is_enterprise_lookup_enabled,
is_consumer_lookup_enabled,
@@ -6149,7 +6147,7 @@ ChromeContentBrowserClient::CreateURLLoaderThrottles(
chrome_navigation_ui_data->is_no_state_prefetching()) {
result.push_back(
std::make_unique<prerender::NoStatePrefetchURLLoaderThrottle>(
GetPrerenderCanceler(wc_getter)));
GetNoStatePrefetchCanceler(wc_getter)));
}
#if BUILDFLAG(IS_ANDROID)
@@ -6971,9 +6969,7 @@ bool ChromeContentBrowserClient::ShouldForceDownloadResource(
Profile* profile = Profile::FromBrowserContext(browser_context);
bool force_download = profile->GetPrefs()->GetBoolean(
quickoffice::kQuickOfficeForceFileDownloadEnabled);
if (base::FeatureList::IsEnabled(features::kQuickOfficeForceFileDownload) &&
force_download) {
if (force_download) {
std::string extension_id =
PluginUtils::GetExtensionIdForMimeType(browser_context, mime_type);
@@ -7996,9 +7992,7 @@ ChromeContentBrowserClient::ShouldOverridePrivateNetworkRequestPolicy(
}
#if BUILDFLAG(IS_ANDROID)
if (base::FeatureList::IsEnabled(
kPrivateNetworkAccessRestrictionsForAutomotive) &&
base::android::BuildInfo::GetInstance()->is_automotive()) {
if (base::android::BuildInfo::GetInstance()->is_automotive()) {
return content::ContentBrowserClient::PrivateNetworkRequestPolicyOverride::
kBlockInsteadOfWarn;
}
@@ -8038,6 +8032,12 @@ bool ChromeContentBrowserClient::IsJitDisabledForSite(
bool ChromeContentBrowserClient::AreV8OptimizationsDisabledForSite(
content::BrowserContext* browser_context,
const GURL& site_url) {
// Only disable optimizations for schemes that might atually load web content.
auto* policy = ChildProcessSecurityPolicy::GetInstance();
if (!site_url.is_empty() && !policy->IsWebSafeScheme(site_url.scheme())) {
return false;
}
Profile* profile = Profile::FromBrowserContext(browser_context);
auto* map = HostContentSettingsMapFactory::GetForProfile(profile);
// Special case to determine if any policy is set.
@@ -8047,10 +8047,12 @@ bool ChromeContentBrowserClient::AreV8OptimizationsDisabledForSite(
CONTENT_SETTING_BLOCK;
}
// Only disable optimizations for schemes that might atually load web content.
auto* policy = ChildProcessSecurityPolicy::GetInstance();
if (!policy->IsWebSafeScheme(site_url.scheme())) {
return false;
// Activate experiment only for users who haven't explicitly disabled v8
// optimization by default so that most of the users in the "experiment
// off" branch have v8 optimization enabled.
if (base::FeatureList::GetInstance()->IsEnabled(
kDisableJavascriptOptimizerByDefault)) {
return true;
}
return (map &&
@@ -8148,7 +8150,8 @@ bool ChromeContentBrowserClient::SetupEmbedderSandboxParameters(
screen_ai_binary_path.value());
} else if (sandbox_type == sandbox::mojom::Sandbox::kOnDeviceTranslation) {
auto translatekit_binary_path =
OnDeviceTranslationServiceController::GetTranslateKitComponentPath();
on_device_translation::ComponentManager::GetInstance()
.GetTranslateKitComponentPath();
if (translatekit_binary_path.empty()) {
VLOG(1) << "TranslationKit component not found.";
return false;
@@ -8497,11 +8500,11 @@ bool ChromeContentBrowserClient::
#if BUILDFLAG(IS_MAC)
std::string ChromeContentBrowserClient::GetChildProcessSuffix(int child_flags) {
if (child_flags == chrome::kChildProcessHelperAlerts) {
if (child_flags ==
base::to_underlying(ChildProcessHostFlags::kChildProcessHelperAlerts)) {
return chrome::kMacHelperSuffixAlerts;
}
NOTREACHED_IN_MIGRATION() << "Unsupported child process flags!";
return {};
NOTREACHED() << "Unsupported child process flags!";
}
#endif // BUILDFLAG(IS_MAC)
@@ -8533,11 +8536,6 @@ bool ChromeContentBrowserClient::DoesGaiaOriginRequireDedicatedProcess() {
// improve security generally and specifically it allows the exposure of
// certain optional privileged APIs.
// Kill switch that falls back to the legacy behavior.
if (!base::FeatureList::IsEnabled(kAllowGaiaOriginIsolationOnAndroid)) {
return false;
}
if (site_isolation::SiteIsolationPolicy::
ShouldDisableSiteIsolationDueToMemoryThreshold(
content::SiteIsolationMode::kPartialSiteIsolation)) {
@@ -8721,11 +8719,11 @@ bool ChromeContentBrowserClient::ShouldSuppressAXLoadComplete(
void ChromeContentBrowserClient::BindAIManager(
content::BrowserContext* browser_context,
std::variant<content::RenderFrameHost*, base::SupportsUserData*> context,
base::SupportsUserData* context_user_data,
mojo::PendingReceiver<blink::mojom::AIManager> receiver) {
auto* ai_manager =
AIManagerKeyedServiceFactory::GetAIManagerKeyedService(browser_context);
ai_manager->AddReceiver(std::move(receiver), context);
ai_manager->AddReceiver(std::move(receiver), *context_user_data);
}
#if !BUILDFLAG(IS_ANDROID)
@@ -8859,17 +8857,6 @@ void ChromeContentBrowserClient::SetSamplingProfiler(
sampling_profiler_ = std::move(sampling_profiler);
}
base::ReadOnlySharedMemoryRegion
ChromeContentBrowserClient::GetPerformanceScenarioRegionForProcess(
content::RenderProcessHost* process_host) {
return performance_manager::GetSharedScenarioRegionForProcess(process_host);
}
base::ReadOnlySharedMemoryRegion
ChromeContentBrowserClient::GetGlobalPerformanceScenarioRegion() {
return performance_manager::GetGlobalSharedScenarioRegion();
}
bool ChromeContentBrowserClient::ShouldDispatchPagehideDuringCommit(
content::BrowserContext* browser_context,
const GURL& destination_url) {
@@ -23,7 +23,7 @@
#include "chrome/browser/accessibility/prefers_default_scrollbar_styles_prefs.h"
#include "chrome/browser/browser_process_impl.h"
#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/chromeos/enterprise/cloud_storage/policy_utils.h"
#include "chrome/browser/chromeos/enterprise/cloud_storage/pref_utils.h"
#include "chrome/browser/chromeos/upload_office_to_cloud/upload_office_to_cloud.h"
#include "chrome/browser/component_updater/component_updater_prefs.h"
#include "chrome/browser/devtools/devtools_window.h"
@@ -72,7 +72,6 @@
#include "chrome/browser/search/search.h"
#include "chrome/browser/sharing_hub/sharing_hub_features.h"
#include "chrome/browser/ssl/ssl_config_service_manager.h"
#include "chrome/browser/task_manager/task_manager_interface.h"
#include "chrome/browser/tracing/chrome_tracing_delegate.h"
#include "chrome/browser/ui/browser_ui_prefs.h"
#include "chrome/browser/ui/hats/hats_service_desktop.h"
@@ -82,14 +81,9 @@
#include "chrome/browser/ui/safety_hub/safety_hub_prefs.h"
#include "chrome/browser/ui/search_engines/keyword_editor_controller.h"
#include "chrome/browser/ui/send_tab_to_self/send_tab_to_self_bubble.h"
#include "chrome/browser/ui/tabs/organization/prefs.h"
#include "chrome/browser/ui/tabs/pinned_tab_codec.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_pref_names.h"
#include "chrome/browser/ui/tabs/tab_strip_prefs.h"
#include "chrome/browser/ui/toolbar/chrome_labs/chrome_labs_prefs.h"
#include "chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.h"
#include "chrome/browser/ui/toolbar/toolbar_pref_names.h"
#include "chrome/browser/ui/views/side_panel/side_panel_prefs.h"
#include "chrome/browser/ui/webui/accessibility/accessibility_ui.h"
#include "chrome/browser/ui/webui/bookmarks/bookmark_prefs.h"
#include "chrome/browser/ui/webui/flags/flags_ui.h"
@@ -98,6 +92,7 @@
#include "chrome/browser/ui/webui/print_preview/policy_settings.h"
#include "components/plus_addresses/plus_address_prefs.h"
#include "components/privacy_sandbox/tpcd_pref_names.h"
#include "components/services/on_device_translation/buildflags/buildflags.h"
#include "components/sharing_message/sharing_sync_preference.h"
#include "components/signin/core/browser/active_primary_accounts_metrics_recorder.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
@@ -105,7 +100,7 @@
#include "chrome/browser/ui/webui/settings/reset_settings_handler.h"
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/updates/announcement_notification/announcement_notification_service.h"
#include "chrome/browser/user_education/browser_feature_promo_storage_service.h"
#include "chrome/browser/user_education/browser_user_education_storage_service.h"
#include "chrome/browser/webauthn/chrome_authenticator_request_delegate.h"
#include "chrome/browser/webauthn/webauthn_pref_names.h"
#include "chrome/common/buildflags.h"
@@ -127,6 +122,7 @@
#include "components/enterprise/buildflags/buildflags.h"
#include "components/enterprise/connectors/core/connectors_prefs.h"
#include "components/fingerprinting_protection_filter/common/fingerprinting_protection_filter_constants.h"
#include "components/fingerprinting_protection_filter/common/prefs.h"
#include "components/flags_ui/pref_service_flags_storage.h"
#include "components/history_clusters/core/history_clusters_prefs.h"
#include "components/image_fetcher/core/cache/image_cache.h"
@@ -207,6 +203,7 @@
#endif
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
#include "extensions/browser/api/runtime/runtime_api.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/permissions_manager.h"
#include "extensions/browser/pref_names.h"
@@ -223,7 +220,6 @@
#include "chrome/browser/ui/extensions/settings_api_bubble_helpers.h"
#include "chrome/browser/ui/webui/extensions/extensions_ui.h"
#include "extensions/browser/api/audio/audio_api.h"
#include "extensions/browser/api/runtime/runtime_api.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ash/device_name/device_name_store.h"
#include "chrome/browser/ash/extensions/extensions_permissions_tracker.h"
@@ -273,7 +269,6 @@
#include "components/webapps/browser/android/install_prompt_prefs.h"
#else // BUILDFLAG(IS_ANDROID)
#include "chrome/browser/cart/cart_service.h"
#include "chrome/browser/companion/core/promo_handler.h"
#include "chrome/browser/device_api/device_service_impl.h"
#include "chrome/browser/gcm/gcm_product_util.h"
#include "chrome/browser/hid/hid_policy_allowed_devices.h"
@@ -286,7 +281,6 @@
#include "chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler.h"
#include "chrome/browser/new_tab_page/modules/v2/most_relevant_tab_resumption/most_relevant_tab_resumption_page_handler.h"
#include "chrome/browser/new_tab_page/promos/promo_service.h"
#include "chrome/browser/on_device_translation/pref_names.h"
#include "chrome/browser/policy/developer_tools_policy_handler.h"
#include "chrome/browser/promos/promos_utils.h"
#include "chrome/browser/screen_ai/pref_names.h"
@@ -294,9 +288,16 @@
#include "chrome/browser/search_engine_choice/search_engine_choice_dialog_service.h"
#include "chrome/browser/serial/serial_policy_allowed_ports.h"
#include "chrome/browser/signin/signin_promo.h"
#include "chrome/browser/task_manager/task_manager_interface.h"
#include "chrome/browser/themes/theme_syncable_service.h"
#include "chrome/browser/ui/commerce/commerce_ui_tab_helper.h"
#include "chrome/browser/ui/startup/startup_browser_creator.h"
#include "chrome/browser/ui/tabs/organization/prefs.h"
#include "chrome/browser/ui/tabs/pinned_tab_codec.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_pref_names.h"
#include "chrome/browser/ui/tabs/tab_strip_prefs.h"
#include "chrome/browser/ui/views/side_panel/side_panel_prefs.h"
#include "chrome/browser/ui/webui/certificate_manager/certificate_manager_handler.h"
#include "chrome/browser/ui/webui/cr_components/theme_color_picker/theme_color_picker_handler.h"
#include "chrome/browser/ui/webui/history/foreign_session_handler.h"
#include "chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.h"
@@ -318,13 +319,13 @@
#endif
#if BUILDFLAG(IS_CHROMEOS)
#include "chrome/browser/chromeos/extensions/echo_private/echo_private_api.h"
#include "chrome/browser/chromeos/extensions/echo_private/echo_private_api_util.h"
#include "chrome/browser/chromeos/extensions/login_screen/login/login_api_prefs.h"
#include "chrome/browser/chromeos/policy/dlp/dlp_rules_manager_impl.h"
#include "chrome/browser/chromeos/quickoffice/quickoffice_prefs.h"
#include "chrome/browser/chromeos/reporting/metric_reporting_prefs.h"
#include "chrome/browser/extensions/api/document_scan/document_scan_api_handler.h"
#include "chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.h"
#include "chrome/browser/extensions/api/document_scan/profile_prefs_registry_util.h"
#include "chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_registry_util.h"
#include "chrome/browser/memory/oom_kills_monitor.h"
#include "chrome/browser/policy/annotations/blocklist_handler.h"
#include "chrome/browser/policy/networking/policy_cert_service.h"
@@ -366,7 +367,6 @@
#include "chrome/browser/ash/child_accounts/screen_time_controller.h"
#include "chrome/browser/ash/child_accounts/time_limits/app_activity_registry.h"
#include "chrome/browser/ash/child_accounts/time_limits/app_time_controller.h"
#include "chrome/browser/ash/crosapi/browser_util.h"
#include "chrome/browser/ash/crostini/crostini_pref_names.h"
#include "chrome/browser/ash/cryptauth/client_app_metadata_provider_service.h"
#include "chrome/browser/ash/cryptauth/cryptauth_device_id_provider_impl.h"
@@ -379,9 +379,6 @@
#include "chrome/browser/ash/guest_os/guest_id.h"
#include "chrome/browser/ash/guest_os/guest_os_pref_names.h"
#include "chrome/browser/ash/guest_os/guest_os_terminal.h"
#include "chrome/browser/ash/lock_screen_apps/state_controller.h"
#include "chrome/browser/ash/login/demo_mode/demo_session.h"
#include "chrome/browser/ash/login/demo_mode/demo_setup_controller.h"
#include "chrome/browser/ash/login/quick_unlock/fingerprint_storage.h"
#include "chrome/browser/ash/login/quick_unlock/pin_storage_prefs.h"
#include "chrome/browser/ash/login/quick_unlock/quick_unlock_utils.h"
@@ -438,6 +435,7 @@
#include "chrome/browser/upgrade_detector/upgrade_detector_chromeos.h"
#include "chromeos/ash/components/audio/audio_devices_pref_handler_impl.h"
#include "chromeos/ash/components/boca/on_task/on_task_prefs.h"
#include "chromeos/ash/components/demo_mode/utils/demo_session_utils.h"
#include "chromeos/ash/components/local_search_service/search_metrics_reporter.h"
#include "chromeos/ash/components/network/cellular_esim_profile_handler_impl.h"
#include "chromeos/ash/components/network/cellular_metrics_logger.h"
@@ -447,7 +445,6 @@
#include "chromeos/ash/components/network/proxy/proxy_config_handler.h"
#include "chromeos/ash/components/policy/restriction_schedule/device_restriction_schedule_controller.h"
#include "chromeos/ash/components/report/report_controller.h"
#include "chromeos/ash/components/standalone_browser/migrator_util.h"
#include "chromeos/ash/components/timezone/timezone_resolver.h"
#include "chromeos/ash/services/assistant/public/cpp/assistant_prefs.h"
#include "chromeos/ash/services/auth_factor_config/auth_factor_config.h"
@@ -457,7 +454,7 @@
#include "chromeos/ash/services/multidevice_setup/multidevice_setup_service.h"
#include "chromeos/components/quick_answers/public/cpp/quick_answers_prefs.h"
#include "components/account_manager_core/chromeos/account_manager.h"
#include "components/onc/onc_pref_names.h"
#include "components/onc/onc_pref_names.h" // nogncheck
#include "components/quirks/quirks_manager.h"
#include "components/user_manager/user_manager_impl.h"
#include "extensions/browser/api/lock_screen_data/lock_screen_item_storage.h"
@@ -484,7 +481,7 @@
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
#include "chrome/browser/enterprise/platform_auth/platform_auth_policy_observer.h"
#include "components/os_crypt/sync/os_crypt.h"
#include "components/os_crypt/sync/os_crypt.h" // nogncheck
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
@@ -542,6 +539,10 @@
#include "chrome/browser/ash/wallpaper_handlers/wallpaper_prefs.h"
#endif
#if BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION)
#include "chrome/browser/on_device_translation/pref_names.h"
#endif // BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION)
#if BUILDFLAG(ENTERPRISE_DATA_CONTROLS)
#include "components/enterprise/data_controls/core/browser/prefs.h"
#endif
@@ -551,93 +552,8 @@ namespace {
// Please keep the list of deprecated prefs in chronological order. i.e. Add to
// the bottom of the list, not here at the top.
// Deprecated 09/2023.
const char kPrivacySandboxM1Unrestricted[] = "privacy_sandbox.m1.unrestricted";
#if BUILDFLAG(IS_WIN)
const char kSwReporter[] = "software_reporter";
const char kChromeCleaner[] = "chrome_cleaner";
const char kSettingsResetPrompt[] = "settings_reset_prompt";
#endif
// A boolean specifying whether the new download bubble UI is enabled. If it is
// set to false, the old download shelf UI will be shown instead.
const char kDownloadBubbleEnabled[] = "download_bubble_enabled";
// Deprecated 09/2023.
#if BUILDFLAG(IS_CHROMEOS_ASH)
const char kGestureEducationNotificationShown[] =
"ash.gesture_education.notification_shown";
// Note that this very name is used outside ChromeOS Ash, where it isn't
// deprecated.
const char kSyncInitialSyncFeatureSetupCompleteOnAsh[] =
"sync.has_setup_completed";
#endif
// Deprecated 09/2023.
const char kPrivacySandboxManuallyControlled[] =
"privacy_sandbox.manually_controlled";
// Deprecated 09/2023.
#if BUILDFLAG(IS_ANDROID)
const char kSettingsMigratedToUPM[] = "profile.settings_migrated_to_upm";
#endif
// Deprecated 10/2023.
const char kSyncRequested[] = "sync.requested";
const char kDownloadLastCompleteTime[] = "download.last_complete_time";
// Deprecated 10/2023.
#if BUILDFLAG(IS_CHROMEOS_ASH)
const char kLastSuccessfulDomainPref[] = "android_sms.last_successful_domain";
const char kShouldAttemptReenable[] = "android_sms.should_attempt_reenable";
const char kAudioVolumePercent[] = "settings.audio.volume_percent";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 10/2023.
#if BUILDFLAG(IS_CHROMEOS)
const char kSupportedLinksAppPrefsKey[] = "supported_links_infobar.apps";
#endif // BUILDFLAG(IS_CHROMEOS)
// Deprecated 10/2023.
#if BUILDFLAG(IS_CHROMEOS_ASH)
constexpr char kNightLightCachedLatitude[] = "ash.night_light.cached_latitude";
constexpr char kNightLightCachedLongitude[] =
"ash.night_light.cached_longitude";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 11/2023.
#if BUILDFLAG(IS_CHROMEOS_ASH)
constexpr char kUserGeolocationAllowed[] = "ash.user.geolocation_allowed";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 11/2023.
const char kPrivacySandboxAntiAbuseInitialized[] =
"privacy_sandbox.anti_abuse_initialized";
// Deprecated 11/2023.
constexpr char kWebRTCAllowLegacyTLSProtocols[] =
"webrtc.allow_legacy_tls_protocols";
// Deprecated 11/2023.
#if BUILDFLAG(IS_CHROMEOS_ASH)
constexpr char kSystemTrayExpanded[] = "ash.system_tray.expanded";
#endif
// Deprecated 11/2023.
constexpr char kPasswordChangeSuccessTrackerFlows[] =
"password_manager.password_change_success_tracker.flows";
constexpr char kPasswordChangeSuccessTrackerVersion[] =
"password_manager.password_change_success_tracker.version";
// Deprecated 11/2023.
#if BUILDFLAG(IS_CHROMEOS_ASH)
constexpr char kImageSearchPrivacyNotice[] =
"ash.launcher.image_search_privacy_notice";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 11/2023.
constexpr char kWebAndAppActivityEnabledForShopping[] =
"web_and_app_activity_enabled_for_shopping";
// Deprecated 12/2023.
#if BUILDFLAG(IS_ANDROID)
@@ -1100,6 +1016,10 @@ const char kTabResumeDismissedTabsPrefName[] =
"NewTabPage.MostRelevantTabResumption.DismissedTabs";
#endif // !BUILDFLAG(IS_ANDROID)
// Deprecated 10/2024.
constexpr char kLiveCaptionBubblePinned[] =
"accessibility.captions.live_caption_bubble_pinned";
// Deprecated 10/2024.
#if BUILDFLAG(IS_CHROMEOS)
const char kMigrationStep[] = "ash.browser_data_migrator.migration_step";
@@ -1109,6 +1029,22 @@ const char kMoveMigrationResumeCountPref[] =
"ash.browser_data_migrator.move_migration_resume_count";
const char kLacrosSecondaryProfilesAllowed[] =
"lacros_secondary_profiles_allowed";
constexpr char kDataVerPref[] = "lacros.data_version";
constexpr char kMigrationAttemptCountPref[] =
"ash.browser_data_migrator.migration_attempt_count";
constexpr char kProfileMigrationCompletedForUserPref[] =
"lacros.profile_migration_completed_for_user";
constexpr char kProfileMoveMigrationCompletedForUserPref[] =
"lacros.profile_move_migration_completed_for_user";
constexpr char kProfileMigrationCompletedForNewUserPref[] =
"lacros.profile_migration_completed_for_new_user";
const char kProfileDataBackwardMigrationCompletedForUserPref[] =
"lacros.profile_data_backward_migration_completed_for_user";
const char kGotoFilesPref[] = "lacros.goto_files";
const char kProfileMigrationCompletionTimeForUserPref[] =
"lacros.profile_migration_completion_time_for_user";
const char kLacrosDataBackwardMigrationMode[] =
"lacros_data_backward_migration_mode";
#endif
#if !BUILDFLAG(IS_ANDROID)
@@ -1130,21 +1066,63 @@ inline constexpr char kAccessibilityFaceGazeCursorSmoothing[] =
const char kBeforeunloadEventCancelByPreventDefaultEnabled[] =
"policy.beforeunload_event_cancel_by_prevent_default_enabled";
// Deprecated 10/2024.
inline constexpr char kDocumentSuggestEnabled[] = "documentsuggest.enabled";
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 10/2024
inline constexpr char kWallpaperSeaPenMigrationStatus[] =
"ash.wallpaper.sea_pen.migration_status";
#endif
// Deprecated 10/2024
inline constexpr char kFirstTimeInterstitialBannerState[] =
"profile.managed.banner_state";
// Deprecated 10/2024
inline constexpr char kSidePanelCompanionEntryPinnedToToolbar[] =
"side_panel.companion_pinned_to_toolbar";
inline constexpr char kMsbbPromoDeclinedCountPref[] =
"Companion.Promo.MSBB.Declined.Count";
inline constexpr char kSigninPromoDeclinedCountPref[] =
"Companion.Promo.Signin.Declined.Count";
inline constexpr char kExpsPromoDeclinedCountPref[] =
"Companion.Promo.Exps.Declined.Count";
inline constexpr char kExpsPromoShownCountPref[] =
"Companion.Promo.Exps.Shown.Count";
inline constexpr char kPcoPromoShownCountPref[] =
"Companion.Promo.PCO.Shown.Count";
inline constexpr char kPcoPromoDeclinedCountPref[] =
"Companion.Promo.PCO.Declined.Count";
inline constexpr char kExpsOptInStatusGrantedPref[] =
"Companion.Exps.OptIn.Status.Granted";
inline constexpr char kHasNavigatedToExpsSuccessPage[] =
"Companion.HasNavigatedToExpsSuccessPage";
// Deprecated 11/2024.
#if BUILDFLAG(IS_CHROMEOS)
constexpr char kNoteTakingAppEnabledOnLockScreen[] =
"settings.note_taking_app_enabled_on_lock_screen";
constexpr char kNoteTakingAppsLockScreenAllowlist[] =
"settings.note_taking_apps_lock_screen_whitelist";
constexpr char kNoteTakingAppsLockScreenToastShown[] =
"settings.note_taking_apps_lock_screen_toast_shown";
constexpr char kRestoreLastLockScreenNote[] =
"settings.restore_last_lock_screen_note";
#endif
// Deprecated 11/2024
constexpr char kPrefixedVideoFullscreenApiAvailability[] =
"media.prefixed_fullscreen_video_api_availability";
// Deprecated 11/2024
constexpr char kOnDeviceModelTimeoutCount[] =
"optimization_guide.on_device.timeout_count";
// Register local state used only for migration (clearing or moving to a new
// key).
void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
// Deprecated 09/2023.
#if BUILDFLAG(IS_WIN)
registry->RegisterDictionaryPref(kSwReporter);
registry->RegisterDictionaryPref(kChromeCleaner);
#endif
// Deprecated 09/2023.
#if BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterBooleanPref(kGestureEducationNotificationShown, true);
#endif
// Deprecated 11/2023.
// Deprecated 12/2023.
#if BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterBooleanPref(kIsolatedWebAppsEnabled, false);
#endif
@@ -1230,6 +1208,16 @@ void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
registry->RegisterIntegerPref(kMigrationStep, 0);
registry->RegisterDictionaryPref(kMoveMigrationResumeStepPref);
registry->RegisterDictionaryPref(kMoveMigrationResumeCountPref);
registry->RegisterDictionaryPref(kDataVerPref);
registry->RegisterDictionaryPref(kMigrationAttemptCountPref);
registry->RegisterDictionaryPref(kProfileMigrationCompletedForUserPref);
registry->RegisterDictionaryPref(kProfileMoveMigrationCompletedForUserPref);
registry->RegisterDictionaryPref(kProfileMigrationCompletedForNewUserPref);
registry->RegisterDictionaryPref(
kProfileDataBackwardMigrationCompletedForUserPref);
registry->RegisterListPref(kGotoFilesPref);
registry->RegisterDictionaryPref(kProfileMigrationCompletionTimeForUserPref);
registry->RegisterStringPref(kLacrosDataBackwardMigrationMode, "");
#endif
#if !BUILDFLAG(IS_ANDROID)
@@ -1240,77 +1228,17 @@ void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
// Deprecated 10/2024.
registry->RegisterBooleanPref(kBeforeunloadEventCancelByPreventDefaultEnabled,
true);
// Deprecated 11/2024.
registry->RegisterIntegerPref(kOnDeviceModelTimeoutCount, 0);
}
// Register prefs used only for migration (clearing or moving to a new key).
void RegisterProfilePrefsForMigration(
user_prefs::PrefRegistrySyncable* registry) {
chrome_browser_net::secure_dns::RegisterProbesSettingBackupPref(registry);
// Deprecated 09/2023.
registry->RegisterBooleanPref(kPrivacySandboxM1Unrestricted, false);
#if BUILDFLAG(IS_WIN)
registry->RegisterDictionaryPref(kSwReporter);
registry->RegisterDictionaryPref(kSettingsResetPrompt);
registry->RegisterDictionaryPref(kChromeCleaner);
#endif
registry->RegisterBooleanPref(kDownloadBubbleEnabled, true);
registry->RegisterBooleanPref(kPrivacySandboxManuallyControlled, false);
#if BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterBooleanPref(kSyncInitialSyncFeatureSetupCompleteOnAsh,
false);
#endif
#if BUILDFLAG(IS_ANDROID)
registry->RegisterBooleanPref(kSettingsMigratedToUPM, false);
#endif
registry->RegisterBooleanPref(kSyncRequested, false);
// Deprecated 10/2023.
#if BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterStringPref(kLastSuccessfulDomainPref, std::string());
registry->RegisterBooleanPref(kShouldAttemptReenable, true);
registry->RegisterDoublePref(kAudioVolumePercent, 0);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterTimePref(kDownloadLastCompleteTime, base::Time());
// Deprecated 10/2023.
#if BUILDFLAG(IS_CHROMEOS)
registry->RegisterDictionaryPref(kSupportedLinksAppPrefsKey);
#endif // BUILDFLAG(IS_CHROMEOS)
// Deprecated 10/2023.
#if BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterDoublePref(kNightLightCachedLatitude, 0.0);
registry->RegisterDoublePref(kNightLightCachedLongitude, 0.0);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 11/2023.
registry->RegisterBooleanPref(kPrivacySandboxAntiAbuseInitialized, false);
// Deprecated 11/2023.
registry->RegisterBooleanPref(kWebRTCAllowLegacyTLSProtocols, false);
// Deprecated 11/2023.
#if BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterBooleanPref(kSystemTrayExpanded, true);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 11/2023.
#if BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterBooleanPref(kUserGeolocationAllowed, true);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 11/2023.
registry->RegisterListPref(kPasswordChangeSuccessTrackerFlows);
registry->RegisterIntegerPref(kPasswordChangeSuccessTrackerVersion, 0);
// Deprecated 11/2023.
#if BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterDictionaryPref(kImageSearchPrivacyNotice);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 11/2023.
registry->RegisterBooleanPref(kWebAndAppActivityEnabledForShopping, true);
registry->RegisterBooleanPref(kSyncRequested, false);
// Deprecated 12/2023.
#if BUILDFLAG(IS_ANDROID)
@@ -1604,7 +1532,42 @@ void RegisterProfilePrefsForMigration(
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 10/2024
registry->RegisterIntegerPref(kAccessibilityFaceGazeCursorSmoothing, 7);
// Deprecated 10/2024
registry->RegisterIntegerPref(kWallpaperSeaPenMigrationStatus, 0);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 10/2024
registry->RegisterBooleanPref(kLiveCaptionBubblePinned, false);
// Deprecated 10/2024
registry->RegisterBooleanPref(kDocumentSuggestEnabled, true);
// Deprecated 10/2024
registry->RegisterIntegerPref(kFirstTimeInterstitialBannerState, 0);
// Deprecated 10/2024
registry->RegisterBooleanPref(kSidePanelCompanionEntryPinnedToToolbar, false);
registry->RegisterIntegerPref(kMsbbPromoDeclinedCountPref, 0);
registry->RegisterIntegerPref(kSigninPromoDeclinedCountPref, 0);
registry->RegisterIntegerPref(kExpsPromoDeclinedCountPref, 0);
registry->RegisterIntegerPref(kExpsPromoShownCountPref, 0);
registry->RegisterIntegerPref(kPcoPromoShownCountPref, 0);
registry->RegisterIntegerPref(kPcoPromoDeclinedCountPref, 0);
registry->RegisterBooleanPref(kExpsOptInStatusGrantedPref, false);
registry->RegisterBooleanPref(kHasNavigatedToExpsSuccessPage, false);
#if BUILDFLAG(IS_CHROMEOS)
// Deprecated 11/2024
registry->RegisterBooleanPref(kNoteTakingAppEnabledOnLockScreen, false);
registry->RegisterListPref(kNoteTakingAppsLockScreenAllowlist,
base::Value::List());
registry->RegisterDictionaryPref(kNoteTakingAppsLockScreenToastShown);
registry->RegisterBooleanPref(kRestoreLastLockScreenNote, false);
#endif
// Deprecated 11/2024
registry->RegisterStringPref(kPrefixedVideoFullscreenApiAvailability, "");
}
void ClearSyncRequestedPrefAndMaybeMigrate(PrefService* profile_prefs) {
@@ -1750,9 +1713,12 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
task_manager::TaskManagerInterface::RegisterPrefs(registry);
UpgradeDetector::RegisterPrefs(registry);
registry->RegisterIntegerPref(prefs::kLastWhatsNewVersion, 0);
on_device_translation::RegisterLocalStatePrefs(registry);
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION)
on_device_translation::RegisterLocalStatePrefs(registry);
#endif // BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
WhatsNewUI::RegisterLocalStatePrefs(registry);
#endif
@@ -1771,14 +1737,12 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
ash::ManagedCellularPrefHandler::RegisterLocalStatePrefs(registry);
ash::ChromeSessionManager::RegisterPrefs(registry);
user_manager::UserManagerImpl::RegisterPrefs(registry);
crosapi::browser_util::RegisterLocalStatePrefs(registry);
ash::CupsPrintersManager::RegisterLocalStatePrefs(registry);
ash::bluetooth_config::BluetoothPowerControllerImpl::RegisterLocalStatePrefs(
registry);
ash::bluetooth_config::DeviceNameManagerImpl::RegisterLocalStatePrefs(
registry);
ash::DemoSession::RegisterLocalStatePrefs(registry);
ash::DemoSetupController::RegisterLocalStatePrefs(registry);
ash::demo_mode::RegisterLocalStatePrefs(registry);
ash::DeviceNameStore::RegisterLocalStatePrefs(registry);
ash::DozeModePowerStatusScheduler::RegisterLocalStatePrefs(registry);
chromeos::DeviceOAuth2TokenStoreChromeOS::RegisterPrefs(registry);
@@ -1808,7 +1772,6 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
ash::SchedulerConfigurationManager::RegisterLocalStatePrefs(registry);
ash::SecureDnsManager::RegisterLocalStatePrefs(registry);
ash::ServicesCustomizationDocument::RegisterPrefs(registry);
ash::standalone_browser::migrator_util::RegisterLocalStatePrefs(registry);
ash::StartupUtils::RegisterPrefs(registry);
ash::StatsReportingController::RegisterLocalStatePrefs(registry);
ash::system::AutomaticRebootManager::RegisterPrefs(registry);
@@ -1964,12 +1927,12 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
chrome_browser_net::NetErrorTabHelper::RegisterProfilePrefs(registry);
chrome_prefs::RegisterProfilePrefs(registry);
commerce::RegisterPrefs(registry);
DocumentProvider::RegisterProfilePrefs(registry);
enterprise::RegisterIdentifiersProfilePrefs(registry);
enterprise_connectors::RegisterProfilePrefs(registry);
enterprise_reporting::RegisterProfilePrefs(registry);
dom_distiller::DistilledPagePrefs::RegisterProfilePrefs(registry);
DownloadPrefs::RegisterProfilePrefs(registry);
fingerprinting_protection_filter::prefs::RegisterProfilePrefs(registry);
permissions::PermissionHatsTriggerHelper::RegisterProfilePrefs(registry);
history_clusters::prefs::RegisterProfilePrefs(registry);
HostContentSettingsMap::RegisterProfilePrefs(registry);
@@ -2054,6 +2017,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
extensions::PermissionsManager::RegisterProfilePrefs(registry);
extensions::ExtensionPrefs::RegisterProfilePrefs(registry);
extensions::RuntimeAPI::RegisterPrefs(registry);
#endif // BUILDFLAG(ENABLE_EXTENSIONS_CORE)
#if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -2065,7 +2029,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
#if BUILDFLAG(IS_CHROMEOS_ASH)
extensions::shared_storage::RegisterProfilePrefs(registry);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
extensions::RuntimeAPI::RegisterPrefs(registry);
// TODO(devlin): This would be more inline with the other calls here if it
// were nested in either a class or separate namespace with a simple
// Register[Profile]Prefs() name.
@@ -2108,12 +2071,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
#else // BUILDFLAG(IS_ANDROID)
bookmarks_webui::RegisterProfilePrefs(registry);
browser_sync::ForeignSessionHandler::RegisterProfilePrefs(registry);
BrowserFeaturePromoStorageService::RegisterProfilePrefs(registry);
BrowserUserEducationStorageService::RegisterProfilePrefs(registry);
captions::LiveTranslateController::RegisterProfilePrefs(registry);
CartService::RegisterProfilePrefs(registry);
ChromeAuthenticatorRequestDelegate::RegisterProfilePrefs(registry);
commerce::CommerceUiTabHelper::RegisterProfilePrefs(registry);
companion::PromoHandler::RegisterProfilePrefs(registry);
DeviceServiceImpl::RegisterProfilePrefs(registry);
DevToolsWindow::RegisterProfilePrefs(registry);
DriveService::RegisterProfilePrefs(registry);
@@ -2155,9 +2117,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_CHROMEOS)
extensions::DocumentScanAPIHandler::RegisterProfilePrefs(registry);
extensions::DocumentScanRegisterProfilePrefs(registry);
extensions::login_api::RegisterProfilePrefs(registry);
extensions::platform_keys::RegisterProfilePrefs(registry);
extensions::platform_keys::EnterprisePlatformKeysRegisterProfilePrefs(
registry);
certificate_manager::CertificatesHandler::RegisterProfilePrefs(registry);
chromeos::cloud_storage::RegisterProfilePrefs(registry);
chromeos::cloud_upload::RegisterProfilePrefs(registry);
@@ -2247,7 +2210,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
crostini::prefs::RegisterProfilePrefs(registry);
flags_ui::PrefServiceFlagsStorage::RegisterProfilePrefs(registry);
guest_os::prefs::RegisterProfilePrefs(registry);
lock_screen_apps::StateController::RegisterProfilePrefs(registry);
plugin_vm::prefs::RegisterProfilePrefs(registry);
policy::ArcAppInstallEventLogger::RegisterProfilePrefs(registry);
policy::AppInstallEventLogManagerWrapper::RegisterProfilePrefs(registry);
@@ -2330,6 +2292,8 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
side_panel_prefs::RegisterProfilePrefs(registry);
tabs::RegisterProfilePrefs(registry);
CertificateManagerPageHandler::RegisterProfilePrefs(registry);
#endif // !BUILDFLAG(IS_ANDROID)
registry->RegisterBooleanPref(webauthn::pref_names::kAllowWithBrokenCerts,
@@ -2425,18 +2389,7 @@ void MigrateObsoleteLocalStatePrefs(PrefService* local_state) {
// BEGIN_MIGRATE_OBSOLETE_LOCAL_STATE_PREFS
// Please don't delete the preceding line. It is used by PRESUBMIT.py.
// Added 09/2023.
#if BUILDFLAG(IS_WIN)
local_state->ClearPref(kSwReporter);
local_state->ClearPref(kChromeCleaner);
#endif
// Added 09/2023.
#if BUILDFLAG(IS_CHROMEOS_ASH)
local_state->ClearPref(kGestureEducationNotificationShown);
#endif
// Added 11/2023.
// Added 12/2023.
#if BUILDFLAG(IS_CHROMEOS_ASH)
local_state->ClearPref(kIsolatedWebAppsEnabled);
#endif
@@ -2520,6 +2473,15 @@ void MigrateObsoleteLocalStatePrefs(PrefService* local_state) {
local_state->ClearPref(kMigrationStep);
local_state->ClearPref(kMoveMigrationResumeStepPref);
local_state->ClearPref(kMoveMigrationResumeCountPref);
local_state->ClearPref(kDataVerPref);
local_state->ClearPref(kMigrationAttemptCountPref);
local_state->ClearPref(kProfileMigrationCompletedForUserPref);
local_state->ClearPref(kProfileMoveMigrationCompletedForUserPref);
local_state->ClearPref(kProfileMigrationCompletedForNewUserPref);
local_state->ClearPref(kProfileDataBackwardMigrationCompletedForUserPref);
local_state->ClearPref(kGotoFilesPref);
local_state->ClearPref(kProfileMigrationCompletionTimeForUserPref);
local_state->ClearPref(kLacrosDataBackwardMigrationMode);
#endif
#if !BUILDFLAG(IS_ANDROID)
@@ -2530,6 +2492,9 @@ void MigrateObsoleteLocalStatePrefs(PrefService* local_state) {
// Added 10/2024.
local_state->ClearPref(kBeforeunloadEventCancelByPreventDefaultEnabled);
// Added 11/2024
local_state->ClearPref(kOnDeviceModelTimeoutCount);
// Please don't delete the following line. It is used by PRESUBMIT.py.
// END_MIGRATE_OBSOLETE_LOCAL_STATE_PREFS
@@ -2570,65 +2535,9 @@ void MigrateObsoleteProfilePrefs(PrefService* profile_prefs,
MigrateDefaultBrowserLastDeclinedPref(profile_prefs);
#endif
// Added 09/2023.
profile_prefs->ClearPref(kPrivacySandboxM1Unrestricted);
#if BUILDFLAG(IS_WIN)
profile_prefs->ClearPref(kSwReporter);
profile_prefs->ClearPref(kSettingsResetPrompt);
profile_prefs->ClearPref(kChromeCleaner);
#endif
profile_prefs->ClearPref(kDownloadBubbleEnabled);
profile_prefs->ClearPref(kPrivacySandboxManuallyControlled);
#if BUILDFLAG(IS_CHROMEOS_ASH)
profile_prefs->ClearPref(kSyncInitialSyncFeatureSetupCompleteOnAsh);
#endif
#if BUILDFLAG(IS_ANDROID)
profile_prefs->ClearPref(kSettingsMigratedToUPM);
#endif
// Added 10/2023.
ClearSyncRequestedPrefAndMaybeMigrate(profile_prefs);
// Added 10/2023.
#if BUILDFLAG(IS_CHROMEOS_ASH)
profile_prefs->ClearPref(kLastSuccessfulDomainPref);
profile_prefs->ClearPref(kShouldAttemptReenable);
profile_prefs->ClearPref(kAudioVolumePercent);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Added 10/2023.
#if BUILDFLAG(IS_CHROMEOS)
profile_prefs->ClearPref(kSupportedLinksAppPrefsKey);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Added 10/2023.
profile_prefs->ClearPref(kNightLightCachedLatitude);
profile_prefs->ClearPref(kNightLightCachedLongitude);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Added 11/2023.
profile_prefs->ClearPref(kPrivacySandboxAntiAbuseInitialized);
// Added 11/2023.
profile_prefs->ClearPref(kWebRTCAllowLegacyTLSProtocols);
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Added 11/2023.
profile_prefs->ClearPref(kSystemTrayExpanded);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Added 11/2023.
profile_prefs->ClearPref(kUserGeolocationAllowed);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if !BUILDFLAG(IS_ANDROID)
// Added 11/2023.
password_manager::features_util::MigrateOptInPrefToSyncSelectedTypes(
profile_prefs);
#endif // !BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_ANDROID)
// Added 11/2023, but DO NOT REMOVE after the usual year!
// TODO(crbug.com/40268177): The pref kPasswordsUseUPMLocalAndSeparateStores
@@ -2641,18 +2550,6 @@ void MigrateObsoleteProfilePrefs(PrefService* profile_prefs,
profile_path);
#endif
// Added 11/2023.
profile_prefs->ClearPref(kPasswordChangeSuccessTrackerFlows);
profile_prefs->ClearPref(kPasswordChangeSuccessTrackerVersion);
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Added 11/2023.
profile_prefs->ClearPref(kImageSearchPrivacyNotice);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Added 11/2023.
profile_prefs->ClearPref(kWebAndAppActivityEnabledForShopping);
#if !BUILDFLAG(IS_ANDROID)
// Added 12/2023.
password_manager::features_util::MigrateDeclinedSaveOptInToExplicitOptOut(
@@ -2965,8 +2862,42 @@ void MigrateObsoleteProfilePrefs(PrefService* profile_prefs,
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Added 10/2024
profile_prefs->ClearPref(kAccessibilityFaceGazeCursorSmoothing);
// Added 10/2024
profile_prefs->ClearPref(kWallpaperSeaPenMigrationStatus);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Added 10/2024
profile_prefs->ClearPref(kLiveCaptionBubblePinned);
// Added 10/2024
profile_prefs->ClearPref(kDocumentSuggestEnabled);
// Added 10/2024
profile_prefs->ClearPref(kFirstTimeInterstitialBannerState);
// Added 10/2024
profile_prefs->ClearPref(kSidePanelCompanionEntryPinnedToToolbar);
profile_prefs->ClearPref(kMsbbPromoDeclinedCountPref);
profile_prefs->ClearPref(kSigninPromoDeclinedCountPref);
profile_prefs->ClearPref(kExpsPromoDeclinedCountPref);
profile_prefs->ClearPref(kExpsPromoShownCountPref);
profile_prefs->ClearPref(kPcoPromoShownCountPref);
profile_prefs->ClearPref(kPcoPromoDeclinedCountPref);
profile_prefs->ClearPref(kExpsOptInStatusGrantedPref);
profile_prefs->ClearPref(kHasNavigatedToExpsSuccessPage);
#if BUILDFLAG(IS_CHROMEOS)
// Deprecated 11/2024
profile_prefs->ClearPref(kNoteTakingAppEnabledOnLockScreen);
profile_prefs->ClearPref(kNoteTakingAppsLockScreenAllowlist);
profile_prefs->ClearPref(kNoteTakingAppsLockScreenToastShown);
profile_prefs->ClearPref(kRestoreLastLockScreenNote);
#endif
// Added 11/2024
profile_prefs->ClearPref(kPrefixedVideoFullscreenApiAvailability);
// Please don't delete the following line. It is used by PRESUBMIT.py.
// END_MIGRATE_OBSOLETE_PROFILE_PREFS
@@ -107,7 +107,6 @@
#include "chrome/browser/ui/tab_dialogs.h"
#include "chrome/browser/ui/tab_ui_helper.h"
#include "chrome/browser/ui/thumbnails/thumbnail_tab_helper.h"
#include "chrome/browser/ui/views/side_panel/companion/companion_utils.h"
#include "chrome/browser/v8_compile_hints/v8_compile_hints_tab_helper.h"
#include "chrome/browser/vr/vr_tab_helper.h"
#include "chrome/common/buildflags.h"
@@ -181,18 +180,20 @@
#include "chrome/browser/content_settings/request_desktop_site_web_contents_observer_android.h"
#include "chrome/browser/facilitated_payments/ui/chrome_facilitated_payments_client.h"
#include "chrome/browser/fast_checkout/fast_checkout_tab_helper.h"
#include "chrome/browser/fingerprinting_protection/chrome_fingerprinting_protection_web_contents_helper_factory.h"
#include "chrome/browser/flags/android/chrome_feature_list.h"
#include "chrome/browser/plugins/plugin_observer_android.h"
#include "chrome/browser/privacy_sandbox/tracking_protection_settings_factory.h"
#include "chrome/browser/ui/android/context_menu_helper.h"
#include "chrome/browser/ui/javascript_dialogs/javascript_tab_modal_dialog_manager_delegate_android.h"
#include "components/facilitated_payments/core/features/features.h"
#include "components/fingerprinting_protection_filter/common/fingerprinting_protection_filter_features.h"
#include "components/sensitive_content/android/android_sensitive_content_client.h"
#include "components/sensitive_content/features.h"
#include "components/webapps/browser/android/app_banner_manager_android.h"
#include "content/public/common/content_features.h"
#else
#include "chrome/browser/banners/app_banner_manager_desktop.h"
#include "chrome/browser/companion/core/features.h"
#include "chrome/browser/picture_in_picture/auto_picture_in_picture_tab_helper.h"
#include "chrome/browser/preloading/prefetch/zero_suggest_prefetch/zero_suggest_prefetch_tab_helper.h"
#include "chrome/browser/tab_contents/form_interaction_tab_helper.h"
@@ -205,8 +206,6 @@
#include "chrome/browser/ui/sync/browser_synced_tab_delegate.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/uma_browsing_activity_observer.h"
#include "chrome/browser/ui/views/side_panel/companion/companion_tab_helper.h"
#include "chrome/browser/ui/views/side_panel/companion/exps_registration_success_observer.h"
#include "chrome/browser/ui/views/side_panel/history_clusters/history_clusters_tab_helper.h"
#include "chrome/browser/ui/views/side_panel/read_anything/read_anything_side_panel_controller.h"
#include "components/commerce/content/browser/hint/commerce_hint_tab_helper.h"
@@ -216,11 +215,6 @@
#include "components/zoom/zoom_controller.h"
#endif // BUILDFLAG(IS_ANDROID)
#if defined(TOOLKIT_VIEWS)
#include "chrome/browser/ui/side_search/side_search_tab_contents_helper.h"
#include "chrome/browser/ui/side_search/side_search_utils.h"
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ash/boot_times_recorder/boot_times_recorder_tab_helper.h"
#include "chrome/browser/ash/growth/campaigns_manager_session_tab_helper.h"
@@ -233,8 +227,8 @@
#endif
#if BUILDFLAG(IS_CHROMEOS)
#include "chrome/browser/chromeos/container_app/container_app_tab_helper.h"
#include "chrome/browser/chromeos/cros_apps/cros_apps_tab_helper.h"
#include "chrome/browser/chromeos/gemini_app/gemini_app_tab_helper.h"
#include "chrome/browser/chromeos/policy/dlp/dlp_content_tab_helper.h"
#include "chrome/browser/chromeos/printing/print_preview/printing_init_cros.h"
#endif
@@ -260,10 +254,7 @@
#include "chrome/browser/extensions/navigation_extension_enabler.h"
#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/ui/extensions/extension_side_panel_utils.h"
#include "chrome/browser/ui/web_applications/web_app_metrics.h"
#include "chrome/browser/ui/web_applications/web_app_metrics_tab_helper.h"
#include "chrome/browser/web_applications/policy/pre_redirection_url_observer.h"
#include "chrome/browser/web_applications/web_app_tab_helper.h"
#include "chrome/browser/web_applications/web_app_utils.h"
#include "extensions/browser/view_type_utils.h" // nogncheck
#include "extensions/common/extension_features.h"
@@ -356,11 +347,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
Profile::FromBrowserContext(web_contents->GetBrowserContext());
// --- Section 1: Common tab helpers ---
if (page_info::IsAboutThisSiteAsyncFetchingEnabled()
#if defined(TOOLKIT_VIEWS)
|| page_info::IsPersistentSidePanelEntryFeatureEnabled()
#endif
) {
if (page_info::IsAboutThisSiteAsyncFetchingEnabled()) {
if (auto* optimization_guide_decider =
OptimizationGuideKeyedServiceFactory::GetForProfile(profile)) {
AboutThisSiteTabHelper::CreateForWebContents(web_contents,
@@ -381,6 +368,14 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
sensitive_content::AndroidSensitiveContentClient::CreateForWebContents(
web_contents, "SensitiveContent.Chrome.");
}
if (fingerprinting_protection_filter::features::
IsFingerprintingProtectionFeatureEnabled()) {
CreateFingerprintingProtectionWebContentsHelper(
web_contents, profile->GetPrefs(),
TrackingProtectionSettingsFactory::GetForProfile(profile),
profile->IsIncognitoProfile());
}
#endif // BUILDFLAG(IS_ANDROID)
if (breadcrumbs::IsEnabled(g_browser_process->local_state())) {
BreadcrumbManagerTabHelper::CreateForWebContents(web_contents);
@@ -483,7 +478,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
}
#endif // BUILDFLAG(IS_ANDROID)
}
chrome::InitializePageLoadMetricsForWebContents(web_contents);
InitializePageLoadMetricsForWebContents(web_contents);
if (auto* pm_registry =
performance_manager::PerformanceManagerRegistry::GetInstance()) {
pm_registry->SetPageType(web_contents, performance_manager::PageType::kTab);
@@ -560,10 +555,6 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
SupervisedUserNavigationObserver::CreateForWebContents(web_contents);
}
HttpErrorTabHelper::CreateForWebContents(web_contents);
sync_sessions::SyncSessionsRouterTabHelper::CreateForWebContents(
web_contents,
sync_sessions::SyncSessionsWebContentsRouterFactory::GetForProfile(
profile));
TabUIHelper::CreateForWebContents(web_contents);
tasks::TaskTabHelper::CreateForWebContents(web_contents);
tpcd::metadata::TpcdMetadataDevtoolsObserver::CreateForWebContents(
@@ -663,8 +654,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
base::FeatureList::IsEnabled(features::kWebUITabStrip)) {
ThumbnailTabHelper::CreateForWebContents(web_contents);
}
chrome::UMABrowsingActivityObserver::TabHelper::CreateForWebContents(
web_contents);
UMABrowsingActivityObserver::TabHelper::CreateForWebContents(web_contents);
web_modal::WebContentsModalDialogManager::CreateForWebContents(web_contents);
if (OmniboxFieldTrial::IsZeroSuggestPrefetchingEnabled()) {
ZeroSuggestPrefetchTabHelper::CreateForWebContents(web_contents);
@@ -672,15 +662,6 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
if (commerce::isContextualConsentEnabled()) {
commerce_hint::CommerceHintTabHelper::CreateForWebContents(web_contents);
}
if (companion::IsCompanionFeatureEnabled()) {
companion::CompanionTabHelper::CreateForWebContents(web_contents);
}
if (base::FeatureList::IsEnabled(
companion::features::internal::
kCompanionEnabledByObservingExpsNavigations)) {
companion::ExpsRegistrationSuccessObserver::CreateForWebContents(
web_contents);
}
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(ENABLE_COMPOSE)
@@ -705,8 +686,8 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
#endif
#if BUILDFLAG(IS_CHROMEOS)
ContainerAppTabHelper::MaybeCreateForWebContents(web_contents);
CrosAppsTabHelper::MaybeCreateForWebContents(web_contents);
GeminiAppTabHelper::MaybeCreateForWebContents(web_contents);
mahi::MahiTabHelper::MaybeCreateForWebContents(web_contents);
policy::DlpContentTabHelper::MaybeCreateForWebContents(web_contents);
#endif
@@ -748,12 +729,6 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
FontPrewarmerTabHelper::CreateForWebContents(web_contents);
#endif
#if defined(TOOLKIT_VIEWS)
if (IsSideSearchEnabled(profile)) {
SideSearchTabContentsHelper::CreateForWebContents(web_contents);
}
#endif
// --- Section 3: Feature tab helpers behind BUILDFLAGs ---
// NOT for "if enabled"; put those in section 1.
@@ -780,13 +755,6 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
extensions::NavigationExtensionEnabler::CreateForWebContents(web_contents);
extensions::WebNavigationTabObserver::CreateForWebContents(web_contents);
if (web_app::AreWebAppsEnabled(profile)) {
web_app::WebAppTabHelper::CreateForWebContents(web_contents);
}
// Note WebAppMetricsTabHelper must be created after AppBannerManager.
if (web_app::WebAppMetricsTabHelper::IsEnabled(web_contents)) {
web_app::WebAppMetricsTabHelper::CreateForWebContents(web_contents);
}
#endif
#if BUILDFLAG(ENABLE_OFFLINE_PAGES)
@@ -4,9 +4,6 @@
// Use the <code>appview</code> tag to embed other Chrome Apps within your
// Chrome App. (see <a href=#usage>Usage</a>).
[documentation_title="<appview> Tag",
documentation_namespace="<appview>",
documented_in="tags/appview"]
namespace appviewTag {
// This object specifies details and operations to perform on the embedding
// request. The app to be embedded can make a decision on whether or not to
@@ -35,6 +35,9 @@ namespace autofillPrivate {
NAME_MIDDLE_INITIAL,
NAME_FULL,
NAME_SUFFIX,
ALTERNATIVE_FULL_NAME,
ALTERNATIVE_GIVEN_NAME,
ALTERNATIVE_FAMILY_NAME,
EMAIL_ADDRESS,
PHONE_HOME_NUMBER,
PHONE_HOME_CITY_CODE,
@@ -388,7 +391,7 @@ namespace autofillPrivate {
// Logs that the server cards edit link was clicked.
static void logServerCardLinkClicked();
// Logs that a serve IBAN's edit link was clicked.
// Logs that a server IBAN's edit link was clicked.
static void logServerIbanLinkClicked();
// Enrolls a credit card into virtual cards.
@@ -2009,9 +2009,6 @@ interface Functions {
// result of the onDriveConfirmDialog event.
static void notifyDriveDialogResult(DriveDialogResult result);
// Opens a new browser tab and navigates to `url`.
static void openURL(DOMString url);
// Creates a new Files app window in the directory provided in `params`.
[doesNotSupportPromises]
static void openWindow(OpenWindowParams params, BooleanCallback callback);
@@ -26,6 +26,7 @@ namespace odfsConfigPrivate {
callback GetAccountRestrictionsCallback = void(
AccountRestrictionsInfo restrictions);
callback ShowAutomatedMountErrorCallback = void();
callback OpenInOfficeAppCallback = void();
callback BoolCallback = void(boolean result);
interface Functions {
@@ -50,6 +51,13 @@ namespace odfsConfigPrivate {
// Returns whether the FileSystemProviderContentCache feature flag is
// enabled.
static void isContentCacheEnabled(BoolCallback callback);
// Opens the tab inside the M365 PWA. This will not cause a new navigation
// but instead re-parent the tab to a new instance of the M365 PWA. It does
// nothing if the M365 PWA is not installed.
//
// |tabId| : Specifies the tab which should be opened in Office
static void openInOfficeApp(long tabId, OpenInOfficeAppCallback callback);
};
interface Events {
@@ -4,7 +4,7 @@
// Use the <code>chrome.printingMetrics</code> API to fetch data about
// printing usage.
[platforms=("chromeos", "lacros"),
[platforms=("chromeos"),
implemented_in="chrome/browser/chromeos/extensions/printing_metrics/printing_metrics_api.h"]
namespace printingMetrics {
// The source of the print job.
@@ -4,7 +4,7 @@
// Use the <code>chrome.vpnProvider</code> API to implement a VPN
// client.
[platforms=("chromeos", "lacros"),
[platforms=("chromeos"),
implemented_in="chrome/browser/chromeos/extensions/vpn_provider/vpn_provider_api.h"]
namespace vpnProvider {
// A parameters class for the VPN interface.
@@ -50,7 +50,6 @@
#include "chrome/grit/renderer_resources.h"
#include "chrome/renderer/benchmarking_extension.h"
#include "chrome/renderer/browser_exposed_renderer_interfaces.h"
#include "chrome/renderer/cart/commerce_hint_agent.h"
#include "chrome/renderer/chrome_content_settings_agent_delegate.h"
#include "chrome/renderer/chrome_render_frame_observer.h"
#include "chrome/renderer/chrome_render_thread_observer.h"
@@ -76,7 +75,6 @@
#include "components/autofill/content/renderer/password_generation_agent.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/commerce/content/renderer/commerce_web_extractor.h"
#include "components/commerce/core/commerce_feature_list.h"
#include "components/content_capture/common/content_capture_features.h"
#include "components/content_capture/renderer/content_capture_sender.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
@@ -94,14 +92,15 @@
#include "components/fingerprinting_protection_filter/renderer/renderer_agent.h"
#include "components/fingerprinting_protection_filter/renderer/unverified_ruleset_dealer.h"
#include "components/grit/components_scaled_resources.h"
#include "components/guest_view/buildflags/buildflags.h"
#include "components/heap_profiling/in_process/heap_profiler_controller.h"
#include "components/history_clusters/core/config.h"
#include "components/metrics/call_stacks/call_stack_profile_builder.h"
#include "components/network_hints/renderer/web_prescient_networking_impl.h"
#include "components/no_state_prefetch/renderer/no_state_prefetch_client.h"
#include "components/no_state_prefetch/renderer/no_state_prefetch_helper.h"
#include "components/no_state_prefetch/renderer/no_state_prefetch_render_frame_observer.h"
#include "components/no_state_prefetch/renderer/no_state_prefetch_utils.h"
#include "components/no_state_prefetch/renderer/prerender_render_frame_observer.h"
#include "components/optimization_guide/core/optimization_guide_features.h"
#include "components/page_content_annotations/core/page_content_annotations_features.h"
#include "components/page_load_metrics/renderer/metrics_render_frame_observer.h"
@@ -303,8 +302,6 @@ using SecureContextRequired = autofill::AutofillAgent::SecureContextRequired;
using UserGestureRequired = autofill::AutofillAgent::UserGestureRequired;
using UsesKeyboardAccessoryForSuggestions =
autofill::AutofillAgent::UsesKeyboardAccessoryForSuggestions;
using EnableHeavyFormDataScraping =
autofill::PasswordAutofillAgent::EnableHeavyFormDataScraping;
namespace {
@@ -610,7 +607,7 @@ void ChromeContentRendererClient::RenderFrameCreated(
new ChromeRenderFrameObserver(render_frame, web_cache_impl_.get());
service_manager::BinderRegistry* registry = render_frame_observer->registry();
new prerender::PrerenderRenderFrameObserver(render_frame);
new prerender::NoStatePrefetchRenderFrameObserver(render_frame);
auto content_settings_delegate =
std::make_unique<ChromeContentSettingsAgentDelegate>(render_frame);
@@ -709,10 +706,7 @@ void ChromeContentRendererClient::RenderFrameCreated(
if (!render_frame->IsInFencedFrameTree() ||
base::FeatureList::IsEnabled(blink::features::kFencedFramesAPIChanges)) {
auto password_autofill_agent = std::make_unique<PasswordAutofillAgent>(
render_frame, associated_interfaces,
EnableHeavyFormDataScraping(
chrome::GetChannel() == version_info::Channel::CANARY ||
chrome::GetChannel() == version_info::Channel::DEV));
render_frame, associated_interfaces);
auto password_generation_agent = std::make_unique<PasswordGenerationAgent>(
render_frame, password_autofill_agent.get(), associated_interfaces);
new AutofillAgent(
@@ -775,18 +769,6 @@ void ChromeContentRendererClient::RenderFrameCreated(
}
#endif
// We should create CommerceHintAgent only for a main frame except a fenced
// frame that is the main frame as well, so we should check if |render_frame|
// is the fenced frame.
#if !BUILDFLAG(IS_ANDROID)
if (command_line->HasSwitch(commerce::switches::kEnableChromeCart) &&
#else
if (base::FeatureList::IsEnabled(commerce::kCommerceHintAndroid) &&
#endif // !BUILDFLAG(IS_ANDROID)
render_frame->GetWebFrame()->IsOutermostMainFrame()) {
new cart::CommerceHintAgent(render_frame);
}
#if BUILDFLAG(ENABLE_SPELLCHECK)
new SpellCheckProvider(render_frame, spellcheck_.get());
@@ -1063,8 +1045,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
};
switch (status) {
case chrome::mojom::PluginStatus::kNotFound: {
NOTREACHED_IN_MIGRATION();
break;
NOTREACHED();
}
case chrome::mojom::PluginStatus::kAllowed:
case chrome::mojom::PluginStatus::kPlayImportantContent: {
@@ -1113,7 +1094,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
is_module_allowed =
has_enable_nacl_switch ||
(is_pnacl_mime_type &&
blink::WebOriginTrials::isTrialEnabled(&document, "PNaCl"));
blink::WebOriginTrials::IsPNaClEnabled(&document));
}
}
if (!is_module_allowed) {
@@ -1170,7 +1151,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
render_frame, params, info, identifier, group_name,
IDR_BLOCKED_PLUGIN_HTML,
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name));
placeholder->set_blocked_for_prerendering(is_no_state_prefetching);
placeholder->set_blocked_for_no_state_prefetching(
is_no_state_prefetching);
placeholder->AllowLoading();
break;
}
@@ -1371,9 +1353,8 @@ void ChromeContentRendererClient::ReportNaClAppType(
}
} else {
// We found an extension that is not covered by any metric
NOTREACHED_IN_MIGRATION()
<< "Invalid NaCl usage in extension. Extension name: "
<< extension->name() << ", type: " << extension->GetType();
NOTREACHED() << "Invalid NaCl usage in extension. Extension name: "
<< extension->name() << ", type: " << extension->GetType();
}
}
@@ -1305,10 +1305,16 @@ policies:
1304: DirectSocketsPrivateNetworkAccessAllowedForUrls
1305: DirectSocketsPrivateNetworkAccessBlockedForUrls
1306: SelectParserRelaxationEnabled
1307: ''
1308: ''
1309: ''
1307: ClassManagementEnabled
1308: EnterpriseSearchAggregatorSettings
1309: TranslatorAPIAllowed
1310: WebAudioOutputBufferingEnabled
1311: NTPOutlookCardVisible
1312: NTPSharepointCardVisible
1313: SharedWorkerBlobURLFixEnabled
1314: DeviceNativeClientForceAllowed
1315: GenAiLensOverlaySettings
1316: PasswordManagerPasskeysEnabled
atomic_groups:
1: Homepage
@@ -1,13 +1,10 @@
caption: Control Android Google location services
deprecated: true
default: 0
default_for_enterprise_users: 0
desc: |-
Warning! This policy is deprecated, please use <ph name="CROS_GLS_POLICY_NAME">GoogleLocationServicesEnabled</ph> instead. <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph> now has a system location toggle, which governs the entire system including <ph name="ANDROID_NAME">Android</ph>. The <ph name="ANDROID_NAME">Android</ph> toggle is now read-only and reflects the <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph> location state.
Unless the <ph name="DEFAULT_GEOLOCATION_SETTING_POLICY_NAME">DefaultGeolocationSetting</ph> policy is set to <ph name="BLOCK_GEOLOCATION_SETTING">BlockGeolocation</ph>, then setting <ph name="GLS_ENABLED">GoogleLocationServicesEnabled</ph> turns Google location services on during initial setup. Setting the policy to <ph name="GLS_DISABLED">GoogleLocationServicesDisabled</ph> or leaving it unset keeps location services off during setup.
Setting policy to <ph name="GLS_UNDER_USER_CONTROL">GoogleLocationServicesUnderUserControl</ph> prompts users about whether or not to use Google location services. If they turn it on, <ph name="ANDROID_NAME">Android</ph> apps, <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph> apps, websites, and system services use the services to search the device location and send anonymous location data to Google.
Setting policy to <ph name="BR_UNDER_USER_CONTROL">BackupAndRestoreUnderUserControl</ph> prompts users about whether or not to use Google location services. If they turn it on, Android apps use the services to search the device location and send anonymous location data to Google.
After initial setup, users can turn Google location services on or off.
example_value: 1
@@ -2,9 +2,8 @@ caption: Open links in Chrome browser by default
desc: |-
Setting the policy to False allows Android apps to capture supported links by default.
Setting the policy to True make all links open in Chrome browser by default.
If the policy is not set, Android apps capture supported links by default.
default: true
default_for_enterprise_users: false
If the policy is not set, links are opened by default in Android apps for managed users and in the browser for consumers.
default: false
example_value: true
features:
dynamic_refresh: false
@@ -19,7 +18,7 @@ owners:
- ovn@google.com
schema:
type: boolean
future_on:
- chrome_os
supported_on:
- chrome_os:132-
tags: []
type: main
@@ -0,0 +1,2 @@
caption: Class management tools Settings
desc: Controls settings for class management tools.
@@ -0,0 +1,31 @@
caption: Configure Class management tools
default: disabled
desc: |-
Setting the policy specifies whether users use class management tools for sending/receiving content, sending/receiving caption as students, teachers, or if class management tools is disabled for users.
example_value: disabled
features:
dynamic_refresh: true
per_profile: true
items:
- caption: Users are not able to use any of the class management features or be added to a class management session.
name: disabled
value: disabled
- caption: Users will be able to join and be added to a class management session. Teachers will be able to send content to these users.
name: students
value: students
- caption: Users will be able to connect and deploy content to students. This includes sending web content and making live captions/translations of the teachers voice available to the students.
name: teachers
value: teachers
owners:
- cros-edu-eng@google.com
- aprilzhou@google.com
schema:
enum:
- disabled
- student
- teacher
type: string
supported_on:
- chrome_os:132-
tags: []
type: string-enum
@@ -20,8 +20,11 @@ items:
name: None
value: 2
owners:
- file://components/policy/OWNERS
- poromov@chromium.org
- dadrian@chromium.org
- davidben@chromium.org
- hchao@chromium.org
- mattm@chromium.org
- chrome-secure-web-and-net@chromium.org
schema:
enum:
- 0
@@ -30,5 +33,6 @@ schema:
type: integer
supported_on:
- chrome_os:78-
- chrome.*:132-
tags: []
type: int-enum
@@ -18,11 +18,9 @@ schema:
items:
type: string
type: array
future_on:
- chrome.linux
- chrome.mac
- chrome.win
- android
- chrome_os
supported_on:
- chrome_os:132-
- chrome.*:132-
- android:132-
tags: []
type: list
@@ -37,11 +37,9 @@ schema:
type: array
items:
type: string
future_on:
- chrome.linux
- chrome.mac
- chrome.win
- android
- chrome_os
supported_on:
- chrome_os:132-
- chrome.*:132-
- android:132-
tags: []
type: dict
@@ -22,11 +22,9 @@ schema:
items:
type: string
type: array
future_on:
- chrome.linux
- chrome.mac
- chrome.win
- android
- chrome_os
supported_on:
- chrome_os:132-
- chrome.*:132-
- android:132-
tags: []
type: list
@@ -18,11 +18,9 @@ schema:
items:
type: string
type: array
future_on:
- chrome.linux
- chrome.mac
- chrome.win
- android
- chrome_os
supported_on:
- chrome_os:132-
- chrome.*:132-
- android:132-
tags: []
type: list
@@ -1,6 +1,9 @@
caption: Required device-wide Client Certificates
desc: Specifies device-wide client certificates that should be enrolled using the
desc: |-
Specifies device-wide client certificates that should be enrolled using the
device management protocol.
The <ph name="EC_KEY_ALGORITHM_VALUE_NAME">EC</ph> key algorithm option is supported since <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph> version 132.
device_only: true
example_value:
- cert_profile_id: cert_profile_id_1
@@ -29,9 +32,10 @@ schema:
(optional, default: True).'
type: boolean
key_algorithm:
description: The algorithm for key pair generation.
description: The algorithm for key pair generation. The EC option is supported since version 132.
enum:
- rsa
- ec
type: string
name:
description: The name of the certificate profile.
@@ -1,6 +1,9 @@
caption: Required Client Certificates
desc: Specifies client certificates that should be enrolled using the device management
desc: |-
Specifies client certificates that should be enrolled using the device management
protocol.
The <ph name="EC_KEY_ALGORITHM_VALUE_NAME">EC</ph> key algorithm option is supported since <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph> version 132.
device_only: false
example_value:
- cert_profile_id: cert_profile_id_1
@@ -29,9 +32,10 @@ schema:
(optional, default: True).'
type: boolean
key_algorithm:
description: The algorithm for key pair generation.
description: The algorithm for key pair generation. The EC option is supported since version 132.
enum:
- rsa
- ec
type: string
name:
description: The name of the certificate profile.
@@ -24,8 +24,9 @@ schema:
type: string
type: array
supported_on:
- chrome.*:79-
- chrome_os:79-
- android:79-
# TODO(crbug.com/376084059): Clean up policy and supporting code
- chrome.*:79-131
- chrome_os:79-131
- android:79-131
tags: []
type: list
@@ -62,7 +62,7 @@ schema:
type: integer
type: object
type: object
future_on:
- chrome_os
supported_on:
- chrome_os:132-
tags: []
type: dict
@@ -2,7 +2,9 @@ arc_support: Android apps can be force-installed from the Google Admin console u
Google Play. They do not use this policy.
caption: Configure the list of force-installed apps and extensions
desc: |-
Setting the policy specifies a list of apps and extensions that install silently, without user interaction, and which users can't uninstall or turn off. Permissions are granted implicitly, including for the enterprise.deviceAttributes and enterprise.platformKeys extension APIs. (These 2 APIs aren't available to apps and extensions that aren't force-installed.)
Setting the policy specifies a list of apps and extensions that install silently, without user interaction, and which users can't uninstall or turn off through the <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> interface. Permissions are granted implicitly, including for the enterprise.deviceAttributes and enterprise.platformKeys extension APIs. (These 2 APIs aren't available to apps and extensions that aren't force-installed.)
Although <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> aims to prevent users from uninstalling these extensions, some operating systems make it impossible for <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> to defend robustly against extensions being modified externally, so this prevention is best efforts.
Leaving the policy unset means no apps or extensions are autoinstalled, and users can uninstall any app or extension in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.
@@ -0,0 +1,44 @@
caption: Settings for the Lens Overlay feature
desc: |-
Lens Overlay lets users issue Google searches by interacting with a screenshot of the current page laid over the actual web contents. Additionally, lets users issue Google searches that are contextually aware of the current page. To provide contextual answers, the Lens Overlay send page content to Google to answer the user's query with the context of the page the user is on.
There is no user setting to control this feature, it is generally made available to all users with Google as their default search engine unless disabled by this policy.
0 = Enable the feature for users, and send relevant data to Google to help train or improve AI models. Relevant data may include prompts, inputs, outputs, and source materials, depending on the feature. It may be reviewed by humans for the sole purpose of improving AI models. 0 is the default value, except when noted below.
1 = Enable the feature for users, but do not send data to Google to train or improve AI models. 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
2 = Disable the feature.
default: 0
example_value: 2
features:
dynamic_refresh: true
per_profile: true
items:
- caption: Allow Lens Overlay and improve AI models.
name: Allowed
value: 0
- caption: Allow Lens Overlay without improving AI models.
name: AllowedWithoutLogging
value: 1
- caption: Do not allow Lens Overlay.
name: Disabled
value: 2
owners:
- mercerd@google.com
- stanfield@google.com
- file://components/lens/OWNERS
schema:
enum:
- 0
- 1
- 2
type: integer
tags:
- google-sharing
future_on:
- chrome.*
- chrome_os
type: int-enum
@@ -25,6 +25,7 @@ desc: |-
resolution on the <ph name="LOG_IN">Log-in</ph> screen.
device_only: true
features:
internal_only: true
dynamic_refresh: true
per_profile: false
supported_on:
@@ -0,0 +1,24 @@
caption: Forces Native Client (NaCl) to be allowed to run on <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph>.
default: true
desc: |-
Setting the policy to True allows Native Client to continue to run even if the default behavior is that Native Client is disabled.
Setting the policy to False or leaving it unset will use the default behavior.
device_only: true
example_value: true
features:
dynamic_refresh: false
per_profile: false
items:
- caption: Allow Native Client to Run
value: true
- caption: Use Default Behavior
value: false
owners:
- fabiansommer@chromium.org
- file://ATL_OWNERS
schema:
type: boolean
supported_on:
- chrome_os:132-
tags: []
type: main
@@ -27,7 +27,7 @@ schema:
items:
$ref: WeeklyTimeIntervalChecked
type: array
future_on:
- chrome_os
supported_on:
- chrome_os:132-
tags: []
type: dict
@@ -28,6 +28,7 @@ features:
per_profile: true
future_on:
- fuchsia
- ios
items:
- caption: No special restrictions. Default.
name: DefaultDownloadSecurity
@@ -0,0 +1,56 @@
caption: Enterprise search aggregator settings
desc: |-
This policy allows administrators to set a designated enterprise search aggregator that will provide search recommendations and results within the address bar when triggered by a specific keyword. Users can initiate a search by typing the keyword specified in the <ph name="SHORTCUT_SEARCH_AGGREGATOR_SETTINGS_FIELD">shortcut</ph> field with or without the @ prefix (e.g. <ph name="SHORTCUT_EXAMPLE_SEARCH_AGGREGATOR_SETTINGS">@work</ph>), followed by Space or Tab, in the address bar.
The following fields are required: <ph name="NAME_SEARCH_AGGREGATOR_SETTINGS_FIELD">name</ph>, <ph name="SHORTCUT_SEARCH_AGGREGATOR_SETTINGS_FIELD">shortcut</ph>, <ph name="SEARCH_URL_SEARCH_AGGREGATOR_SETTINGS_FIELD">search_url</ph>, <ph name="SUGGEST_URL_SEARCH_AGGREGATOR_SETTINGS_FIELD">suggest_url</ph>.
The <ph name="NAME_SEARCH_AGGREGATOR_SETTINGS_FIELD">name</ph> field corresponds to the search engine name shown to the user in the address bar.
The <ph name="SHORTCUT_SEARCH_AGGREGATOR_SETTINGS_FIELD">shortcut</ph> field corresponds to the keyword that the user enters to trigger the search. The shortcut can include plain words and characters, but cannot include spaces or start with the @ symbol. Shortcuts must be unique.
The <ph name="SEARCH_URL_SEARCH_AGGREGATOR_SETTINGS_FIELD">search_url</ph> field specifies the URL on which to search. Enter the web address for the search engine's results page, and use <ph name="SEARCH_TERM_MARKER">'{searchTerms}'</ph> in place of the query.
The <ph name="SUGGEST_URL_SEARCH_AGGREGATOR_SETTINGS_FIELD">suggest_url</ph> field specifies the URL that provides search suggestions. If <ph name="SUGGEST_URL_SEARCH_AGGREGATOR_SETTINGS_FIELD">suggest_url</ph> contains <ph name="SEARCH_TERM_MARKER">'{searchTerms}'</ph>, then Chrome will obtain search suggestions by a GET request to the URL replacing <ph name="SEARCH_TERM_MARKER">'{searchTerms}'</ph> with the user's search query. Otherwise, a POST request will be made, the the user's query will be passed in the POST params under key <ph name="SEARCH_SUGGEST_POST_PARAMS_QUERY_KEY">'query'</ph>.
The <ph name="ICON_URL_SEARCH_AGGREGATOR_SETTINGS_FIELD">icon_url</ph> field specifies the URL to an image that will be used on the search suggestions. A default icon will be used when this field is not set. It's recommended to use a favicon (example <ph name="ICON_URL_EXAMPLE">https://www.google.com/favicon.ico</ph>).
On <ph name="MS_WIN_NAME">Microsoft® Windows®</ph>, this policy is only available on instances that are joined to a <ph name="MS_AD_NAME">Microsoft® Active Directory®</ph> domain, joined to <ph name="MS_AAD_NAME">Microsoft® Azure® Active Directory®</ph> or enrolled in <ph name="CHROME_BROWSER_CLOUD_MANAGEMENT_NAME">Chrome Browser Cloud Management</ph>.
On <ph name="MAC_OS_NAME">macOS</ph>, this policy is only available on instances that are managed via MDM, joined to a domain via MCX or enrolled in <ph name="CHROME_BROWSER_CLOUD_MANAGEMENT_NAME">Chrome Browser Cloud Management</ph>.
example_value:
name: My Search Aggregator
shortcut: work
search_url: https://www.aggregator.com/search?q=site%3Awikipedia.com+{searchTerms}
suggest_url: https://www.aggregator.com/suggest?q={searchTerms}
icon_url: https://www.google.com/favicon.ico
features:
dynamic_refresh: true
per_profile: true
owners:
- ftirelo@chromium.org
- jdonnelly@chromium.org
- mahmadi@chromium.org
schema:
type: object
properties:
name:
type: string
shortcut:
type: string
search_url:
type: string
suggest_url:
type: string
icon_url:
type: string
required:
- name
- shortcut
- suggest_url
- search_url
future_on:
- chrome.*
- chrome_os
tags: []
type: dict
@@ -4,11 +4,16 @@ desc: |-
IWAs are applications that have useful security properties unavailable to normal web pages. They are packaged in a Signed Web Bundle. The public key of the Signed Web Bundle is used to create the Web Bundle ID that identifies the IWA.
So far this policy works for Managed Guest Session only.
Each list item of the policy is an object which has two mandatory fields: the update manifest <ph name="URL_LABEL">URL</ph> and Web Bundle ID of the Isolated Web App. Each item can also have an optional field with the IWA release channel name. If the "update_channel" is not set, then the value of "default" will be used.
Each list item of the policy is an object which has two mandatory fields: the update manifest <ph name="URL_LABEL">URL</ph> and Web Bundle ID of the Isolated Web App.
Each item can also have optional fields: an IWA release/update channel name (update_channel) and a specific version to pin (pinned_version).
If the "update_channel" is not set, then the value of "default" will be used. When the pinned_version is specified, the system will attempt to install that specific version (if available on the current update channel).
By default, version pinning does not allow going back to older versions. Pinning an IWA to a specific version prevents it from being updated beyond that version. To unpin, remove this field.
example_value:
- update_manifest_url: https://example.com/isolated_web_app/update_manifest.json
web_bundle_id: aerugqztij5biqquuk3mfwpsaibuegaqcitgfchwuosuofdjabzqaaic
update_channel: beta
pinned_version: 1.2.3
features:
dynamic_refresh: true
per_profile: true
@@ -31,6 +36,13 @@ schema:
The name of the IWA's update/release channel. This value can be any string;
no restrictions are imposed. If no value is provided, the "default"
channel will be used.
pinned_version:
type: string
description: >-
Specifies the desired version of the IWA. If provided, the system will attempt to install this specific version and subsequently block any further updates.
To unpin the app and enable updates again, remove this field.
**Important:** If the provided version does not exist, the IWA will get stuck on the currently installed version.
This is because after trying (and it this case failing) to update to pinned version, pinning disables any further automatic updates.
required:
- update_manifest_url
- web_bundle_id
@@ -44,6 +44,7 @@ schema:
- keep_all
type: string
supported_on:
- chrome_os:110-
- chrome_os:110-130
tags: []
type: string-enum
deprecated: true
@@ -1,4 +1,5 @@
caption: Re-enable deprecated/removed Mutation Events
deprecated: true
default: false
desc: |-
This policy provides a temporary opt-back-in to a deprecated and removed set of platform events called Mutation Events.
@@ -0,0 +1,31 @@
caption: Show Outlook Calendar card on the New Tab Page
default: false
desc: |- # TODO(crbug.com/376287682): insert HC article link
This policy controls the visibility of the Outlook Card on the New Tab Page. The card will only be displayed on the New Tab Page if the policy is enabled and your organization authorized the usage of the Outlook Calendar data in the browser.
The Outlook card shows the next calendar event, along with a glanceable look at the rest of the day's meetings. It aims to address the issue of context switching and enhance productivity by giving users a shortcut to their next meeting.
The Microsoft Outlook card will require additional admin configuration. For detailed information on connecting the Chrome New Tab Page Card to Outlook, please see help article.
If the <ph name="NTPCARDSVISIBLE">NTPCardsVisible</ph> is disabled, the Outlook Card will not be shown. If <ph name="NTPCARDSVISIBLE">NTPCardsVisible</ph> is enabled, the Outlook card will be shown if this policy is also enabled and there is data to be shown. If <ph name="NTPCARDSVISIBLE">NTPCardsVisible</ph> is unset, the Outlook card will be shown if this policy is also enabled, the user has the card enabled in Customize Chrome, and there is data to be shown.
example_value: false
features:
dynamic_refresh: true
per_profile: true
future_on:
- chrome.*
- chrome_os
items:
- caption: Enable NTP Outlook Calendar Card
value: true
- caption: Disable NTP Outlook Calendar Card
value: false
owners:
- rtatum@google.com
- tiborg@chromium.org
- danpeng@google.com
- ftirelo@chromium.org
schema:
type: boolean
tags: []
type: main
@@ -0,0 +1,31 @@
caption: Show Sharepoint File Card on the New Tab Page
default: false
desc: |- # TODO(crbug.com/376287682): insert HC article link
This policy controls the visibility of the Sharepoint File Card on the New Tab Page. The card will only be displayed on the New Tab Page if the policy is enabled and your organization authorized the usage of the Sharepoint File data in the browser.
The Sharepoint Files recommendation card shows a list of recommended files. It aims to address the issue of context switching and enhance productivity by giving users a shortcut to their most important documents.
The Microsoft Sharepoint card will require additional admin configuration. For detailed information on connecting the Chrome New Tab Page Card to Sharepoint, please see help article.
If the <ph name="NTPCARDSVISIBLE">NTPCardsVisible</ph> is disabled, the Sharepoint Card will not be shown. If <ph name="NTPCARDSVISIBLE">NTPCardsVisible</ph> is enabled, the Sharepoint card will be shown if this policy is also enabled and there is data to be shown. If <ph name="NTPCARDSVISIBLE">NTPCardsVisible</ph> is unset, the Sharepoint card will be shown if this policy is also enabled, the user has the card enabled in Customize Chrome, and there is data to be shown.
example_value: false
features:
dynamic_refresh: true
per_profile: true
future_on:
- chrome.*
- chrome_os
items:
- caption: Enable NTP Sharepoint File Card
value: true
- caption: Disable NTP Sharepoint File Card
value: false
owners:
- rtatum@google.com
- tiborg@chromium.org
- danpeng@google.com
- ftirelo@chromium.org
schema:
type: boolean
tags: []
type: main
@@ -1,6 +1,7 @@
caption: Forces Native Client (NaCl) to be allowed to run.
default: false
default_for_enterprise_users: false
deprecated: true
desc: |-
Setting the policy to True allows Native Client to continue to run even if the default behavior is that Native Client is disabled.
Setting the policy to False will use the default behavior.
@@ -19,7 +20,7 @@ owners:
schema:
type: boolean
supported_on:
- chrome_os:116-
- chrome_os:116-131
- chrome.*:116-119
tags: []
type: main
@@ -51,6 +51,9 @@ schema:
type: string
type: object
type: array
future_on:
- android
- ios
supported_on:
- chrome.*:84-
- chrome_os:84-
@@ -5,6 +5,8 @@ owners:
caption: Manage the deprecated prefixed video fullscreen API's availability
desc: |-
Starting in M132, this policy will be removed, along with the prefixed video-specific fullscreen APIs.
Setting the policy to <ph name="ENABLED_VALUE_NAME">enabled</ph> will allow the prefixed video-specific fullscreen APIs (e.g. Video.webkitEnterFullscreen()) to be used from Javascript.
Setting the policy to <ph name="DISABLED_VALUE_NAME">disabled</ph> will prevent the prefixed video-specific fullscreen APIs from being used in Javascript, leaving only the standard fullscreen APIs (e.g. Element.requestFullscreen()).
@@ -13,16 +15,15 @@ desc: |-
If the policy is unset, the behavior defaults to <ph name="RUNTIME_ENABLED_VALUE_NAME">runtime-enabled</ph>.
Note: this policy is a temporary solution to help transition away from webkit-prefixed fullscreen APIs. It will tentatively be removed in M130, or in the few following releases.
Note: this policy is a temporary solution to help transition away from webkit-prefixed fullscreen APIs. M131 is the last release which will have this policy.
supported_on:
- android:124-
- chrome.*:124-
- chrome_os:124-
- fuchsia:124-
- android:124-131
- chrome.*:124-131
- chrome_os:124-131
- fuchsia:124-131
deprecated: false
deprecated: true
features:
dynamic_refresh: true
@@ -0,0 +1,38 @@
caption: Make SharedWorker blob URL behavior aligned with the specification
desc: |-
Upon https://w3c.github.io/ServiceWorker/#control-and-use-worker-client,
workers should inherit controllers for the blob URL. However, existing code
allows only DedicatedWorkers to inherit the controller, and SharedWorkers do
not inherit the controller.
Setting the policy to Enabled or leaving it unset means
<ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> inherit the controller
if a blob URL is used as a SharedWorker URL.
Setting the policy to Disabled leaves the behavior not aligned with the
specification as-is.
This policy is intended to be temporary and will be removed in the future.
default: true
example_value: true
features:
dynamic_refresh: false
per_profile: true
items:
- caption: A blob URL SharedWorker inherits a controller.
value: true
- caption: A blob URL SharedWorker does not inherit a controller. (legacy behavior)
value: false
owners:
- yyanagisawa@chromium.org
- file://content/browser/worker_host/OWNERS
schema:
type: boolean
supported_on:
- android:132-
- chrome.*:132-
- chrome_os:132-
- fuchsia:132-
tags: []
type: main
@@ -1,5 +1,8 @@
caption: Enable third party software injection blocking
deprecated: true
desc: |-
This policy is deprecated.
Setting the policy to Enabled or leaving it unset prevents third-party software from injecting executable code into <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>'s processes.
Setting the policy to Disabled allows this software to inject such code into <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>'s processes.
@@ -0,0 +1,25 @@
caption: Allow Translator API
default: true
desc: |-
Setting the policy to Enabled or leaving it unset allows the use of Translator API in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.
Setting the policy to Disabled disallows the use of Translator API.
example_value: true
features:
dynamic_refresh: true
per_profile: true
items:
- caption: Allows the use of Translator API
value: true
- caption: Disallows the use of Translator API
value: false
owners:
- file://chrome/browser/ai/OWNERS
schema:
type: boolean
supported_on:
- chrome.win:132-
- chrome.mac:132-
- chrome.linux:132-
tags: []
type: main
@@ -26,7 +26,6 @@ items:
value: 3
owners:
- bkersting@google.com
- kerker@chromium.org
- chungsheng@google.com
- byronlee@chromium.org
- chromeos-oem-services@google.com
@@ -0,0 +1,30 @@
arc_support: This policy has no effect on Android apps.
caption: Enable saving passkeys to the password manager
desc: |-
This policy controls the browser's ability to save passkeys in the built-in password manager. It does not limit access to, or change the contents of, passkeys already saved in the password manager. If the <ph name="POLICY_NAME">PasswordManagerEnabled</ph> policy is set to Disabled then saving in the built-in password manager is disabled in general, including passkeys and passwords, and thus this policy is not applicable.
Setting the policy to Enabled or leaving unset means that users can save passkeys in the built-in password manager if signed into <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.
Setting the policy to Disabled means users can't save passkeys to the built-in password manager, but previously saved passkeys will still work.
default: true
example_value: false
features:
can_be_recommended: false
dynamic_refresh: true
per_profile: true
items:
- caption: Enable saving passkeys using the password manager
value: true
- caption: Disable saving passkeys using the password manager
value: false
owners:
- file://components/policy/OWNERS
- markusheintz@chromium.org
- agl@chromium.org
schema:
type: boolean
supported_on:
- chrome.*:132-
- chrome_os:132-
tags: []
type: main
@@ -30,7 +30,7 @@ items:
- caption: Block switching to a third-party password manager
value: false
owners:
- fhorschig@chromium.org
- friedrichh@chromium.org
- file://components/android_autofill/OWNERS
- file://components/autofill/android/OWNERS
schema:
@@ -6,3 +6,4 @@ PasswordManager:
- PasswordManagerAllowShowPasswords
- PasswordSharingEnabled
- ThirdPartyPasswordManagersAllowed
- PasswordManagerPasskeysEnabled
@@ -27,7 +27,6 @@ features:
per_profile: false
owners:
- bkersting@google.com
- kerker@chromium.org
- chungsheng@google.com
- byronlee@chromium.org
- chromeos-oem-services@google.com
@@ -19,7 +19,6 @@ items:
value: false
owners:
- bkersting@google.com
- kerker@chromium.org
- chungsheng@google.com
- byronlee@chromium.org
- chromeos-oem-services@google.com
@@ -10,7 +10,6 @@ features:
per_profile: false
owners:
- bkersting@google.com
- kerker@chromium.org
- chungsheng@google.com
- byronlee@chromium.org
- chromeos-oem-services@google.com
@@ -10,7 +10,6 @@ features:
per_profile: false
owners:
- bkersting@google.com
- kerker@chromium.org
- chungsheng@google.com
- byronlee@chromium.org
- chromeos-oem-services@google.com
@@ -29,7 +29,6 @@ items:
value: 5
owners:
- bkersting@google.com
- kerker@chromium.org
- chungsheng@google.com
- byronlee@chromium.org
- chromeos-oem-services@google.com
@@ -17,7 +17,6 @@ items:
value: false
owners:
- bkersting@google.com
- kerker@chromium.org
- chungsheng@google.com
- byronlee@chromium.org
- chromeos-oem-services@google.com
@@ -10,7 +10,6 @@ features:
per_profile: false
owners:
- bkersting@google.com
- kerker@chromium.org
- chungsheng@google.com
- byronlee@chromium.org
- chromeos-oem-services@google.com
@@ -33,7 +33,6 @@ features:
per_profile: false
owners:
- bkersting@google.com
- kerker@chromium.org
- chungsheng@google.com
- byronlee@chromium.org
- chromeos-oem-services@google.com
@@ -17,7 +17,6 @@ items:
value: false
owners:
- bkersting@google.com
- kerker@chromium.org
- chungsheng@google.com
- byronlee@chromium.org
- chromeos-oem-services@google.com
@@ -21,7 +21,6 @@ items:
value: false
owners:
- bkersting@google.com
- kerker@chromium.org
- chungsheng@google.com
- byronlee@chromium.org
- chromeos-oem-services@google.com
@@ -30,7 +30,7 @@ schema:
- "google_drive"
- "microsoft_onedrive"
- "read_only"
future_on:
- chrome_os
supported_on:
- chrome_os:132-
tags: []
type: string-enum
@@ -16,7 +16,6 @@ items:
value: false
owners:
- bkersting@google.com
- kerker@chromium.org
- chungsheng@google.com
- byronlee@chromium.org
- chromeos-oem-services@google.com
@@ -14,7 +14,6 @@ features:
max_size: 1000000
owners:
- bkersting@google.com
- kerker@chromium.org
- chungsheng@google.com
- byronlee@chromium.org
- chromeos-oem-services@google.com
File diff suppressed because it is too large Load Diff
@@ -46,6 +46,7 @@
#include "ui/gfx/switches.h"
#include "ui/gl/gl_switches.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/native_theme_utils.h"
#if BUILDFLAG(IS_ANDROID)
#include "base/android/build_info.h"
@@ -169,7 +170,7 @@ void SetRuntimeFeatureFromChromiumFeature(const base::Feature& chromium_feature,
}
break;
default:
NOTREACHED_IN_MIGRATION();
NOTREACHED();
}
}
@@ -186,10 +187,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
blinkFeatureToBaseFeatureMapping[] = {
{wf::EnableAccessibilityAriaVirtualContent,
raw_ref(features::kEnableAccessibilityAriaVirtualContent)},
#if BUILDFLAG(IS_ANDROID)
{wf::EnableAccessibilityPageZoom,
raw_ref(features::kAccessibilityPageZoom)},
#endif
{wf::EnableAccessibilityUseAXPositionForDocumentMarkers,
raw_ref(features::kUseAXPositionForDocumentMarkers)},
{wf::EnableAOMAriaRelationshipProperties,
@@ -214,7 +211,8 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
{wf::EnableFedCm, raw_ref(features::kFedCm), kSetOnlyIfOverridden},
{wf::EnableFedCmButtonMode, raw_ref(features::kFedCmButtonMode),
kSetOnlyIfOverridden},
{wf::EnableFedCmAuthz, raw_ref(features::kFedCmAuthz), kDefault},
{wf::EnableFedCmAuthz, raw_ref(features::kFedCmAuthz),
kSetOnlyIfOverridden},
{wf::EnableFedCmIdPRegistration,
raw_ref(features::kFedCmIdPRegistration), kDefault},
{wf::EnableFedCmIdpSigninStatus,
@@ -270,8 +268,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
raw_ref(features::kPeriodicBackgroundSync)},
{wf::EnablePushMessagingSubscriptionChange,
raw_ref(features::kPushSubscriptionChangeEvent)},
{wf::EnableRestrictGamepadAccess,
raw_ref(features::kRestrictGamepadAccess)},
{wf::EnableSecurePaymentConfirmation,
raw_ref(features::kSecurePaymentConfirmation)},
{wf::EnableSecurePaymentConfirmationDebug,
@@ -315,6 +311,8 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
raw_ref(device::features::kWebXrIncubations)},
{wf::EnableWebXRFrameRate,
raw_ref(device::features::kWebXrIncubations)},
{wf::EnableWebXRGPUBinding,
raw_ref(device::features::kWebXrIncubations)},
{wf::EnableWebXRHandInput,
raw_ref(device::features::kWebXrHandInput)},
{wf::EnableWebXRImageTracking,
@@ -409,8 +407,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
raw_ref(features::kTouchTextEditingRedesign)},
{"TrustedTypesFromLiteral",
raw_ref(features::kTrustedTypesFromLiteral)},
{"WebSerialBluetooth",
raw_ref(features::kEnableBluetoothSerialPortProfileInSerialApi)},
{"MediaStreamTrackTransfer",
raw_ref(features::kMediaStreamTrackTransfer)},
{"PrivateNetworkAccessPermissionPrompt",
@@ -538,7 +534,9 @@ void SetCustomizedRuntimeFeaturesFromCombinedArgs(
// These checks are custom wrappers around base::FeatureList::IsEnabled
// They're moved here to distinguish them from actual base checks
#if !BUILDFLAG(IS_CHROMEOS)
WebRuntimeFeatures::EnableOverlayScrollbars(ui::IsOverlayScrollbarEnabled());
#endif
WebRuntimeFeatures::EnableFluentScrollbars(ui::IsFluentScrollbarEnabled());
WebRuntimeFeatures::EnableFluentOverlayScrollbars(
ui::IsFluentOverlayScrollbarEnabled());
@@ -697,7 +695,8 @@ void ResolveInvalidConfigurations() {
}
if (!base::FeatureList::IsEnabled(blink::features::kInterestGroupStorage)) {
LOG_IF(WARNING, WebRuntimeFeatures::IsAdInterestGroupAPIEnabled())
LOG_IF(WARNING,
WebRuntimeFeatures::IsAdInterestGroupAPIEnabledByRuntimeFlag())
<< "AdInterestGroupAPI cannot be enabled in this "
"configuration. Use --"
<< switches::kEnableFeatures << "="
@@ -706,22 +705,11 @@ void ResolveInvalidConfigurations() {
WebRuntimeFeatures::EnableFledge(false);
}
if (base::FeatureList::IsEnabled(
features::kCookieDeprecationFacilitatedTesting)) {
WebRuntimeFeatures::EnableFledgeMultiBid(false);
WebRuntimeFeatures::EnableFledgeRealTimeReporting(false);
if (!base::FeatureList::IsEnabled(
blink::features::
kAlwaysAllowFledgeDeprecatedRenderURLReplacements)) {
WebRuntimeFeatures::EnableFledgeDeprecatedRenderURLReplacements(false);
}
}
// PermissionElement cannot be enabled without the support of the
// browser process.
if (!base::FeatureList::IsEnabled(blink::features::kPermissionElement)) {
LOG_IF(WARNING, WebRuntimeFeatures::IsPermissionElementEnabled())
LOG_IF(WARNING,
WebRuntimeFeatures::IsPermissionElementEnabledByRuntimeFlag())
<< "PermissionElement cannot be enabled in this configuration. Use --"
<< switches::kEnableFeatures << "="
<< blink::features::kPermissionElement.name << " instead.";
@@ -14,6 +14,7 @@
#include "base/functional/callback_helpers.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/supports_user_data.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/values.h"
@@ -21,6 +22,7 @@
#include "build/buildflag.h"
#include "build/chromeos_buildflags.h"
#include "content/browser/ai/echo_ai_manager_impl.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/public/browser/anchor_element_preconnect_delegate.h"
#include "content/public/browser/authenticator_request_client_delegate.h"
#include "content/public/browser/browser_context.h"
@@ -238,7 +240,11 @@ ContentBrowserClient::DetermineAddressSpaceFromURL(const GURL& url) {
return network::mojom::IPAddressSpace::kUnknown;
}
bool ContentBrowserClient::LogWebUIUrl(const GURL& web_ui_url) {
bool ContentBrowserClient::LogWebUICreated(const GURL& web_ui_url) {
return false;
}
bool ContentBrowserClient::LogWebUIShown(const GURL& web_ui_url) {
return false;
}
@@ -475,6 +481,11 @@ bool ContentBrowserClient::AllowCompressionDictionaryTransport(
return true;
}
bool ContentBrowserClient::AllowSharedWorkerBlobURLFix(
BrowserContext* context) {
return true;
}
bool ContentBrowserClient::OverrideWebPreferencesAfterNavigation(
WebContents* web_contents,
blink::web_pref::WebPreferences* prefs) {
@@ -544,6 +555,7 @@ std::string ContentBrowserClient::GetWebBluetoothBlocklist() {
}
bool ContentBrowserClient::IsInterestGroupAPIAllowed(
content::BrowserContext* browser_context,
content::RenderFrameHost* render_frame_host,
InterestGroupApiOperation operation,
const url::Origin& top_frame_origin,
@@ -622,6 +634,14 @@ bool ContentBrowserClient::IsSharedStorageSelectURLAllowed(
return false;
}
bool ContentBrowserClient::IsFencedStorageReadAllowed(
content::BrowserContext* browser_context,
content::RenderFrameHost* rfh,
const url::Origin& top_frame_origin,
const url::Origin& accessing_origin) {
return false;
}
bool ContentBrowserClient::IsPrivateAggregationAllowed(
content::BrowserContext* browser_context,
const url::Origin& top_frame_origin,
@@ -926,14 +946,6 @@ void ContentBrowserClient::RemovePresentationObserver(
PresentationObserver* observer,
WebContents* web_contents) {}
bool ContentBrowserClient::AddPrivacySandboxAttestationsObserver(
PrivacySandboxAttestationsObserver* observer) {
return true;
}
void ContentBrowserClient::RemovePrivacySandboxAttestationsObserver(
PrivacySandboxAttestationsObserver* observer) {}
void ContentBrowserClient::OpenURL(
content::SiteInstance* site_instance,
const content::OpenURLParams& params,
@@ -1092,7 +1104,7 @@ void ContentBrowserClient::CreateWebSocket(
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
handshake_client) {
// NOTREACHED because WillInterceptWebSocket returns false.
NOTREACHED_IN_MIGRATION();
NOTREACHED();
}
void ContentBrowserClient::WillCreateWebTransport(
@@ -1770,9 +1782,9 @@ bool ContentBrowserClient::ShouldSuppressAXLoadComplete(RenderFrameHost* rfh) {
void ContentBrowserClient::BindAIManager(
BrowserContext* browser_context,
std::variant<RenderFrameHost*, base::SupportsUserData*> context,
base::SupportsUserData* context_user_data,
mojo::PendingReceiver<blink::mojom::AIManager> receiver) {
EchoAIManagerImpl::Create(context, std::move(receiver));
EchoAIManagerImpl::Create(*context_user_data, std::move(receiver));
}
#if !BUILDFLAG(IS_ANDROID)
@@ -1795,17 +1807,6 @@ bool ContentBrowserClient::IsSaveableNavigation(
void ContentBrowserClient::OnUiaProviderRequested(bool uia_provider_enabled) {}
#endif
base::ReadOnlySharedMemoryRegion
ContentBrowserClient::GetPerformanceScenarioRegionForProcess(
RenderProcessHost* process_host) {
return base::ReadOnlySharedMemoryRegion();
}
base::ReadOnlySharedMemoryRegion
ContentBrowserClient::GetGlobalPerformanceScenarioRegion() {
return base::ReadOnlySharedMemoryRegion();
}
bool ContentBrowserClient::AllowNonActivatedCrossOriginPaintHolding() {
return false;
}
@@ -382,7 +382,8 @@
required,
richlyEditable,
vertical,
visited
visited,
hasActions
};
// All possible actions that can be performed on automation nodes.
@@ -476,8 +477,9 @@
caption,
contents,
cssAltText,
interestTarget,
placeholder,
popoverAttribute,
popoverTarget,
prohibited,
prohibitedAndRedundant,
relatedElement,
@@ -489,7 +491,8 @@
ariaDescription,
attributeExplicitlyEmpty,
buttonLabel,
popoverAttribute,
interestTarget,
popoverTarget,
prohibitedNameRepair,
relatedElement,
rubyAnnotation,
@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Private API for HDMI CEC functionality.
[platforms=("chromeos", "lacros")]
[platforms=("chromeos")]
namespace cecPrivate {
enum DisplayCecPowerState {
@@ -6,7 +6,7 @@
// access data of the clipboard. This is a temporary solution for
// chromeos platform apps until open-web alternative is available. It will be
// deprecated once open-web solution is available, which could be in 2017 Q4.
[platforms=("chromeos", "lacros"),
[platforms=("chromeos"),
implemented_in="extensions/browser/api/clipboard/clipboard_api.h"]
namespace clipboard {
// Supported image types.
@@ -29,7 +29,7 @@ namespace power {
// Reports a user activity in order to awake the screen from a dimmed or
// turned off state or from a screensaver. Exits the screensaver if it is
// currently active.
[platforms=("chromeos", "lacros")] static void reportActivity(
[platforms=("chromeos")] static void reportActivity(
optional VoidCallback callback);
};
};
@@ -4,7 +4,7 @@
// The <code>chrome.virtualKeyboard</code> API is a kiosk only API used to
// configure virtual keyboard layout and behavior in kiosk sessions.
[platforms=("chromeos", "lacros")]
[platforms=("chromeos")]
namespace virtualKeyboard {
// <p>Determines whether advanced virtual keyboard features should be enabled
// or not. They are enabled by default.</p>
+3 -10
View File
@@ -340,6 +340,9 @@ void SetFlags(IsolateHolder::ScriptMode mode,
SetV8FlagsIfOverridden(features::kV8ExternalMemoryAccountedInGlobalLimit,
"--external-memory-accounted-in-global-limit",
"--no-external-memory-accounted-in-global-limit");
SetV8FlagsIfOverridden(features::kV8GCSpeedUsesCounters,
"--gc-speed-uses-counters",
"--no-gc-speed-uses-counters");
SetV8FlagsIfOverridden(features::kV8TurboFastApiCalls,
"--turbo-fast-api-calls", "--no-turbo-fast-api-calls");
SetV8FlagsIfOverridden(features::kV8MegaDomIC, "--mega-dom-ic",
@@ -443,16 +446,6 @@ void SetFlags(IsolateHolder::ScriptMode mode,
SetV8FlagsFormatted("--no-efficiency-mode-for-tiering-heuristics");
}
if (base::FeatureList::IsEnabled(
features::kWebAssemblyMoreAggressiveCodeCaching)) {
SetV8FlagsFormatted(
"--wasm-caching-threshold=%d --wasm-caching-hard-threshold=%d "
"--wasm-caching-timeout-ms=%d",
features::kWebAssemblyMoreAggressiveCodeCachingThreshold.Get(),
features::kWebAssemblyMoreAggressiveCodeCachingHardThreshold.Get(),
features::kWebAssemblyMoreAggressiveCodeCachingTimeoutMs.Get());
}
// Make sure aliases of kV8SlowHistograms only enable the feature to
// avoid contradicting settings between multiple finch experiments.
bool any_slow_histograms_alias =
@@ -17,6 +17,7 @@
#include "base/build_time.h"
#include "base/callback_list.h"
#include "base/check.h"
#include "base/check_op.h"
#include "base/command_line.h"
#include "base/containers/unique_ptr_adapters.h"
#include "base/dcheck_is_on.h"
@@ -89,6 +90,7 @@
#include "net/http/http_request_headers.h"
#include "net/http/http_server_properties.h"
#include "net/http/http_transaction_factory.h"
#include "net/log/net_log_source_type.h"
#include "net/net_buildflags.h"
#include "net/proxy_resolution/configured_proxy_resolution_service.h"
#include "net/proxy_resolution/proxy_config.h"
@@ -219,14 +221,16 @@ class WrappedTestingCertVerifier : public net::CertVerifier {
std::unique_ptr<Request>* out_req,
const net::NetLogWithSource& net_log) override {
verify_result->Reset();
if (!g_cert_verifier_for_testing)
if (!g_cert_verifier_for_testing) {
return net::ERR_FAILED;
}
return g_cert_verifier_for_testing->Verify(
params, verify_result, std::move(callback), out_req, net_log);
}
void SetConfig(const Config& config) override {
if (!g_cert_verifier_for_testing)
if (!g_cert_verifier_for_testing) {
return;
}
g_cert_verifier_for_testing->SetConfig(config);
}
void AddObserver(Observer* observer) override {
@@ -340,8 +344,9 @@ bool MatchesDomainFilter(mojom::ClearDataFilter_Type filter_type,
// must contain no origins. A null filter matches everything.
base::RepeatingCallback<bool(const std::string& host_name)> MakeDomainFilter(
mojom::ClearDataFilter* filter) {
if (!filter)
if (!filter) {
return base::BindRepeating([](const std::string&) { return true; });
}
DCHECK(filter->origins.empty())
<< "Origin filtering not allowed in a domain-only filter";
@@ -430,8 +435,9 @@ class NetworkContextApplicationStatusListener
}
void Notify(base::android::ApplicationState state) override {
if (callback_)
if (callback_) {
callback_.Run(state);
}
}
private:
@@ -501,8 +507,9 @@ void SCTAuditingDelegate::MaybeEnqueueReport(
const net::X509Certificate* validated_certificate_chain,
const net::SignedCertificateTimestampAndStatusList&
signed_certificate_timestamps) {
if (!context_)
if (!context_) {
return;
}
context_->MaybeEnqueueSCTReport(host_port_pair, validated_certificate_chain,
signed_certificate_timestamps);
}
@@ -516,13 +523,15 @@ bool GetFullDataFilePath(
std::optional<base::FilePath> network::mojom::NetworkContextFilePaths::*
field_name,
base::FilePath& full_path) {
if (!file_paths)
if (!file_paths) {
return false;
}
std::optional<base::FilePath> relative_file_path =
file_paths.get()->*field_name;
if (!relative_file_path.has_value())
if (!relative_file_path.has_value()) {
return false;
}
// Path to a data file should always be a plain filename.
DCHECK_EQ(relative_file_path->BaseName(), *relative_file_path);
@@ -578,6 +587,23 @@ mojom::URLLoaderFactoryParamsPtr CreateURLLoaderFactoryParamsForPrefetch() {
return params;
}
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
//
// LINT.IfChange(HSTSRedirectUpgradeReason)
enum class HSTSRedirectUpgradeReason {
kNotUpgradedNotHTTP = 0,
kNotUpgradedHSTSUnavailable = 1,
kNotUpgradedNoHSTSPin = 2,
kUpgraded = 3,
kMaxValue = kUpgraded,
};
// LINT.ThenChange(//tools/metrics/histograms/metadata/net/enums.xml:HSTSRedirectUpgradeReason)
void RecordHSTSPreconnectUpgradeReason(HSTSRedirectUpgradeReason reason) {
base::UmaHistogramEnumeration("Net.PreconnectHSTSUpgradesUrl", reason);
}
} // namespace
constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess;
@@ -639,7 +665,8 @@ NetworkContext::NetworkContext(
http_auth_merged_preferences_(network_service),
ohttp_handler_(this),
prefetch_enabled_(
base::FeatureList::IsEnabled(features::kNetworkContextPrefetch)),
base::FeatureList::IsEnabled(features::kNetworkContextPrefetch) &&
(params_->bound_network == net::handles::kInvalidNetworkHandle)),
cors_non_wildcard_request_headers_support_(base::FeatureList::IsEnabled(
features::kCorsNonWildcardRequestHeadersSupport)),
prefetch_cache_(prefetch_enabled_ ? std::make_unique<PrefetchCache>()
@@ -753,8 +780,9 @@ NetworkContext::NetworkContext(
params_->split_auth_cache_by_network_anonymization_key);
#if BUILDFLAG(IS_CT_SUPPORTED)
if (params_->ct_policy)
if (params_->ct_policy) {
SetCTPolicy(std::move(params_->ct_policy));
}
base::FilePath sct_auditing_path;
GetFullDataFilePath(params_->file_paths,
@@ -767,8 +795,9 @@ NetworkContext::NetworkContext(
#endif // BUILDFLAG(IS_CT_SUPPORTED)
#if BUILDFLAG(IS_ANDROID)
if (params_->cookie_manager)
if (params_->cookie_manager) {
GetCookieManager(std::move(params_->cookie_manager));
}
#endif // BUILDFLAG(IS_ANDROID)
CreateURLLoaderFactoryForCertNetFetcher(
@@ -815,16 +844,20 @@ NetworkContext::NetworkContext(
http_auth_merged_preferences_(network_service),
ohttp_handler_(this),
prefetch_enabled_(
base::FeatureList::IsEnabled(features::kNetworkContextPrefetch)),
base::FeatureList::IsEnabled(features::kNetworkContextPrefetch) &&
(url_request_context_->bound_network() ==
net::handles::kInvalidNetworkHandle)),
prefetch_cache_(prefetch_enabled_ ? std::make_unique<PrefetchCache>()
: nullptr) {
// May be nullptr in tests.
if (network_service_)
if (network_service_) {
network_service_->RegisterNetworkContext(this);
}
resource_scheduler_ = std::make_unique<ResourceScheduler>();
for (const auto& key : cors_exempt_header_list)
for (const auto& key : cors_exempt_header_list) {
cors_exempt_header_list_.insert(key);
}
acam_preflight_spec_conformant_ = base::FeatureList::IsEnabled(
network::features::
@@ -843,8 +876,9 @@ NetworkContext::~NetworkContext() {
network_service_->DeregisterNetworkContext(this);
}
if (domain_reliability_monitor_)
if (domain_reliability_monitor_) {
domain_reliability_monitor_->Shutdown();
}
// Because of the order of declaration in the class,
// domain_reliability_monitor_ will be destroyed before
// |url_loader_factories_| which could own URLLoader's whose destructor call
@@ -987,10 +1021,12 @@ void NetworkContext::ResetURLLoaderFactories() {
// invalidate the iterator if the factory gets deleted.
std::vector<PrefetchMatchingURLLoaderFactory*> factories;
factories.reserve(url_loader_factories_.size());
for (const auto& factory : url_loader_factories_)
for (const auto& factory : url_loader_factories_) {
factories.push_back(factory.get());
for (auto* factory : factories)
}
for (auto* factory : factories) {
factory->ClearBindings();
}
}
void NetworkContext::GetViaObliviousHttp(
@@ -1187,8 +1223,9 @@ void NetworkContext::LoaderDestroyed(uint32_t process_id) {
auto it = loader_count_per_process_.find(process_id);
CHECK(it != loader_count_per_process_.end(), base::NotFatalUntil::M130);
it->second -= 1;
if (it->second == 0)
if (it->second == 0) {
loader_count_per_process_.erase(it);
}
}
bool NetworkContext::CanCreateLoader(uint32_t process_id) {
@@ -1199,10 +1236,12 @@ bool NetworkContext::CanCreateLoader(uint32_t process_id) {
size_t NetworkContext::GetNumOutstandingResolveHostRequestsForTesting() const {
size_t sum = 0;
if (internal_host_resolver_)
if (internal_host_resolver_) {
sum += internal_host_resolver_->GetNumOutstandingRequestsForTesting();
for (const auto& host_resolver : host_resolvers_)
}
for (const auto& host_resolver : host_resolvers_) {
sum += host_resolver->GetNumOutstandingRequestsForTesting(); // IN-TEST
}
return sum;
}
@@ -1271,8 +1310,9 @@ void NetworkContext::ClearNetworkingHistoryBetween(
// commited to disk. They probably should, as most similar methods net/
// exposes do.
// May not be set in all tests.
if (network_qualities_pref_delegate_)
if (network_qualities_pref_delegate_) {
network_qualities_pref_delegate_->ClearPrefs();
}
url_request_context_->http_server_properties()->Clear(barrier);
}
@@ -1427,8 +1467,9 @@ void NetworkContext::SendReportsAndRemoveSource(
DCHECK(!reporting_source.is_empty());
net::ReportingService* reporting_service =
url_request_context()->reporting_service();
if (reporting_service)
if (reporting_service) {
reporting_service->SendReportsAndRemoveSource(reporting_source);
}
#endif // BUILDFLAG(ENABLE_REPORTING)
}
@@ -1504,8 +1545,9 @@ void NetworkContext::QueueSignedExchangeReport(
net::NetworkErrorLoggingService* logging_service =
url_request_context_->network_error_logging_service();
if (!logging_service)
if (!logging_service) {
return;
}
std::string user_agent;
if (url_request_context_->http_user_agent_settings() != nullptr) {
user_agent =
@@ -1665,8 +1707,9 @@ void NetworkContext::SetEnableReferrers(bool enable_referrers) {
#if BUILDFLAG(IS_CT_SUPPORTED)
void NetworkContext::SetCTPolicy(mojom::CTPolicyPtr ct_policy) {
if (!require_ct_delegate_)
if (!require_ct_delegate_) {
return;
}
require_ct_delegate_->UpdateCTPolicies(ct_policy->excluded_hosts,
ct_policy->excluded_spkis);
@@ -1696,8 +1739,9 @@ int NetworkContext::CheckCTRequirementsForSignedExchange(
case net::TransportSecurityState::CT_NOT_REQUIRED:
// CT is not required if the certificate does not chain to a publicly
// trusted root certificate.
if (!cert_verify_result.is_issued_by_known_root)
if (!cert_verify_result.is_issued_by_known_root) {
return net::OK;
}
// For old certificates (issued before 2018-05-01),
// CheckCTRequirements() may return CT_NOT_REQUIRED, so we check the
// compliance status here.
@@ -1867,8 +1911,9 @@ void NetworkContext::CreateWebSocket(
mojo::PendingRemote<mojom::TrustedHeaderClient> header_client,
const std::optional<base::UnguessableToken>& throttling_profile_id) {
#if BUILDFLAG(ENABLE_WEBSOCKETS)
if (!websocket_factory_)
if (!websocket_factory_) {
websocket_factory_ = std::make_unique<WebSocketFactory>(this);
}
DCHECK_GE(process_id, 0);
@@ -1998,8 +2043,9 @@ void NetworkContext::VerifyCertForSignedExchange(
net::NetLogSourceType::CERT_VERIFIER_JOB));
cert_verifier_requests_[cert_verify_id] = std::move(pending_cert_verify);
if (result != net::ERR_IO_PENDING)
if (result != net::ERR_IO_PENDING) {
OnVerifyCertForSignedExchangeComplete(cert_verify_id, result);
}
}
void NetworkContext::NotifyExternalCacheHit(const GURL& url,
@@ -2008,8 +2054,9 @@ void NetworkContext::NotifyExternalCacheHit(const GURL& url,
bool include_credentials) {
net::HttpCache* cache =
url_request_context_->http_transaction_factory()->GetCache();
if (!cache)
if (!cache) {
return;
}
cache->OnExternalCacheHit(url, http_method, key, include_credentials);
}
@@ -2165,23 +2212,27 @@ void NetworkContext::VerifyCertificateForTesting(
result,
base::BindOnce(TestVerifyCertCallback, std::move(state),
std::move(callback)),
request, net::NetLogWithSource());
request,
net::NetLogWithSource::Make(net::NetLog::Get(),
net::NetLogSourceType::NONE));
}
void NetworkContext::PreconnectSockets(
uint32_t num_streams,
const GURL& original_url,
mojom::CredentialsMode credentials_mode,
const net::NetworkAnonymizationKey& network_anonymization_key) {
const net::NetworkAnonymizationKey& network_anonymization_key,
const net::MutableNetworkTrafficAnnotationTag& traffic_annotation) {
DCHECK(!require_network_anonymization_key_ ||
!network_anonymization_key.IsEmpty());
GURL url = GetHSTSRedirect(original_url);
GURL url = GetHSTSRedirectForPreconnect(original_url);
// |PreconnectSockets| may receive arguments from the renderer, which is not
// guaranteed to validate them.
if (num_streams == 0)
if (num_streams == 0) {
return;
}
// Preconnect is disallowed if network access is disabled for the nonce.
if (network_anonymization_key.GetNonce().has_value() &&
@@ -2200,6 +2251,7 @@ void NetworkContext::PreconnectSockets(
request_info.method = net::HttpRequestHeaders::kGetMethod;
request_info.extra_headers.SetHeader(net::HttpRequestHeaders::kUserAgent,
user_agent);
request_info.traffic_annotation = traffic_annotation;
switch (credentials_mode) {
case mojom::CredentialsMode::kOmit:
@@ -2255,12 +2307,13 @@ void NetworkContext::CreateP2PSocketManager(
void NetworkContext::CreateMdnsResponder(
mojo::PendingReceiver<mojom::MdnsResponder> responder_receiver) {
#if BUILDFLAG(ENABLE_MDNS)
if (!mdns_responder_manager_)
if (!mdns_responder_manager_) {
mdns_responder_manager_ = std::make_unique<MdnsResponderManager>();
}
mdns_responder_manager_->CreateMdnsResponder(std::move(responder_receiver));
#else
NOTREACHED_IN_MIGRATION();
NOTREACHED();
#endif // BUILDFLAG(ENABLE_MDNS)
}
@@ -2356,10 +2409,11 @@ void NetworkContext::LookupServerBasicAuthCredentials(
net::HttpAuthCache::Entry* entry = http_auth_cache->LookupByPath(
url::SchemeHostPort(url), net::HttpAuth::AUTH_SERVER,
network_anonymization_key, url.path());
if (entry && entry->scheme() == net::HttpAuth::AUTH_SCHEME_BASIC)
if (entry && entry->scheme() == net::HttpAuth::AUTH_SCHEME_BASIC) {
std::move(callback).Run(entry->credentials());
else
} else {
std::move(callback).Run(std::nullopt);
}
}
#if BUILDFLAG(IS_CHROMEOS_ASH)
@@ -2394,10 +2448,11 @@ void NetworkContext::LookupProxyAuthCredentials(
net::HttpAuthCache::Entry* entry = http_auth_cache->Lookup(
scheme_host_port, net::HttpAuth::AUTH_PROXY, realm, net_scheme,
net::NetworkAnonymizationKey());
if (entry)
if (entry) {
std::move(callback).Run(entry->credentials());
else
} else {
std::move(callback).Run(std::nullopt);
}
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
@@ -2538,26 +2593,29 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
// Decide which ProxyDelegate to create. At most one of these will be the
// case for any given NetworkContext: either PrefetchProxy, handling its
// custom proxy configs, or IpProtection, using the proxy allowlist.
// TODO(https://crbug.com/40947771): Once the WebView traffic experiment is
// done, we should only create an IpProtectionProxyDelegate when
// `params_->ip_protection_config_getter` is set (to avoid creating
// proxynetwork_conte delegates for network contexts that don't participate in
// IP Protection, or for any network context when the IP Protection feature is
// disabled).
auto* nspal = network_service_->masked_domain_list_manager();
auto* mdl_manager = network_service_->masked_domain_list_manager();
std::unique_ptr<ip_protection::IpProtectionControlMojo>
ip_protection_control_mojo;
if (!params_->initial_custom_proxy_config && nspal->IsEnabled()) {
auto ipp_core = std::make_unique<ip_protection::IpProtectionCoreImpl>(
std::make_unique<ip_protection::IpProtectionConfigGetterMojoImpl>(
std::move(params_->ip_protection_config_getter)),
params_->enable_ip_protection);
bool requires_ipp_proxy_delegate =
mdl_manager->IsEnabled() &&
(params_->ip_protection_core_host ||
net::features::kIpPrivacyAlwaysCreateCore.Get());
if (requires_ipp_proxy_delegate) {
CHECK(!params_->initial_custom_proxy_config);
CHECK(!params_->custom_proxy_config_client_receiver);
auto ip_protection_core_impl =
std::make_unique<ip_protection::IpProtectionCoreImpl>(
std::make_unique<ip_protection::IpProtectionConfigGetterMojoImpl>(
std::move(params_->ip_protection_core_host)),
mdl_manager, params_->enable_ip_protection);
ip_protection_control_mojo =
std::make_unique<ip_protection::IpProtectionControlMojo>(
std::move(params_->ip_protection_control), ipp_core.get());
std::move(params_->ip_protection_control),
ip_protection_core_impl.get());
builder.set_proxy_delegate(
std::make_unique<ip_protection::IpProtectionProxyDelegate>(
nspal, std::move(ipp_core)));
ip_protection_core_impl.get()));
ip_protection_core_ = std::move(ip_protection_core_impl);
} else if (params_->initial_custom_proxy_config ||
params_->custom_proxy_config_client_receiver) {
builder.set_proxy_delegate(std::make_unique<NetworkServiceProxyDelegate>(
@@ -2589,8 +2647,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
std::unique_ptr<net::CookieMonster> cookie_store =
std::make_unique<net::CookieMonster>(session_cleanup_cookie_store.get(),
net_log);
if (params_->persist_session_cookies)
if (params_->persist_session_cookies) {
cookie_store->SetPersistSessionCookies(true);
}
builder.SetCookieStore(std::move(cookie_store));
}
@@ -2792,8 +2851,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
net::HttpNetworkSessionParams session_params;
bool is_quic_force_disabled = false;
if (network_service_ && network_service_->quic_disabled())
if (network_service_ && network_service_->quic_disabled()) {
is_quic_force_disabled = true;
}
auto quic_context = std::make_unique<net::QuicContext>();
network_session_configurator::ParseCommandLineAndFieldTrials(
@@ -2865,6 +2925,20 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
#if BUILDFLAG(ENABLE_DEVICE_BOUND_SESSIONS)
if (params_->device_bound_sessions_enabled) {
builder.set_has_device_bound_session_service(true);
if (base::FeatureList::IsEnabled(
net::features::kPersistDeviceBoundSessions)) {
base::FilePath device_bound_sessions_file_path;
if (GetFullDataFilePath(params_->file_paths,
&network::mojom::NetworkContextFilePaths::
device_bound_sessions_database_name,
device_bound_sessions_file_path)) {
// Network-bound NetworkContexts should not persist state on disk.
CHECK(!is_network_bound);
builder.set_device_bound_sessions_file_path(
device_bound_sessions_file_path);
}
}
}
#endif
@@ -2944,7 +3018,10 @@ NetworkContext::MakeSessionCleanupCookieStore() const {
}
#if BUILDFLAG(IS_WIN)
const bool enable_exclusive_access = params_->enable_locking_cookie_database;
const bool enable_exclusive_access =
params_->enable_locking_cookie_database.value_or(
base::FeatureList::IsEnabled(
features::kEnableLockCookieDatabaseByDefault));
#else
const bool enable_exclusive_access = false;
#endif // BUILDFLAG(IS_WIN)
@@ -2989,20 +3066,36 @@ void NetworkContext::OnHttpCacheSizeComputed(
void NetworkContext::OnConnectionError() {
// If owned by the network service, this call will delete |this|.
if (on_connection_close_callback_)
if (on_connection_close_callback_) {
std::move(on_connection_close_callback_).Run(this);
}
}
GURL NetworkContext::GetHSTSRedirect(const GURL& original_url) {
GURL NetworkContext::GetHSTSRedirectForPreconnect(const GURL& original_url) {
// TODO(lilyhoughton) This needs to be gotten rid of once explicit
// construction with a URLRequestContext is no longer supported.
if (!url_request_context_->transport_security_state() ||
!original_url.SchemeIs("http") ||
!url_request_context_->transport_security_state()->ShouldUpgradeToSSL(
original_url.host())) {
if (!url_request_context_->transport_security_state()) {
RecordHSTSPreconnectUpgradeReason(
HSTSRedirectUpgradeReason::kNotUpgradedHSTSUnavailable);
return original_url;
}
if (!original_url.SchemeIs(url::kHttpScheme)) {
RecordHSTSPreconnectUpgradeReason(
HSTSRedirectUpgradeReason::kNotUpgradedNotHTTP);
return original_url;
}
if (!url_request_context_->transport_security_state()->ShouldUpgradeToSSL(
original_url.host())) {
RecordHSTSPreconnectUpgradeReason(
HSTSRedirectUpgradeReason::kNotUpgradedNoHSTSPin);
return original_url;
}
RecordHSTSPreconnectUpgradeReason(HSTSRedirectUpgradeReason::kUpgraded);
GURL::Replacements replacements;
replacements.SetSchemeStr("https");
return original_url.ReplaceComponents(replacements);
@@ -3062,8 +3155,9 @@ void NetworkContext::OnVerifyCertForSignedExchangeComplete(
}
#if BUILDFLAG(IS_CT_SUPPORTED)
if (result != net::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN &&
ct_result != net::OK)
ct_result != net::OK) {
result = ct_result;
}
#endif // BUILDFLAG(IS_CT_SUPPORTED)
}
@@ -3092,8 +3186,9 @@ void NetworkContext::InitializeCorsParams() {
cors_origin_access_list_.SetBlockListForOrigin(pattern->source_origin,
pattern->block_patterns);
}
for (const auto& key : params_->cors_exempt_header_list)
for (const auto& key : params_->cors_exempt_header_list) {
cors_exempt_header_list_.insert(key);
}
acam_preflight_spec_conformant_ =
base::FeatureList::IsEnabled(
File diff suppressed because it is too large Load Diff
@@ -4303,7 +4303,7 @@ enum WebFeature {
kCSSColor_SpaceOkLxx_outOfRec2020 = 4933,
kSandboxedSrcdocFrameResolvesRelativeURL = 4934,
kV8Ink_RequestPresenter_Method = 4935,
kEventTimingOrphanPointerup = 4936,
kOBSOLETE_EventTimingOrphanPointerup = 4936,
kNavigatorCookieEnabledThirdParty = 4937,
kFoldableAPIs = 4938,
kSnapEvent = 4939,
@@ -4376,7 +4376,7 @@ enum WebFeature {
kZstdContentEncodingForMainFrameNavigation = 5002,
kZstdContentEncodingForSubFrameNavigation = 5003,
kZstdContentEncodingForSubresource = 5004,
kEventTimingOrphanPointerupWithClick = 5005,
kOBSOLETE_EventTimingOrphanPointerupWithClick = 5005,
kDisableReduceAcceptLanguage = 5006,
kSharedStorageAPI_CreateWorklet_CrossOriginScriptDefaultDataOrigin = 5007,
kDeprecatedAIModel = 5008,
@@ -4451,22 +4451,22 @@ enum WebFeature {
kV8AISummarizer_Type_AttributeGetter = 5077,
kV8AISummarizer_Format_AttributeGetter = 5078,
kV8AISummarizer_Length_AttributeGetter = 5079,
kV8AIAssistantCapabilities_Available_AttributeGetter = 5080,
kV8AIAssistantCapabilities_DefaultTopK_AttributeGetter = 5081,
kV8AIAssistantCapabilities_MaxTopK_AttributeGetter = 5082,
kV8AIAssistantCapabilities_DefaultTemperature_AttributeGetter = 5083,
kV8AIAssistantFactory_Capabilities_Method = 5084,
kV8AIAssistantFactory_Create_Method = 5085,
kOBSOLETE_V8AIAssistantCapabilities_Available_AttributeGetter = 5080,
kOBSOLETE_V8AIAssistantCapabilities_DefaultTopK_AttributeGetter = 5081,
kOBSOLETE_V8AIAssistantCapabilities_MaxTopK_AttributeGetter = 5082,
kOBSOLETE_V8AIAssistantCapabilities_DefaultTemperature_AttributeGetter = 5083,
kOBSOLETE_V8AIAssistantFactory_Capabilities_Method = 5084,
kOBSOLETE_V8AIAssistantFactory_Create_Method = 5085,
kOBSOLETE_V8AI_Assistant_AttributeGetter = 5086,
kV8AIAssistant_MaxTokens_AttributeGetter = 5087,
kV8AIAssistant_TokensSoFar_AttributeGetter = 5088,
kV8AIAssistant_TokensLeft_AttributeGetter = 5089,
kV8AIAssistant_TopK_AttributeGetter = 5090,
kV8AIAssistant_Temperature_AttributeGetter = 5091,
kV8AIAssistant_Clone_Method = 5092,
kV8AIAssistant_Destroy_Method = 5093,
kV8AIAssistant_Prompt_Method = 5094,
kV8AIAssistant_PromptStreaming_Method = 5095,
kOBSOLETE_V8AIAssistant_MaxTokens_AttributeGetter = 5087,
kOBSOLETE_V8AIAssistant_TokensSoFar_AttributeGetter = 5088,
kOBSOLETE_V8AIAssistant_TokensLeft_AttributeGetter = 5089,
kOBSOLETE_V8AIAssistant_TopK_AttributeGetter = 5090,
kOBSOLETE_V8AIAssistant_Temperature_AttributeGetter = 5091,
kOBSOLETE_V8AIAssistant_Clone_Method = 5092,
kOBSOLETE_V8AIAssistant_Destroy_Method = 5093,
kOBSOLETE_V8AIAssistant_Prompt_Method = 5094,
kOBSOLETE_V8AIAssistant_PromptStreaming_Method = 5095,
kV8Window_PopinContextTypesSupported_Method = 5096,
kV8Window_PopinContextType_Method = 5097,
kWebAuthentication_AttestationFormats = 5098,
@@ -4478,7 +4478,7 @@ enum WebFeature {
kV8PublicKeyCredential_SignalUnknownCredential_Method = 5104,
kV8PublicKeyCredential_SignalAllAcceptedCredentials_Method = 5105,
kV8PublicKeyCredential_SignalCurrentUserDetails_Method = 5106,
kV8AIAssistant_CountPromptTokens_Method = 5107,
kOBSOLETE_V8AIAssistant_CountPromptTokens_Method = 5107,
kHTMLSearchElement = 5108,
kHTMLUnsafeMethods = 5109,
kV8GPUSupportedLimits_MaxInterStageShaderComponents_AttributeGetter = 5110,
@@ -4491,6 +4491,77 @@ enum WebFeature {
kV8PerformanceResourceTiming_WorkerMatchedSourceType_AttributeGetter = 5117,
kV8PerformanceResourceTiming_WorkerFinalSourceType_AttributeGetter = 5118,
kV8AI_LanguageModel_AttributeGetter = 5119,
kV8RTCEncodedVideoFrame_Timestamp_AttributeGetter = 5120,
kV8RTCEncodedAudioFrame_Timestamp_AttributeGetter = 5121,
kOBSOLETE_V8AIAssistantCapabilities_LanguageAvailable_Method = 5122,
kWebGLRenderingContextReadPixels = 5123,
kSelectAudioOutput = 5124,
kV8PaymentManager_UserHint_AttributeGetter = 5125,
kV8PaymentManager_UserHint_AttributeSetter = 5126,
kPerformanceNavigationTimingConfidence = 5127,
kHttpParsersParseDateFromUTCStringDifferent = 5128,
kHttpParsersParseDateFromStringDifferent = 5129,
kMediaQueryRangeSyntax = 5130,
kParseHTMLSafe = 5131,
kSetHTMLSafe = 5132,
kSelectElementAppearanceBaseSelect = 5133,
kSelectElementPickerAppearanceBaseSelect = 5134,
kCssValueWritingModeVerticalRl = 5135,
kCssValueWritingModeVerticalLr = 5136,
kCssValueWritingModeSidewaysRl = 5137,
kCssValueWritingModeSidewaysLr = 5138,
kV8AILanguageModel_TopK_AttributeGetter = 5139,
kV8AILanguageModel_Temperature_AttributeGetter = 5140,
kV8AILanguageModel_Clone_Method = 5141,
kV8AILanguageModel_Destroy_Method = 5142,
kV8AILanguageModel_Prompt_Method = 5143,
kV8AILanguageModel_PromptStreaming_Method = 5144,
kV8AILanguageModel_CountPromptTokens_Method = 5145,
kV8AILanguageModelCapabilities_LanguageAvailable_Method = 5146,
kV8AILanguageModelCapabilities_Available_AttributeGetter = 5147,
kV8AILanguageModelCapabilities_DefaultTopK_AttributeGetter = 5148,
kV8AILanguageModelCapabilities_MaxTopK_AttributeGetter = 5149,
kV8AILanguageModelCapabilities_DefaultTemperature_AttributeGetter = 5150,
kV8AILanguageModelFactory_Capabilities_Method = 5151,
kV8AILanguageModelFactory_Create_Method = 5152,
kV8AILanguageModel_MaxTokens_AttributeGetter = 5153,
kV8AILanguageModel_TokensSoFar_AttributeGetter = 5154,
kV8AILanguageModel_TokensLeft_AttributeGetter = 5155,
kSvgContextFillOrStroke = 5156,
kARIAActionsAttribute = 5157,
kResolveToConfigValueCoercedToTrue = 5158,
kServiceWorkerStaticRouter_RaceNetworkAndFetchHandlerImprovement = 5159,
kHasCapUnits = 5160,
kHasRcapUnits = 5161,
kHasIcUnits = 5162,
kHasRicUnits = 5163,
kHasLhUnits = 5164,
kHasRlhUnits = 5165,
kCSSColorFunction = 5166,
kCSSColor_SpaceLxx = 5167,
kCSSColor_SpaceHwb = 5168,
kCSSRoundModRemFunctions = 5169,
kCSSTrigFunctions = 5170,
kCSSCalcConstants = 5171,
kHasChUnits = 5172,
kHasRchUnits = 5173,
kHasRexUnits = 5174,
kCSSExponentialFunctions = 5175,
kCSSLinearEasing = 5176,
kOverflowMediaQuery = 5177,
kHasSpellingOrGrammarErrorPseudoElement = 5178,
kDynamicRangeMediaQuery = 5179,
kDisplayModeMediaQuery = 5180,
kCSSWordBreakAutoPhrase = 5181,
kCSSSelectorPseudoModal = 5182,
kUpdateMediaQuery = 5183,
kCSSSelectorPseudoFileSelectorButton = 5184,
kWebAuthnGetClientCapabilities = 5185,
kVisitedColumnRuleColor = 5186,
kDocumentIsolationPolicyRequireCorp = 5187,
kDocumentIsolationPolicyCredentialless = 5188,
kClipPathGeometryBox = 5189,
kActiveViewTransitionPseudo = 5190,
// Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots. Also don't add extra
@@ -31,7 +31,7 @@ class MediaQueryFeatureSet : public MediaQueryParser::FeatureSet {
public:
MediaQueryFeatureSet() = default;
bool IsAllowed(const String& feature) const override {
bool IsAllowed(const AtomicString& feature) const override {
if (feature == media_feature_names::kInlineSizeMediaFeature ||
feature == media_feature_names::kMinInlineSizeMediaFeature ||
feature == media_feature_names::kMaxInlineSizeMediaFeature ||
@@ -40,13 +40,14 @@ class MediaQueryFeatureSet : public MediaQueryParser::FeatureSet {
feature == media_feature_names::kMaxBlockSizeMediaFeature ||
feature == media_feature_names::kStuckMediaFeature ||
feature == media_feature_names::kSnappedMediaFeature ||
feature == media_feature_names::kOverflowingMediaFeature ||
CSSVariableParser::IsValidVariableName(feature)) {
return false;
}
return true;
}
bool IsAllowedWithoutValue(
const String& feature,
const AtomicString& feature,
const ExecutionContext* execution_context) const override {
// Media features that are prefixed by min/max cannot be used without a
// value.
@@ -112,22 +113,24 @@ class MediaQueryFeatureSet : public MediaQueryParser::FeatureSet {
feature == media_feature_names::kResizableMediaFeature);
}
bool IsCaseSensitive(const String& feature) const override { return false; }
bool IsCaseSensitive(const AtomicString& feature) const override {
return false;
}
bool SupportsRange() const override { return true; }
};
} // namespace
MediaQuerySet* MediaQueryParser::ParseMediaQuerySet(
const String& query_string,
const ExecutionContext* execution_context) {
StringView query_string,
ExecutionContext* execution_context) {
CSSParserTokenStream stream(query_string);
return ParseMediaQuerySet(stream, execution_context);
}
MediaQuerySet* MediaQueryParser::ParseMediaQuerySet(
CSSParserTokenStream& stream,
const ExecutionContext* execution_context) {
ExecutionContext* execution_context) {
return MediaQueryParser(kMediaQuerySetParser, kHTMLStandardMode,
execution_context)
.ParseImpl(stream);
@@ -136,14 +139,14 @@ MediaQuerySet* MediaQueryParser::ParseMediaQuerySet(
MediaQuerySet* MediaQueryParser::ParseMediaQuerySetInMode(
CSSParserTokenStream& stream,
CSSParserMode mode,
const ExecutionContext* execution_context) {
ExecutionContext* execution_context) {
return MediaQueryParser(kMediaQuerySetParser, mode, execution_context)
.ParseImpl(stream);
}
MediaQuerySet* MediaQueryParser::ParseMediaCondition(
CSSParserTokenStream& stream,
const ExecutionContext* execution_context) {
ExecutionContext* execution_context) {
return MediaQueryParser(kMediaConditionParser, kHTMLStandardMode,
execution_context)
.ParseImpl(stream);
@@ -151,7 +154,7 @@ MediaQuerySet* MediaQueryParser::ParseMediaCondition(
MediaQueryParser::MediaQueryParser(ParserType parser_type,
CSSParserMode mode,
const ExecutionContext* execution_context,
ExecutionContext* execution_context,
SyntaxLevel syntax_level)
: parser_type_(parser_type),
mode_(mode),
@@ -230,14 +233,14 @@ MediaQuery::RestrictorType MediaQueryParser::ConsumeRestrictor(
return MediaQuery::RestrictorType::kNone;
}
String MediaQueryParser::ConsumeType(CSSParserTokenStream& stream) {
AtomicString MediaQueryParser::ConsumeType(CSSParserTokenStream& stream) {
if (stream.Peek().GetType() != kIdentToken) {
return g_null_atom;
}
if (IsRestrictorOrLogicalOperator(stream.Peek())) {
return g_null_atom;
}
return stream.ConsumeIncludingWhitespace().Value().ToString();
return stream.ConsumeIncludingWhitespace().Value().ToAtomicString();
}
MediaQueryOperator MediaQueryParser::ConsumeComparison(
@@ -267,20 +270,19 @@ MediaQueryOperator MediaQueryParser::ConsumeComparison(
return MediaQueryOperator::kGt;
}
NOTREACHED_IN_MIGRATION();
return MediaQueryOperator::kNone;
NOTREACHED();
}
String MediaQueryParser::ConsumeAllowedName(CSSParserTokenStream& stream,
const FeatureSet& feature_set) {
AtomicString MediaQueryParser::ConsumeAllowedName(
CSSParserTokenStream& stream,
const FeatureSet& feature_set) {
if (stream.Peek().GetType() != kIdentToken) {
return g_null_atom;
}
String name = stream.Peek().Value().ToString();
AtomicString name = stream.Peek().Value().ToAtomicString();
if (!feature_set.IsCaseSensitive(name)) {
name = name.LowerASCII();
}
name = AttemptStaticStringCreation(name);
if (!feature_set.IsAllowed(name)) {
return g_null_atom;
}
@@ -288,9 +290,10 @@ String MediaQueryParser::ConsumeAllowedName(CSSParserTokenStream& stream,
return name;
}
String MediaQueryParser::ConsumeUnprefixedName(CSSParserTokenStream& stream,
const FeatureSet& feature_set) {
String name = ConsumeAllowedName(stream, feature_set);
AtomicString MediaQueryParser::ConsumeUnprefixedName(
CSSParserTokenStream& stream,
const FeatureSet& feature_set) {
AtomicString name = ConsumeAllowedName(stream, feature_set);
if (name.IsNull()) {
return name;
}
@@ -311,7 +314,7 @@ const MediaQueryExpNode* MediaQueryParser::ConsumeFeature(
CSSParserTokenStream::State start = stream.Save();
{
String feature_name = ConsumeAllowedName(stream, feature_set);
AtomicString feature_name = ConsumeAllowedName(stream, feature_set);
// <mf-boolean> = <mf-name>
if (!feature_name.IsNull() && stream.AtEnd() &&
@@ -348,7 +351,7 @@ const MediaQueryExpNode* MediaQueryParser::ConsumeFeature(
{
// Try: <mf-name> <mf-comparison> <mf-value> (e.g., “width <= 10px”)
String feature_name = ConsumeUnprefixedName(stream, feature_set);
AtomicString feature_name = ConsumeUnprefixedName(stream, feature_set);
if (!feature_name.IsNull() && !stream.AtEnd()) {
MediaQueryOperator op = ConsumeComparison(stream);
if (op != MediaQueryOperator::kNone) {
@@ -358,6 +361,7 @@ const MediaQueryExpNode* MediaQueryParser::ConsumeFeature(
auto left = MediaQueryExpComparison();
auto right = MediaQueryExpComparison(*value, op);
UseCountRangeSyntax();
return MakeGarbageCollected<MediaQueryFeatureExpNode>(
MediaQueryExp::Create(feature_name,
MediaQueryExpBounds(left, right)));
@@ -393,7 +397,7 @@ const MediaQueryExpNode* MediaQueryParser::ConsumeFeature(
return nullptr;
}
String feature_name = ConsumeUnprefixedName(stream, feature_set);
AtomicString feature_name = ConsumeUnprefixedName(stream, feature_set);
if (feature_name.IsNull()) {
return nullptr;
}
@@ -421,6 +425,7 @@ const MediaQueryExpNode* MediaQueryParser::ConsumeFeature(
auto left = MediaQueryExpComparison(*value1, op1);
auto right = MediaQueryExpComparison();
UseCountRangeSyntax();
return MakeGarbageCollected<MediaQueryFeatureExpNode>(
MediaQueryExp::Create(feature_name, MediaQueryExpBounds(left, right)));
}
@@ -444,6 +449,7 @@ const MediaQueryExpNode* MediaQueryParser::ConsumeFeature(
return nullptr;
}
UseCountRangeSyntax();
return MakeGarbageCollected<MediaQueryFeatureExpNode>(MediaQueryExp::Create(
feature_name,
MediaQueryExpBounds(MediaQueryExpComparison(*value1, op1),
@@ -566,7 +572,7 @@ MediaQuery* MediaQueryParser::ConsumeQuery(CSSParserTokenStream& stream) {
//
// [ not | only ]? <media-type> [ and <media-condition-without-or> ]?
MediaQuery::RestrictorType restrictor = ConsumeRestrictor(stream);
String type = ConsumeType(stream);
AtomicString type = ConsumeType(stream);
if (!type.IsNull()) {
if (!ConsumeIfIdent(stream, "and")) {
@@ -615,4 +621,8 @@ MediaQuerySet* MediaQueryParser::ParseImpl(CSSParserTokenStream& stream) {
return MakeGarbageCollected<MediaQuerySet>(std::move(queries));
}
void MediaQueryParser::UseCountRangeSyntax() {
UseCounter::Count(execution_context_, WebFeature::kMediaQueryRangeSyntax);
}
} // namespace blink
@@ -14,7 +14,7 @@
[CEReactions, Measure] attribute FrozenArray<Element>? ariaErrorMessageElements;
[CEReactions, Measure] attribute FrozenArray<Element>? ariaFlowToElements;
[CEReactions, Measure] attribute FrozenArray<Element>? ariaLabelledByElements;
[CEReactions, Measure] attribute FrozenArray<Element>? ariaOwnsElements;
[CEReactions, Measure, RuntimeEnabled=AOMAriaRelationshipPropertiesAriaOwns] attribute FrozenArray<Element>? ariaOwnsElements;
};
Element includes AriaRelationshipAttributes;
@@ -81,7 +81,12 @@ typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement;
// https://html.spec.whatwg.org/C/#the-document-object
// https://github.com/whatwg/html/pull/9538
[CallWith=ExecutionContext,MeasureAs=ParseHTMLUnsafe] static Document parseHTMLUnsafe(HTMLString html);
[CallWith=ExecutionContext,RaisesException,MeasureAs=ParseHTMLUnsafe] static Document parseHTMLUnsafe(HTMLString html);
// https://wicg.github.io/sanitizer-api/#sanitizer-api
// TODO(356601280): Merge the two setHTMLUnsafe variants into one, once the
// different RuntimeEnabled flags are both perma-enabled.
[RuntimeEnabled=SanitizerAPI,RaisesException,CallWith=ExecutionContext,MeasureAs=ParseHTMLUnsafe,CEReactions] static Document parseHTMLUnsafe(HTMLString html, SetHTMLOptions options);
[RuntimeEnabled=SanitizerAPI,RaisesException,CallWith=ExecutionContext,MeasureAs=ParseHTMLSafe,CEReactions] static Document parseHTML(DOMString html, optional SetHTMLOptions options = {});
// resource metadata management
@@ -196,7 +201,7 @@ typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement;
// Deprecated prefixed page visibility API.
// TODO(davidben): This is a property so attaching a deprecation warning results in false positives when outputting
// document in the console. It's possible https://crbug.com/43394 will resolve this.
[MeasureAs=PrefixedPageVisibility, ImplementedAs=visibilityState] readonly attribute DOMString webkitVisibilityState;
[MeasureAs=PrefixedPageVisibility, ImplementedAs=visibilityStateAsString] readonly attribute DOMString webkitVisibilityState;
[MeasureAs=PrefixedPageVisibility, ImplementedAs=hidden] readonly attribute boolean webkitHidden;
// Private Token API (https://github.com/wicg/trust-token-api)
@@ -27,6 +27,12 @@ dictionary CheckVisibilityOptions {
[RuntimeEnabled=CheckVisibilityExtraProperties] boolean visibilityProperty = false;
};
// Options dictionary for setHTML and setHTMLUnsafe.
// See: https://wicg.github.io/sanitizer-api/#configobject
dictionary SetHTMLOptions {
(Sanitizer or SanitizerConfig) sanitizer;
};
// https://dom.spec.whatwg.org/#interface-element
[
@@ -93,15 +99,17 @@ dictionary CheckVisibilityOptions {
// DOM Parsing and Serialization
// https://w3c.github.io/DOM-Parsing/#extensions-to-the-element-interface
//
// TODO(mkwst): Write a spec for the `TrustedHTML` variants.
// TODO(lyf): Change the type to `[TreatNullAs=xxx] HTMLString` after
// https://crbug.com/1058762 has been fixed.
[CEReactions, RuntimeCallStatsCounter=ElementInnerHTML, RaisesException=Setter] attribute [LegacyNullToEmptyString, StringContext=TrustedHTML] DOMString innerHTML;
[CEReactions, RaisesException=Setter] attribute [LegacyNullToEmptyString, StringContext=TrustedHTML] DOMString outerHTML;
[CEReactions, RaisesException] void insertAdjacentHTML(DOMString position, HTMLString text);
// https://github.com/whatwg/html/pull/9538
[RaisesException,MeasureAs=SetHTMLUnsafe,CEReactions] void setHTMLUnsafe(HTMLString html);
// https://wicg.github.io/sanitizer-api/#sanitizer-api
// TODO(vogelheim): Merge the two setHTMLUnsafe variants into one, once the
// different RuntimeEnabled flags are both perma-enabled.
[RuntimeEnabled=SanitizerAPI,RaisesException,MeasureAs=SetHTMLUnsafe,CEReactions] void setHTMLUnsafe(HTMLString html, SetHTMLOptions options);
[RuntimeEnabled=SanitizerAPI,RaisesException,MeasureAs=SetHTMLSafe,CEReactions] void setHTML(DOMString html, optional SetHTMLOptions options = {});
// Declarative Shadow DOM getInnerHTML() function. This version should be
// considered deprecated, as we work to standardize the version below,
@@ -89,6 +89,9 @@ interface ShadowRoot : DocumentFragment {
(DOMString or ElementCreationOptions) options);
[RaisesException,MeasureAs=SetHTMLUnsafe,CEReactions] void setHTMLUnsafe(HTMLString string);
[RuntimeEnabled=SanitizerAPI,RaisesException,MeasureAs=SetHTMLUnsafe,CEReactions] void setHTMLUnsafe(HTMLString html, SetHTMLOptions options);
[RuntimeEnabled=SanitizerAPI,RaisesException,MeasureAs=SetHTMLSafe,CEReactions] void setHTML(DOMString html, optional SetHTMLOptions options = {});
};
ShadowRoot includes DocumentOrShadowRoot;
@@ -91,6 +91,7 @@
"contentvisibilityautostatechange",
"contextlost",
"contextmenu",
"contextoverflow",
"contextrestored",
"controllerchange",
"cookiechange",
@@ -114,6 +115,7 @@
"dismiss",
"display",
"dispose",
"downloadprogress",
"downloading",
"drag",
"dragend",
@@ -254,7 +256,6 @@
"push",
"pushsubscriptionchange",
"quicstream",
"quotachange",
"ratechange",
"readeradd",
"readerremove",
@@ -188,6 +188,10 @@
#include "ui/base/ui_base_features.h"
#include "ui/gfx/geometry/skia_conversions.h"
#if BUILDFLAG(IS_CHROMEOS)
#include "ui/native_theme/native_theme.h"
#endif
#if !BUILDFLAG(IS_MAC)
#include "skia/ext/legacy_display_globals.h"
#include "third_party/blink/public/platform/web_font_render_style.h"
@@ -404,8 +408,7 @@ ui::mojom::blink::WindowOpenDisposition NavigationPolicyToDisposition(
case kNavigationPolicyLinkPreview:
NOTREACHED();
}
NOTREACHED_IN_MIGRATION() << "Unexpected NavigationPolicy";
return ui::mojom::blink::WindowOpenDisposition::IGNORE_ACTION;
NOTREACHED() << "Unexpected NavigationPolicy";
}
// Records the queuing duration for activation IPC.
@@ -441,8 +444,7 @@ SkFontHinting RendererPreferencesToSkiaHinting(
case gfx::FontRenderParams::HINTING_FULL:
return SkFontHinting::kNormal;
default:
NOTREACHED_IN_MIGRATION();
return SkFontHinting::kNormal;
NOTREACHED();
}
}
#endif
@@ -457,8 +459,7 @@ SkFontHinting RendererPreferencesToSkiaHinting(
case gfx::FontRenderParams::HINTING_FULL:
return SkFontHinting::kFull;
default:
NOTREACHED_IN_MIGRATION();
return SkFontHinting::kNormal;
NOTREACHED();
}
}
#endif // !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN)
@@ -1213,6 +1214,10 @@ void WebViewImpl::DidFirstVisuallyNonEmptyPaint() {
local_main_frame_host_remote_->DidFirstVisuallyNonEmptyPaint();
}
void WebViewImpl::OnFirstContentfulPaint() {
local_main_frame_host_remote_->OnFirstContentfulPaint();
}
void WebViewImpl::UpdateICBAndResizeViewport(
const gfx::Size& visible_viewport_size) {
// We'll keep the initial containing block size from changing when the top
@@ -3427,6 +3432,16 @@ void WebViewImpl::UpdateFontRenderingFromRendererPrefs() {
#endif // !BUILDFLAG(IS_MAC)
}
#if BUILDFLAG(IS_CHROMEOS)
void WebViewImpl::UpdateUseOverlayScrollbar(bool use_overlay_scrollbar) {
ui::NativeTheme::GetInstanceForWeb()->set_use_overlay_scrollbar(
use_overlay_scrollbar);
if (MainFrameImpl() && MainFrameImpl()->GetFrameView()) {
MainFrameImpl()->GetFrameView()->UsesOverlayScrollbarsChanged();
}
}
#endif
void WebViewImpl::ActivatePrerenderedPage(
mojom::blink::PrerenderPageActivationParamsPtr
prerender_page_activation_params,
@@ -3545,13 +3560,13 @@ void WebViewImpl::UpdateRendererPreferences(
SetExplicitlyAllowedPorts(
renderer_preferences_.explicitly_allowed_network_ports);
if (renderer_preferences_.prefixed_fullscreen_video_api_availability
.has_value()) {
WebRuntimeFeatures::EnableFeatureFromString(
"PrefixedVideoFullscreen",
renderer_preferences_.prefixed_fullscreen_video_api_availability
.value());
#if BUILDFLAG(IS_CHROMEOS)
if (!ScrollbarTheme::MockScrollbarsEnabled()) {
WebRuntimeFeatures::EnableOverlayScrollbars(
renderer_preferences_.use_overlay_scrollbar);
UpdateUseOverlayScrollbar(renderer_preferences_.use_overlay_scrollbar);
}
#endif
MaybePreloadSystemFonts(GetPage());
}
@@ -6,4 +6,14 @@
Exposed=Window
] interface HighlightRegistry {
maplike<DOMString, Highlight>;
// Returns the sequence of highlights that intersect with the specified
// coordinates, ordered by priority. It also returns highlights inside
// shadow trees if the shadow root is passed in as part of the |options|
// parameter.
[RuntimeEnabled=HighlightsFromPoint]
sequence<Highlight> highlightsFromPoint(
float x,
float y,
optional HighlightsFromPointOptions options = {});
};
@@ -0,0 +1,7 @@
// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
dictionary HighlightsFromPointOptions {
sequence<ShadowRoot> shadowRoots = [];
};
@@ -3,11 +3,10 @@
Exposed=(Window,Worker)
]
interface TextCluster {
readonly attribute DOMString text;
attribute double x;
attribute double y;
attribute unsigned long begin;
attribute unsigned long end;
readonly attribute unsigned long begin;
readonly attribute unsigned long end;
readonly attribute DOMString align;
readonly attribute DOMString baseline;
};
@@ -61,5 +61,5 @@
// https://html.spec.whatwg.org/multipage/input.html#dom-select-showpicker
[RaisesException, RuntimeEnabled=HTMLSelectElementShowPicker, MeasureAs=ShowPickerSelect] void showPicker();
[RuntimeEnabled=CustomizableSelect] attribute HTMLSelectedOptionElement? selectedOptionElement;
[RuntimeEnabled=SelectedcontentelementAttribute] attribute HTMLSelectedContentElement? selectedContentElement;
};
@@ -6,4 +6,4 @@
Exposed=Window,
HTMLConstructor,
RuntimeEnabled=CustomizableSelect
] interface HTMLSelectedOptionElement : HTMLElement {};
] interface HTMLSelectedContentElement : HTMLElement {};
@@ -30,7 +30,9 @@
] interface HTMLDialogElement : HTMLElement {
[CEReactions, Reflect] attribute boolean open;
attribute DOMString returnValue;
[CEReactions,RuntimeEnabled=HTMLDialogLightDismiss] attribute DOMString closedBy;
[CEReactions, Measure, RaisesException] void show();
[CEReactions, Measure, RaisesException] void showModal();
[CEReactions] void close(optional DOMString returnValue);
[CEReactions,RuntimeEnabled=HTMLDialogLightDismiss] void requestClose(optional DOMString returnValue);
};
@@ -27,7 +27,7 @@
ActiveScriptWrappable,
HTMLConstructor
] interface HTMLEmbedElement : HTMLElement {
[CEReactions, Reflect, URL, RaisesException=Setter] attribute ScriptURLString src;
[CEReactions, Reflect, URL] attribute ScriptURLString src;
[CEReactions, Reflect] attribute DOMString type;
[CEReactions, Reflect] attribute DOMString width;
[CEReactions, Reflect] attribute DOMString height;
@@ -28,7 +28,7 @@
HTMLConstructor
] interface HTMLIFrameElement : HTMLElement {
[CEReactions, Reflect, URL] attribute USVString src;
[CEReactions, Reflect, RaisesException=Setter] attribute HTMLString srcdoc;
[CEReactions, Reflect] attribute HTMLString srcdoc;
[CEReactions, Reflect] attribute DOMString name;
[PutForwards=value] readonly attribute DOMTokenList sandbox;
// Note: The seamless attribute was once supported, but was removed.
@@ -27,7 +27,7 @@
ActiveScriptWrappable,
HTMLConstructor
] interface HTMLObjectElement : HTMLElement {
[CEReactions, Reflect, URL, RaisesException=Setter] attribute ScriptURLString data;
[CEReactions, Reflect, URL] attribute ScriptURLString data;
[CEReactions, Reflect] attribute DOMString type;
[CEReactions, Reflect] attribute DOMString name;
[CEReactions, Reflect] attribute DOMString useMap;
@@ -55,7 +55,7 @@
[CEReactions, Reflect] attribute unsigned long hspace;
[CEReactions, Reflect] attribute DOMString standby;
[CEReactions, Reflect] attribute unsigned long vspace;
[CEReactions, Reflect, URL, RaisesException=Setter] attribute ScriptURLString codeBase;
[CEReactions, Reflect, URL] attribute ScriptURLString codeBase;
[CEReactions, Reflect] attribute DOMString codeType;
[CEReactions, Reflect] attribute [LegacyNullToEmptyString] DOMString border;
@@ -2,6 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(crbug.com/373648906): Figure out where this definition should be.
enum PermissionState {
"granted",
"denied",
"prompt"
};
[RuntimeEnabled=PermissionElement, Exposed=Window]
interface HTMLPermissionElement : HTMLElement {
[HTMLConstructor] constructor();
@@ -22,7 +22,7 @@
Exposed=Window,
HTMLConstructor
] interface HTMLScriptElement : HTMLElement {
[CEReactions, Reflect, URL, RaisesException=Setter] attribute ScriptURLString src;
[CEReactions, Reflect, URL] attribute ScriptURLString src;
[CEReactions, Reflect] attribute DOMString type;
[CEReactions, Reflect] attribute boolean noModule;
[CEReactions, Reflect] attribute DOMString charset;
@@ -30,6 +30,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
dictionary Accelerator {
unsigned short keyCode;
long modifiers;
};
dictionary ShowContextMenuItem {
required DOMString type;
[EnforceRange] unsigned short id;
@@ -37,6 +42,8 @@ dictionary ShowContextMenuItem {
boolean isExperimentalFeature = false;
boolean enabled = true;
boolean checked = false;
boolean isDevToolsPerformanceMenuItem = false;
Accelerator accelerator;
sequence<ShowContextMenuItem> subItems;
};
@@ -31,5 +31,5 @@
[
LegacyNoInterfaceObject
] interface InspectorOverlayHost {
[RaisesException] void send(any command);
void send(any command);
};
@@ -18,7 +18,7 @@
#include "third_party/blink/public/common/origin_trials/trial_token.h"
#include "third_party/blink/public/common/origin_trials/trial_token_result.h"
#include "third_party/blink/public/common/origin_trials/trial_token_validator.h"
#include "third_party/blink/public/mojom/origin_trial_feature/origin_trial_feature.mojom-shared.h"
#include "third_party/blink/public/mojom/origin_trials/origin_trial_feature.mojom-shared.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_security_origin.h"
#include "third_party/blink/renderer/bindings/core/v8/script_controller.h"
@@ -128,8 +128,7 @@ std::ostream& operator<<(std::ostream& stream, OriginTrialTokenStatus status) {
case OriginTrialTokenStatus::kUnknownTrial:
return stream << "kUnknownTrial";
}
NOTREACHED_IN_MIGRATION();
return stream;
NOTREACHED();
#else
return stream << (static_cast<int>(status));
#endif // ifndef NDEBUG
@@ -530,8 +529,7 @@ bool OriginTrialContext::CanEnableTrialFromName(const StringView& trial_name) {
}
if (trial_name == "FoldableAPIs") {
return base::FeatureList::IsEnabled(features::kViewportSegments) &&
base::FeatureList::IsEnabled(features::kDevicePosture);
return base::FeatureList::IsEnabled(features::kViewportSegments);
}
if (trial_name == "PermissionElement") {
@@ -0,0 +1,64 @@
// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file
// (New and revised) IDL for Sanitizer API.
// Extracted from: https://wicg.github.io/sanitizer-api/
[
Exposed=(Window,Worker),
RuntimeEnabled=SanitizerAPI
]
interface Sanitizer {
[CallWith=ExecutionContext, RaisesException]
constructor(optional SanitizerConfig config = {});
// Query configuration:
SanitizerConfig get();
// Modify a Sanitizers lists and fields:
undefined allowElement(SanitizerElementWithAttributes element);
undefined removeElement(SanitizerElement element);
undefined replaceWithChildrenElement(SanitizerElement element);
undefined allowAttribute(SanitizerAttribute attribute);
undefined removeAttribute(SanitizerAttribute attribute);
undefined setComments(boolean allow);
undefined setDataAttributes(boolean allow);
// Remove markup that executes script. May modify multiple lists:
undefined removeUnsafe();
};
dictionary SanitizerElementNamespace {
required DOMString name;
[ImplementedAs=namespaceURI] DOMString? _namespace =
"http://www.w3.org/1999/xhtml";
};
// Used by "elements"
dictionary SanitizerElementNamespaceWithAttributes : SanitizerElementNamespace {
sequence<SanitizerAttribute> attributes;
sequence<SanitizerAttribute> removeAttributes;
};
typedef (DOMString or SanitizerElementNamespace) SanitizerElement;
typedef (DOMString or SanitizerElementNamespaceWithAttributes) SanitizerElementWithAttributes;
dictionary SanitizerAttributeNamespace {
required DOMString name;
[ImplementedAs=namespaceURI] DOMString? _namespace = null;
};
typedef (DOMString or SanitizerAttributeNamespace) SanitizerAttribute;
dictionary SanitizerConfig {
sequence<SanitizerElementWithAttributes> elements;
sequence<SanitizerElement> removeElements;
sequence<SanitizerElement> replaceWithChildrenElements;
sequence<SanitizerAttribute> attributes;
sequence<SanitizerAttribute> removeAttributes;
boolean comments;
boolean dataAttributes;
};
@@ -304,7 +304,7 @@ interface Internals {
[CallWith=ScriptState] Promise<any> createResolvedPromise(any value);
[CallWith=ScriptState] Promise<any> createRejectedPromise(any reason);
[CallWith=ScriptState] Promise<any> addOneToPromise(Promise<any> promise);
[CallWith=ScriptState] Promise<long> addOneToPromise(Promise<long> promise);
[CallWith=ScriptState, RaisesException] Promise<any> promiseCheck(long arg1, boolean arg2, object arg3, DOMString arg4, sequence<DOMString> arg5);
[CallWith=ScriptState] Promise<any> promiseCheckWithoutExceptionState(object arg1, DOMString arg2, DOMString... variadic);
[CallWith=ScriptState] Promise<any> promiseCheckRange([EnforceRange] octet arg1);
@@ -323,8 +323,8 @@ interface Internals {
boolean isInCanvasFontCache(Document document, DOMString fontString);
unsigned long canvasFontCacheMaxFonts();
void forceLoseCanvasContext(HTMLCanvasElement canvas, DOMString contextType);
void forceLoseCanvasContext(OffscreenCanvas offscreencanvas, DOMString context_type);
void forceLoseCanvasContext(CanvasRenderingContext2D ctx);
void forceLoseCanvasContext(OffscreenCanvasRenderingContext2D ctx);
void disableCanvasAcceleration(HTMLCanvasElement canvas);
DictionaryTest dictionaryTest();
@@ -459,4 +459,7 @@ interface Internals {
// NetworkContext. Intended to be used to allow remote context executors to
// continue functioning in fenced frame WPTs after network is revoked.
[CallWith=ScriptState] Promise<undefined> exemptUrlFromNetworkRevocation(USVString url);
DOMString lastCompiledScriptFileName(Document document);
boolean lastCompiledScriptUsedCodeCache(Document document);
};

Some files were not shown because too many files have changed in this diff Show More