[AUTO][FILECONTROL] - version 126.0.6478.40 (#1194)

[AUTO][FILECONTROL] - version 126.0.6478.40
This commit is contained in:
uazo
2024-06-11 06:40:12 +00:00
committed by GitHub
115 changed files with 3418 additions and 1958 deletions
+1 -1
View File
@@ -1 +1 @@
125.0.6422.147
126.0.6478.40
@@ -266,7 +266,7 @@ AwContentBrowserClient::~AwContentBrowserClient() {}
void AwContentBrowserClient::OnNetworkServiceCreated(
network::mojom::NetworkService* network_service) {
// TODO(https://crbug.com/1085233): If CertVerifierServiceFactory is moved to
// TODO(crbug.com/40693524): If CertVerifierServiceFactory is moved to
// a separate process, this will likely need to be set somewhere else instead
// of here.
content::GetCertVerifierServiceFactory()->SetUseChromeRootStore(
@@ -429,7 +429,7 @@ AwContentBrowserClient::GetGeneratedCodeCacheSettings(
// cache for the code cache entry to be used. There are two code caches that
// both use this value, so we pass 10MB to keep the total disk usage to
// roughly 2x what it was before the code cache was implemented.
// TODO(crbug/893318): webview should have smarter cache sizing logic.
// TODO(crbug.com/41419561): webview should have smarter cache sizing logic.
AwBrowserContext* browser_context = static_cast<AwBrowserContext*>(context);
return content::GeneratedCodeCacheSettings(
true, 10 * 1024 * 1024, browser_context->GetHttpCachePath());
@@ -678,7 +678,7 @@ AwContentBrowserClient::CreateURLLoaderThrottles(
},
base::Unretained(this)),
wc_getter, frame_tree_node_id, navigation_id,
// TODO(crbug.com/1033760): rt_lookup_service is
// TODO(crbug.com/40663467): rt_lookup_service is
// used to perform real time URL check, which is gated by UKM opted-in.
// Since AW currently doesn't support UKM, this feature is not enabled.
/* rt_lookup_service */ nullptr,
@@ -738,7 +738,7 @@ AwContentBrowserClient::CreateURLLoaderThrottlesForKeepAlive(
},
base::Unretained(this)),
wc_getter, frame_tree_node_id, /*navigation_id=*/std::nullopt,
// TODO(crbug.com/1033760): rt_lookup_service is
// TODO(crbug.com/40663467): rt_lookup_service is
// used to perform real time URL check, which is gated by UKM opted-in.
// Since AW currently doesn't support UKM, this feature is not enabled.
/* rt_lookup_service */ nullptr,
@@ -950,7 +950,7 @@ void AwContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories(
}
bool AwContentBrowserClient::ShouldAllowNoLongerUsedProcessToExit() {
// TODO(crbug.com/1268454): Add Android WebView support for allowing a
// TODO(crbug.com/40803531): Add Android WebView support for allowing a
// renderer process to exit when only non-live RenderFrameHosts remain,
// without consulting the app's OnRenderProcessGone crash handlers.
return false;
@@ -969,7 +969,7 @@ bool AwContentBrowserClient::ShouldEnableStrictSiteIsolation() {
}
size_t AwContentBrowserClient::GetMaxRendererProcessCountOverride() {
// TODO(crbug.com/806404): These options can currently can only be turned by
// TODO(crbug.com/40560171): These options can currently can only be turned by
// by manually overriding command line switches because
// `ShouldDisableSiteIsolation` returns true. Should coordinate if/when
// enabling this in production.
@@ -70,7 +70,7 @@ by a child template that "extends" this file.
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<!-- TODO(https://crbug.com/1421346): Remove this tools:ignore attribute once it's no longer necessary. -->
<!-- TODO(crbug.com/40259231): Remove this tools:ignore attribute once it's no longer necessary. -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" tools:ignore="SystemPermissionTypo" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" tools:ignore="SystemPermissionTypo" />
<uses-permission android:name="android.permission.RUN_USER_INITIATED_JOBS" />
@@ -170,7 +170,7 @@ by a child template that "extends" this file.
Official builds (stable, beta, dev, canary) handle this differently,
this setting is for locally deployed ToT builds only.
TODO(https://crbug.com/1122210): remove if this is replaced by an
TODO(crbug.com/40715928): remove if this is replaced by an
alternate mechanism.
-->
<queries>
@@ -363,7 +363,7 @@ by a child template that "extends" this file.
<intent-filter tools:ignore="AppLinkUrlError">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<!-- TODO(https://crbug.com/800875): Limit these to supported MIME types. -->
<!-- TODO(crbug.com/40557607): Limit these to supported MIME types. -->
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
<data android:scheme="file" />
@@ -394,7 +394,7 @@ by a child template that "extends" this file.
<intent-filter tools:ignore="AppLinkUrlError">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<!-- TODO(https://crbug.com/800875): Limit these to supported MIME types. -->
<!-- TODO(crbug.com/40557607): Limit these to supported MIME types. -->
<data android:mimeType="audio/*" />
<data android:scheme="file" />
<data android:scheme="content" />
@@ -566,11 +566,11 @@ by a child template that "extends" this file.
</activity>
<!--
TODO(crbug.com/1093292): investigate why
TODO(crbug.com/40698801): investigate why
@android:style/Theme.NoDisplay can't be used here.
-->
<activity android:name="org.chromium.chrome.browser.sync.ui.SyncTrustedVaultProxyActivity"
android:theme="@style/Theme.MaterialComponents"
android:theme="@style/Theme.Material3.DayNight"
android:excludeFromRecents="true"
android:exported="false">
</activity>
@@ -651,18 +651,6 @@ by a child template that "extends" this file.
android:label="@string/edit_bookmark"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize">
</activity>
<activity android:name="org.chromium.chrome.browser.app.bookmarks.BookmarkAddEditFolderActivity"
android:theme="@style/Theme.Chromium.DialogWhenLarge"
android:exported="false"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize">
</activity>
<activity android:name="org.chromium.chrome.browser.app.bookmarks.BookmarkFolderSelectActivity"
android:theme="@style/Theme.Chromium.DialogWhenLarge"
android:windowSoftInputMode="stateAlwaysHidden"
android:label="@string/bookmark_choose_folder"
android:exported="false"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize">
</activity>
<activity android:name="org.chromium.chrome.browser.app.bookmarks.BookmarkFolderPickerActivity"
android:theme="@style/Theme.Chromium.DialogWhenLarge"
android:windowSoftInputMode="stateAlwaysHidden"
@@ -1191,7 +1179,7 @@ by a child template that "extends" this file.
android:excludeFromRecents="true"
android:exported="true"
android:noHistory="true"
android:theme="@style/Theme.MaterialComponents"
android:theme="@style/Theme.Material3.DayNight"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize" >
</activity>
@@ -16,6 +16,7 @@
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
@@ -126,7 +127,7 @@
#include "components/search_engines/template_url_service.h"
#include "components/sync/service/sync_service.h"
#include "components/sync/service/sync_user_settings.h"
#include "components/tpcd/metadata/manager.h"
#include "components/tpcd/metadata/browser/manager.h"
#include "components/web_cache/browser/web_cache_manager.h"
#include "components/webrtc_logging/browser/log_cleanup.h"
#include "components/webrtc_logging/browser/text_log_list.h"
@@ -154,17 +155,22 @@
#include "chrome/browser/android/customtabs/chrome_origin_verifier.h"
#include "chrome/browser/android/oom_intervention/oom_intervention_decider.h"
#include "chrome/browser/android/webapps/webapp_registry.h"
#include "chrome/browser/feed/feed_service_factory.h"
#include "chrome/browser/offline_pages/offline_page_model_factory.h"
#include "chrome/browser/profiles/profile_android.h"
#include "chrome/browser/ui/android/tab_model/tab_model.h"
#include "chrome/browser/ui/android/tab_model/tab_model_list.h"
#include "components/cdm/browser/media_drm_storage_impl.h" // nogncheck crbug.com/1125897
#include "components/feed/core/v2/public/feed_service.h"
#include "components/feed/feed_feature_list.h"
#include "components/installedapp/android/jni_headers/PackageHash_jni.h"
#include "components/offline_pages/core/offline_page_feature.h"
#include "components/offline_pages/core/offline_page_model.h"
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(ENABLE_FEED_V2)
#include "chrome/browser/feed/feed_service_factory.h"
#include "components/feed/core/v2/public/feed_service.h" // nogncheck
#include "components/feed/feed_feature_list.h"
#endif // BUILDFLAG(ENABLE_FEED_V2)
#if !BUILDFLAG(IS_ANDROID)
#include "chrome/browser/web_applications/web_app.h"
#include "chrome/browser/web_applications/web_app_command_scheduler.h"
@@ -194,10 +200,6 @@
#include "device/fido/cros/credential_store.h"
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_MAC)
#include "device/fido/mac/credential_store.h"
#endif // BUILDFLAG(IS_MAC)
#if BUILDFLAG(IS_WIN)
#include "chrome/browser/media/cdm_document_service_impl.h"
#endif // BUILDFLAG(IS_WIN)
@@ -662,8 +664,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
->OnCookiesDeleted();
}
if (filter_builder->GetMode() ==
BrowsingDataFilterBuilder::Mode::kPreserve) {
if (filter_builder->MatchesMostOriginsAndDomains()) {
auto* privacy_sandbox_settings =
PrivacySandboxSettingsFactory::GetForProfile(profile_);
if (privacy_sandbox_settings) {
@@ -779,7 +780,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
if (bookmark_model && bookmark_model->loaded()) {
if (delete_begin_.is_null() &&
(delete_end_.is_null() || delete_end_.is_max())) {
bookmark_model->RemoveAllUserBookmarks();
bookmark_model->RemoveAllUserBookmarks(FROM_HERE);
} else {
// Bookmark deletion is only implemented to remove all data after a
// profile deletion. A full implementation would need to traverse the
@@ -807,7 +808,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
ReadingListModelFactory::GetForBrowserContext(profile_);
if (reading_list_model) {
if (delete_begin_.is_null() && delete_end_.is_max()) {
reading_list_model->DeleteAllEntries();
reading_list_model->DeleteAllEntries(FROM_HERE);
} else {
NOTIMPLEMENTED();
}
@@ -850,6 +851,10 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
ContentSettingsType::APP_BANNER, base::Time(), base::Time::Max(),
website_settings_filter);
host_content_settings_map_->ClearSettingsForOneTypeWithPredicate(
ContentSettingsType::REVOKED_UNUSED_SITE_PERMISSIONS, delete_begin_,
delete_end_, website_settings_filter);
#if !BUILDFLAG(IS_ANDROID)
host_content_settings_map_->ClearSettingsForOneTypeWithPredicate(
ContentSettingsType::INTENT_PICKER_DISPLAY, delete_begin_, delete_end_,
@@ -863,10 +868,6 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
ContentSettingsType::NOTIFICATION_PERMISSION_REVIEW, delete_begin_,
delete_end_, website_settings_filter);
host_content_settings_map_->ClearSettingsForOneTypeWithPredicate(
ContentSettingsType::REVOKED_UNUSED_SITE_PERMISSIONS, delete_begin_,
delete_end_, website_settings_filter);
host_content_settings_map_->ClearSettingsForOneTypeWithPredicate(
ContentSettingsType::REVOKED_ABUSIVE_NOTIFICATION_PERMISSIONS,
delete_begin_, delete_end_, website_settings_filter);
@@ -920,7 +921,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
// TODO:(crbug.com/1167715) - Test that associated compromised credentials
// are removed.
password_store->RemoveLoginsByURLAndTime(
filter, delete_begin_, delete_end_,
FROM_HERE, filter, delete_begin_, delete_end_,
CreateTaskCompletionClosure(TracingDataType::kPasswords));
}
@@ -987,7 +988,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
constants::DATA_TYPE_ACCOUNT_PASSWORDS);
#endif
account_store->RemoveLoginsByURLAndTime(
filter, delete_begin_, delete_end_,
FROM_HERE, filter, delete_begin_, delete_end_,
CreateTaskCompletionClosure(TracingDataType::kAccountPasswords),
std::move(sync_completion));
}
@@ -1036,7 +1037,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
web_data_service->RemoveAutofillDataModifiedBetween(delete_begin_,
delete_end_);
// Clear out the Autofill StrikeDatabase in its entirety.
// TODO(crbug.com/884817): Respect |delete_begin_| and |delete_end_| and
// TODO(crbug.com/40594007): Respect |delete_begin_| and |delete_end_| and
// only clear out entries whose last strikes were created in that
// timeframe.
autofill::StrikeDatabase* strike_database =
@@ -1060,12 +1061,12 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
// DATA_TYPE_CACHE
if (remove_mask & content::BrowsingDataRemover::DATA_TYPE_CACHE) {
// Tell the renderers associated with |profile_| to clear their cache.
// TODO(crbug.com/668114): Renderer cache is a platform concept, and should
// live in BrowsingDataRemoverImpl. However, WebCacheManager itself is
// a component with dependency on content/browser. Untangle these
// TODO(crbug.com/40495069): Renderer cache is a platform concept, and
// should live in BrowsingDataRemoverImpl. However, WebCacheManager itself
// is a component with dependency on content/browser. Untangle these
// dependencies or reimplement the relevant part of WebCacheManager
// in content/browser.
// TODO(crbug.com/1022757): add a test for this.
// TODO(crbug.com/40657761): add a test for this.
for (content::RenderProcessHost::iterator iter =
content::RenderProcessHost::AllHostsIterator();
!iter.IsAtEnd(); iter.Advance()) {
@@ -1119,7 +1120,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
}
#endif
// TODO(crbug.com/829321): Remove null-check.
// TODO(crbug.com/41380998): Remove null-check.
auto* webrtc_event_log_manager = WebRtcEventLogManager::GetInstance();
if (webrtc_event_log_manager) {
webrtc_event_log_manager->ClearCacheForBrowserContext(
@@ -1316,14 +1317,15 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
//////////////////////////////////////////////////////////////////////////////
// Remove external protocol data.
if (remove_mask & constants::DATA_TYPE_EXTERNAL_PROTOCOL_DATA)
if (remove_mask & constants::DATA_TYPE_EXTERNAL_PROTOCOL_DATA &&
filter_builder->GetMode() == BrowsingDataFilterBuilder::Mode::kPreserve) {
ExternalProtocolHandler::ClearData(profile_);
}
#if BUILDFLAG(ENABLE_DOWNGRADE_PROCESSING)
//////////////////////////////////////////////////////////////////////////////
// Remove data for this profile contained in any snapshots.
if (remove_mask &&
filter_builder->GetMode() == BrowsingDataFilterBuilder::Mode::kPreserve) {
if (remove_mask && filter_builder->MatchesMostOriginsAndDomains()) {
base::ThreadPool::PostTaskAndReply(
FROM_HERE, {base::TaskPriority::USER_VISIBLE, base::MayBlock()},
base::BindOnce(&downgrade::RemoveDataForProfile, delete_begin_,
@@ -1393,6 +1395,24 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
}
}
#endif // !BUILDFLAG(IS_ANDROID)
//////////////////////////////////////////////////////////////////////////////
// DATA_TYPE_TABS
if (remove_mask & constants::DATA_TYPE_TABS) {
#if BUILDFLAG(IS_ANDROID)
base::RecordAction(UserMetricsAction("ClearBrowsingData_Tabs"));
for (TabModel* tab_model : TabModelList::models()) {
if (tab_model->GetProfile() != profile_ || tab_model->IsOffTheRecord()) {
continue;
}
tab_model->CloseTabsNavigatedInTimeWindow(delete_begin, delete_end);
}
#else // BUILDFLAG(IS_ANDROID)
NOTIMPLEMENTED();
#endif // BUILDFLAG(IS_ANDROID)
}
}
void ChromeBrowsingDataRemoverDelegate::OnTaskStarted(
@@ -1621,11 +1641,7 @@ void ChromeBrowsingDataRemoverDelegate::OnClearPlatformKeys(
std::unique_ptr<device::fido::PlatformCredentialStore>
ChromeBrowsingDataRemoverDelegate::MakeCredentialStore() {
return
#if BUILDFLAG(IS_MAC)
std::make_unique<device::fido::mac::TouchIdCredentialStore>(
ChromeWebAuthenticationDelegate::TouchIdAuthenticatorConfigForProfile(
profile_));
#elif BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
std::make_unique<
device::fido::cros::PlatformAuthenticatorCredentialStore>();
#else
@@ -23,6 +23,7 @@
#include "chrome/browser/media/media_engagement_score_details.mojom.h"
#include "chrome/browser/model_execution/model_manager_impl.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"
@@ -103,9 +104,11 @@
#include "services/image_annotation/public/mojom/image_annotation.mojom.h"
#include "services/screen_ai/buildflags/buildflags.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/features_generated.h"
#include "third_party/blink/public/mojom/credentialmanagement/credential_manager.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"
@@ -134,8 +137,7 @@
#include "chrome/browser/ui/webui/connectors_internals/connectors_internals_ui.h"
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_FUCHSIA)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
#include "chrome/browser/ui/webui/app_settings/web_app_settings_ui.h"
#include "ui/webui/resources/cr_components/app_management/app_management.mojom.h"
#endif
@@ -175,14 +177,14 @@
#if !defined(OFFICIAL_BUILD)
#include "chrome/browser/ui/webui/new_tab_page/foo/foo.mojom.h" // nogncheck crbug.com/1125897
#endif
#include "chrome/browser/ui/lens/lens_untrusted_ui.h"
#include "chrome/browser/ui/lens/search_bubble_ui.h"
#include "chrome/browser/ui/side_panel/customize_chrome/customize_chrome_utils.h"
#include "chrome/browser/ui/webui/commerce/product_specifications_ui.h"
#include "chrome/browser/ui/webui/commerce/shopping_insights_side_panel_ui.h"
#include "chrome/browser/ui/webui/hats/hats_ui.h"
#include "chrome/browser/ui/webui/history/history_ui.h"
#include "chrome/browser/ui/webui/internals/user_education/user_education_internals.mojom.h"
#include "chrome/browser/ui/webui/lens/lens_untrusted_ui.h"
#include "chrome/browser/ui/webui/lens/search_bubble_ui.h"
#include "chrome/browser/ui/webui/new_tab_page/new_tab_page.mojom.h"
#include "chrome/browser/ui/webui/new_tab_page/new_tab_page_ui.h"
#include "chrome/browser/ui/webui/new_tab_page_third_party/new_tab_page_third_party_ui.h"
@@ -359,6 +361,7 @@
#include "chrome/browser/ui/webui/ash/set_time_ui.h"
#include "chrome/browser/ui/webui/ash/settings/os_settings_ui.h"
#include "chrome/browser/ui/webui/ash/settings/pages/apps/mojom/app_notification_handler.mojom.h"
#include "chrome/browser/ui/webui/ash/settings/pages/apps/mojom/app_parental_controls_handler.mojom.h"
#include "chrome/browser/ui/webui/ash/settings/pages/device/display_settings/display_settings_provider.mojom.h"
#include "chrome/browser/ui/webui/ash/settings/pages/device/input_device_settings/input_device_settings_provider.mojom.h"
#include "chrome/browser/ui/webui/ash/settings/pages/files/mojom/google_drive_handler.mojom.h"
@@ -382,6 +385,7 @@
#include "chromeos/ash/services/cellular_setup/public/mojom/esim_manager.mojom.h"
#include "chromeos/ash/services/connectivity/public/mojom/passpoint.mojom.h"
#include "chromeos/ash/services/hotspot_config/public/mojom/cros_hotspot_config.mojom.h"
#include "chromeos/ash/services/ime/public/mojom/input_method_user_data.mojom.h"
#include "chromeos/ash/services/multidevice_setup/multidevice_setup_service.h"
#include "chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h"
#include "chromeos/ash/services/nearby/public/mojom/nearby_share_settings.mojom.h" // nogncheck crbug.com/1125897
@@ -1084,6 +1088,11 @@ void PopulateChromeFrameBinders(
map->Add<blink::mojom::WebPrintingService>(
base::BindRepeating(&printing::CreateWebPrintingServiceForFrame));
#endif
if (base::FeatureList::IsEnabled(blink::features::kEnableTranslationAPI)) {
map->Add<blink::mojom::TranslationManager>(
base::BindRepeating(&TranslationManagerImpl::Create));
}
}
void PopulateChromeWebUIFrameBinders(
@@ -1139,8 +1148,7 @@ void PopulateChromeWebUIFrameBinders(
policy::DlpInternalsUI>(map);
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_FUCHSIA)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
RegisterWebUIControllerInterfaceBinder<
app_management::mojom::PageHandlerFactory, WebAppSettingsUI>(map);
#endif
@@ -1163,6 +1171,9 @@ void PopulateChromeWebUIFrameBinders(
if (lens::features::IsLensOverlayEnabled()) {
RegisterWebUIControllerInterfaceBinder<lens::mojom::LensPageHandlerFactory,
lens::LensUntrustedUI>(map);
}
if (lens::features::IsLensOverlaySearchBubbleEnabled()) {
RegisterWebUIControllerInterfaceBinder<
lens::mojom::SearchBubblePageHandlerFactory, lens::SearchBubbleUI>(map);
}
@@ -1185,6 +1196,7 @@ void PopulateChromeWebUIFrameBinders(
ash::EmojiUI, ash::RemoteMaintenanceCurtainUI,
ash::app_install::AppInstallDialogUI,
ash::printing::print_preview::PrintPreviewCrosUI,
ash::extended_updates::ExtendedUpdatesUI,
#endif
NewTabPageUI, OmniboxPopupUI, BookmarksSidePanelUI, CustomizeChromeUI,
InternalsUI, ReadingListUI, TabSearchUI, WebuiGalleryUI,
@@ -1270,7 +1282,7 @@ void PopulateChromeWebUIFrameBinders(
map);
#endif // !defined(OFFICIAL_BUILD)
if (IsCartModuleEnabled() && customize_chrome::IsSidePanelEnabled()) {
if (IsCartModuleEnabled()) {
RegisterWebUIControllerInterfaceBinder<chrome_cart::mojom::CartHandler,
NewTabPageUI, CustomizeChromeUI>(
map);
@@ -1340,7 +1352,7 @@ void PopulateChromeWebUIFrameBinders(
RegisterWebUIControllerInterfaceBinder<
shopping_service::mojom::ShoppingServiceHandlerFactory,
BookmarksSidePanelUI, commerce::ProductSpecificationsUI,
ShoppingInsightsSidePanelUI>(map);
ShoppingInsightsSidePanelUI, HistoryUI>(map);
if (base::FeatureList::IsEnabled(
performance_manager::features::kPerformanceControlsSidePanel)) {
@@ -1349,19 +1361,23 @@ void PopulateChromeWebUIFrameBinders(
PerformanceSidePanelUI>(map);
}
if (customize_chrome::IsSidePanelEnabled()) {
RegisterWebUIControllerInterfaceBinder<
side_panel::mojom::CustomizeChromePageHandlerFactory,
CustomizeChromeUI>(map);
RegisterWebUIControllerInterfaceBinder<
side_panel::mojom::CustomizeChromePageHandlerFactory, CustomizeChromeUI>(
map);
if (base::FeatureList::IsEnabled(
ntp_features::kCustomizeChromeWallpaperSearch) &&
base::FeatureList::IsEnabled(
optimization_guide::features::kOptimizationGuideModelExecution)) {
RegisterWebUIControllerInterfaceBinder<
side_panel::customize_chrome::mojom::WallpaperSearchHandlerFactory,
CustomizeChromeUI>(map);
}
if (base::FeatureList::IsEnabled(
ntp_features::kCustomizeChromeWallpaperSearch) &&
base::FeatureList::IsEnabled(
optimization_guide::features::kOptimizationGuideModelExecution)) {
RegisterWebUIControllerInterfaceBinder<
side_panel::customize_chrome::mojom::WallpaperSearchHandlerFactory,
CustomizeChromeUI>(map);
}
if (features::IsToolbarPinningEnabled()) {
RegisterWebUIControllerInterfaceBinder<
side_panel::customize_chrome::mojom::CustomizeToolbarHandlerFactory,
CustomizeChromeUI>(map);
}
if (user_notes::IsUserNotesEnabled()) {
@@ -1432,6 +1448,10 @@ void PopulateChromeWebUIFrameBinders(
ash::settings::app_permission::mojom::AppPermissionsHandler,
ash::settings::OSSettingsUI>(map);
RegisterWebUIControllerInterfaceBinder<
ash::settings::app_parental_controls::mojom::AppParentalControlsHandler,
ash::settings::OSSettingsUI>(map);
RegisterWebUIControllerInterfaceBinder<
ash::settings::mojom::InputDeviceSettingsProvider,
ash::settings::OSSettingsUI>(map);
@@ -1676,6 +1696,13 @@ void PopulateChromeWebUIFrameBinders(
ash::settings::OSSettingsUI>(map);
}
if (base::FeatureList::IsEnabled(
ash::features::kSystemJapanesePhysicalTyping)) {
RegisterWebUIControllerInterfaceBinder<
ash::ime::mojom::InputMethodUserDataService,
ash::settings::OSSettingsUI>(map);
}
RegisterWebUIControllerInterfaceBinder<audio::mojom::PageHandlerFactory,
ash::AudioUI>(map);
@@ -36,7 +36,6 @@
#include "base/stl_util.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -64,6 +63,7 @@
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
#include "chrome/browser/data_saver/data_saver.h"
#include "chrome/browser/data_sharing/data_sharing_navigation_throttle.h"
#include "chrome/browser/defaults.h"
#include "chrome/browser/device_api/device_service_impl.h"
#include "chrome/browser/device_api/managed_configuration_service.h"
@@ -71,7 +71,6 @@
#include "chrome/browser/download/chrome_download_manager_delegate.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/enterprise/browser_management/management_service_factory.h"
#include "chrome/browser/enterprise/connectors/connectors_service.h"
#include "chrome/browser/enterprise/reporting/legacy_tech/legacy_tech_service.h"
#include "chrome/browser/enterprise/reporting/prefs.h"
#include "chrome/browser/enterprise/util/managed_browser_utils.h"
@@ -165,6 +164,8 @@
#include "chrome/browser/supervised_user/supervised_user_google_auth_navigation_throttle.h"
#include "chrome/browser/supervised_user/supervised_user_navigation_throttle.h"
#include "chrome/browser/task_manager/sampling/task_manager_impl.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/tracing/chrome_tracing_delegate.h"
#include "chrome/browser/translate/translate_service.h"
#include "chrome/browser/ui/blocked_content/blocked_window_params.h"
@@ -173,6 +174,7 @@
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/browser_navigator_params.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
#include "chrome/browser/ui/lens/lens_overlay_side_panel_navigation_throttle.h"
#include "chrome/browser/ui/login/http_auth_coordinator.h"
#include "chrome/browser/ui/login/login_navigation_throttle.h"
#include "chrome/browser/ui/passwords/password_manager_navigation_throttle.h"
@@ -367,7 +369,6 @@
#include "sandbox/policy/features.h"
#include "sandbox/policy/mojom/sandbox.mojom.h"
#include "sandbox/policy/switches.h"
#include "services/device/public/cpp/geolocation/geolocation_system_permission_manager.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/is_potentially_trustworthy.h"
@@ -465,7 +466,7 @@
#include "components/user_manager/user_manager.h"
#include "services/service_manager/public/mojom/interface_provider_spec.mojom.h"
#include "storage/browser/file_system/external_mount_points.h"
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chrome/browser/chrome_browser_main_linux.h"
@@ -504,8 +505,6 @@
#endif // BUILDFLAG(DFMIFY_DEV_UI)
#elif BUILDFLAG(IS_POSIX)
#include "chrome/browser/chrome_browser_main_posix.h"
#elif BUILDFLAG(IS_FUCHSIA)
#include "chrome/browser/fuchsia/chrome_browser_main_parts_fuchsia.h"
#endif
#if !BUILDFLAG(IS_ANDROID)
@@ -569,13 +568,15 @@
#include "chrome/browser/webauthn/chrome_authenticator_request_delegate.h"
#include "chrome/grit/chrome_unscaled_resources.h" // nogncheck crbug.com/1125897
#include "components/commerce/core/commerce_feature_list.h"
#include "components/lens/lens_features.h"
#include "components/media_effects/media_effects_manager_binder.h"
#include "components/password_manager/content/common/web_ui_constants.h"
#include "components/password_manager/core/common/password_manager_features.h"
#include "chrome/browser/enterprise/connectors/connectors_service.h"
#include "third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom.h"
#endif // !BUILDFLAG(IS_ANDROID)
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
@@ -614,7 +615,6 @@
#if BUILDFLAG(ENABLE_LENS_DESKTOP_GOOGLE_BRANDED_FEATURES)
#include "chrome/browser/ui/lens/lens_side_panel_navigation_helper.h"
#include "components/lens/lens_features.h"
#endif
#if BUILDFLAG(IS_LINUX)
@@ -755,8 +755,13 @@
#if BUILDFLAG(ENTERPRISE_DATA_CONTROLS)
#include "chrome/browser/enterprise/data_protection/data_protection_clipboard_utils.h"
#include "chrome/browser/enterprise/data_protection/paste_allowed_request.h"
#endif // BUILDFLAG(ENTERPRISE_DATA_CONTROLS)
#if BUILDFLAG(OS_LEVEL_GEOLOCATION_PERMISSION_SUPPORTED)
#include "services/device/public/cpp/geolocation/geolocation_system_permission_manager.h"
#endif // BUILDFLAG(OS_LEVEL_GEOLOCATION_PERMISSION_SUPPORTED)
using blink::mojom::EffectiveConnectionType;
using blink::web_pref::WebPreferences;
using content::BrowserThread;
@@ -1019,9 +1024,9 @@ bool URLHasExtensionPermission(extensions::ProcessMap* process_map,
// Returns true if |extension_id| is allowed to run as an Isolated Context,
// giving it access to additional APIs.
bool IsExtensionIdAllowedToUseIsolatedContext(base::StringPiece extension_id) {
bool IsExtensionIdAllowedToUseIsolatedContext(std::string_view extension_id) {
static constexpr auto kAllowedIsolatedContextExtensionIds =
base::MakeFixedFlatSet<base::StringPiece>({
base::MakeFixedFlatSet<std::string_view>({
"algkcnfjnajfhgimadimbjhmpaeohhln", // Secure Shell Extension (dev)
"iodihamcpbpeioajjeobimgagajmlibd", // Secure Shell Extension
// (stable)
@@ -1644,9 +1649,6 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) {
#elif BUILDFLAG(IS_POSIX)
main_parts = std::make_unique<ChromeBrowserMainPartsPosix>(
is_integration_test, &startup_data_);
#elif BUILDFLAG(IS_FUCHSIA)
main_parts = std::make_unique<ChromeBrowserMainPartsFuchsia>(
is_integration_test, &startup_data_);
#else
#error "Unimplemented platform"
#endif
@@ -1670,7 +1672,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) {
#if BUILDFLAG(IS_CHROMEOS_LACROS)
main_parts->AddParts(
std::make_unique<ChromeBrowserMainExtraPartsViewsLacros>());
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
main_parts->AddParts(
@@ -2012,7 +2014,7 @@ bool ChromeContentBrowserClient::DoesWebUIUrlRequireProcessLock(
}
bool ChromeContentBrowserClient::ShouldTreatURLSchemeAsFirstPartyWhenTopLevel(
base::StringPiece scheme,
std::string_view scheme,
bool is_embedded_origin_secure) {
// This is needed to bypass the normal SameSite rules for any chrome:// page
// embedding a secure origin, regardless of the registrable domains of any
@@ -2030,12 +2032,12 @@ bool ChromeContentBrowserClient::ShouldTreatURLSchemeAsFirstPartyWhenTopLevel(
bool ChromeContentBrowserClient::
ShouldIgnoreSameSiteCookieRestrictionsWhenTopLevel(
base::StringPiece scheme,
std::string_view scheme,
bool is_embedded_origin_secure) {
return is_embedded_origin_secure && scheme == content::kChromeUIScheme;
}
// TODO(crbug.com/1087559): This is based on SubframeTask::GetTitle()
// TODO(crbug.com/40694933): This is based on SubframeTask::GetTitle()
// implementation. Find a general solution to avoid code duplication.
std::string ChromeContentBrowserClient::GetSiteDisplayNameForCdmProcess(
content::BrowserContext* browser_context,
@@ -2184,11 +2186,11 @@ bool ChromeContentBrowserClient::ShouldStayInParentProcessForNTP(
// TODO(alexmos): Consider further tightening this exception to just the
// third-party remote NTP in the parent, rather than any NTP.
//
// TODO(crbug.com/566091): place those iframes into OOPIFs and remove this
// TODO(crbug.com/40447789): place those iframes into OOPIFs and remove this
// exception. Relaxing site isolation like this is a bad idea and should be
// avoided.
//
// TODO(crbug.com/624410): clean up the logic for detecting NTP.
// TODO(crbug.com/41261582): clean up the logic for detecting NTP.
return url.SchemeIs(chrome::kChromeSearchScheme) &&
url.host() == chrome::kChromeSearchMostVisitedHost &&
search::IsNTPURL(parent_site_url);
@@ -2670,7 +2672,8 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
}
// Enable SharedArrayBuffer on desktop if allowed by Enterprise Policy.
// TODO(crbug.com/1144104) Remove when migration to COOP+COEP is complete.
// TODO(crbug.com/40155376) Remove when migration to COOP+COEP is
// complete.
if (prefs->GetBoolean(
prefs::kSharedArrayBufferUnrestrictedAccessAllowed)) {
command_line->AppendSwitch(
@@ -2875,10 +2878,12 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
if (process_type != switches::kZygoteProcess) {
// The switch value depends on the "HeapProfilerCentralControl" feature, and
// the zygote starts before the FeatureList is available.
heap_profiling::HeapProfilerController::
AppendCommandLineSwitchForChildProcess(
command_line, chrome::GetChannel(),
GetProfileParamsProcess(*command_line));
if (const auto* heap_profiler_controller =
heap_profiling::HeapProfilerController::GetInstance()) {
heap_profiler_controller->AppendCommandLineSwitchForChildProcess(
command_line, GetProfileParamsProcess(*command_line),
child_process_id);
}
}
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
@@ -3180,7 +3185,7 @@ ChromeContentBrowserClient::AllowWebBluetooth(
content::BrowserContext* browser_context,
const url::Origin& requesting_origin,
const url::Origin& embedding_origin) {
// TODO(crbug.com/598890): Don't disable if
// TODO(crbug.com/40462828): Don't disable if
// base::CommandLine::ForCurrentProcess()->
// HasSwitch(switches::kEnableWebBluetooth) is true.
if (base::GetFieldTrialParamValue(
@@ -3395,13 +3400,15 @@ bool ChromeContentBrowserClient::IsSharedStorageAllowed(
content::RenderFrameHost* rfh,
const url::Origin& top_frame_origin,
const url::Origin& accessing_origin,
std::string* out_debug_message) {
std::string* out_debug_message,
bool* out_block_is_site_setting_specific) {
Profile* profile = Profile::FromBrowserContext(browser_context);
auto* privacy_sandbox_settings =
PrivacySandboxSettingsFactory::GetForProfile(profile);
DCHECK(privacy_sandbox_settings);
bool allowed = privacy_sandbox_settings->IsSharedStorageAllowed(
top_frame_origin, accessing_origin, out_debug_message, rfh);
top_frame_origin, accessing_origin, out_debug_message, rfh,
out_block_is_site_setting_specific);
if (rfh) {
content_settings::PageSpecificContentSettings::BrowsingDataAccessed(
rfh, blink::StorageKey::CreateFirstParty(accessing_origin),
@@ -3414,26 +3421,29 @@ bool ChromeContentBrowserClient::IsSharedStorageSelectURLAllowed(
content::BrowserContext* browser_context,
const url::Origin& top_frame_origin,
const url::Origin& accessing_origin,
std::string* out_debug_message) {
std::string* out_debug_message,
bool* out_block_is_site_setting_specific) {
Profile* profile = Profile::FromBrowserContext(browser_context);
auto* privacy_sandbox_settings =
PrivacySandboxSettingsFactory::GetForProfile(profile);
DCHECK(privacy_sandbox_settings);
return privacy_sandbox_settings->IsSharedStorageSelectURLAllowed(
top_frame_origin, accessing_origin, out_debug_message);
top_frame_origin, accessing_origin, out_debug_message,
out_block_is_site_setting_specific);
}
bool ChromeContentBrowserClient::IsPrivateAggregationAllowed(
content::BrowserContext* browser_context,
const url::Origin& top_frame_origin,
const url::Origin& reporting_origin) {
const url::Origin& reporting_origin,
bool* out_block_is_site_setting_specific) {
Profile* profile = Profile::FromBrowserContext(browser_context);
auto* privacy_sandbox_settings =
PrivacySandboxSettingsFactory::GetForProfile(profile);
DCHECK(privacy_sandbox_settings);
return privacy_sandbox_settings->IsPrivateAggregationAllowed(
top_frame_origin, reporting_origin);
top_frame_origin, reporting_origin, out_block_is_site_setting_specific);
}
bool ChromeContentBrowserClient::IsPrivateAggregationDebugModeAllowed(
@@ -3537,7 +3547,7 @@ std::string ChromeContentBrowserClient::GetGeolocationApiKey() {
return google_apis::GetAPIKey();
}
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(OS_LEVEL_GEOLOCATION_PERMISSION_SUPPORTED)
device::GeolocationSystemPermissionManager*
ChromeContentBrowserClient::GetGeolocationSystemPermissionManager() {
return device::GeolocationSystemPermissionManager::GetInstance();
@@ -3693,7 +3703,7 @@ bool UpdatePreferredColorScheme(WebPreferences* web_prefs,
delegate->IsNightModeEnabled()
? blink::mojom::PreferredColorScheme::kDark
: blink::mojom::PreferredColorScheme::kLight;
web_prefs->browser_preferred_color_scheme =
web_prefs->preferred_root_scrollbar_color_scheme =
web_prefs->preferred_color_scheme;
}
#else
@@ -3701,10 +3711,22 @@ bool UpdatePreferredColorScheme(WebPreferences* web_prefs,
web_prefs->preferred_color_scheme =
ToBlinkPreferredColorScheme(native_theme->GetPreferredColorScheme());
bool using_different_colored_frame = false;
if (Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext())) {
if (ThemeService* theme_service =
ThemeServiceFactory::GetForProfile(profile)) {
using_different_colored_frame = !theme_service->UsingDefaultTheme() ||
theme_service->GetUserColor().has_value();
}
}
// Update based on the ColorProvider associated with `web_contents`. Depends
// on the browser color mode settings.
web_prefs->browser_preferred_color_scheme =
web_contents->GetColorMode() == ui::ColorProviderKey::ColorMode::kLight
// on the browser color mode settings and whether the user profile has set a
// custom coloring for the browser ui.
web_prefs->preferred_root_scrollbar_color_scheme =
web_contents->GetColorMode() == ui::ColorProviderKey::ColorMode::kLight ||
using_different_colored_frame
? blink::mojom::PreferredColorScheme::kLight
: blink::mojom::PreferredColorScheme::kDark;
#endif // BUILDFLAG(IS_ANDROID)
@@ -4321,7 +4343,6 @@ void ChromeContentBrowserClient::OverrideWebkitPrefs(
// If the pref is not set, the default value (true) will be used:
web_prefs->webxr_immersive_ar_allowed =
prefs->GetBoolean(prefs::kWebXRImmersiveArEnabled);
#endif
// Only set `databases_enabled` if disabled, otherwise check blink::feature
// settings.
@@ -4329,14 +4350,10 @@ void ChromeContentBrowserClient::OverrideWebkitPrefs(
!web_prefs->databases_enabled
? false
: base::FeatureList::IsEnabled(blink::features::kWebSQLAccess);
#if BUILDFLAG(IS_FUCHSIA)
// Disable WebSQL support since it is being removed from the web platform
// and does not work. See crbug.com/1317431.
#else
// TODO(crbug.com/333756088): WebSQL is disabled everywhere except Android
// WebView.
web_prefs->databases_enabled = false;
// TODO(crbug.com/1311019): Implement WebAuthn integration and remove.
web_prefs->disable_webauthn = true;
#endif
for (auto& parts : extra_parts_) {
@@ -4582,6 +4599,7 @@ void ChromeContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem(
additional_allowed_schemes->push_back(content::kChromeDevToolsScheme);
additional_allowed_schemes->push_back(content::kChromeUIScheme);
additional_allowed_schemes->push_back(content::kChromeUIUntrustedScheme);
additional_allowed_schemes->push_back(chrome::kIsolatedAppScheme);
for (auto& extra_part : extra_parts_) {
extra_part->GetAdditionalAllowedSchemesForFileSystem(
additional_allowed_schemes);
@@ -4721,7 +4739,7 @@ void ChromeContentBrowserClient::GetAdditionalMappedFilesForZygote(
// inexpensive, an the features which control Mojo behavior aren't relevant
// for this operation.
//
// TODO(https://crbug.com/1299283): This will need to be changed before
// TODO(crbug.com/40058840): This will need to be changed before
// MojoIpcz experimentation can happen on Lacros, as it results in
// inconsistent MojoIpcz feature status across Mojo initializations.
mojo::core::Init();
@@ -5310,6 +5328,18 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
MaybeAddThrottle(ReadAnythingSidePanelNavigationThrottle::CreateFor(handle),
&throttles);
}
if (lens::features::IsLensOverlayEnabled()) {
if (profile) {
if (ThemeService* theme_service =
ThemeServiceFactory::GetForProfile(profile)) {
MaybeAddThrottle(
lens::LensOverlaySidePanelNavigationThrottle::MaybeCreateFor(
handle, theme_service),
&throttles);
}
}
}
#endif
#if BUILDFLAG(ENABLE_OFFLINE_PAGES)
@@ -5373,6 +5403,11 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
MaybeAddThrottle(MaybeCreateVisitedLinkNavigationThrottleFor(handle),
&throttles);
MaybeAddThrottle(
data_sharing::DataSharingNavigationThrottle::MaybeCreateThrottleFor(
handle),
&throttles);
return throttles;
}
@@ -5638,8 +5673,6 @@ ChromeContentBrowserClient::MaybeCreateSafeBrowsingURLLoaderThrottle(
profile->IsOffTheRecord(), profile->GetPrefs(),
safe_browsing::hash_realtime_utils::GetCountryCode(
g_browser_process->variations_service()),
safe_browsing::hash_realtime_utils::GetLatestCountryCode(
g_browser_process->variations_service()),
/*log_usage_histograms=*/true);
safe_browsing::AsyncCheckTracker* async_check_tracker =
GetAsyncCheckTracker(wc_getter, is_enterprise_lookup_enabled,
@@ -5901,8 +5934,8 @@ ChromeContentBrowserClient::CreateNonNetworkNavigationURLLoaderFactory(
if (content::IsolatedWebAppsPolicy::AreIsolatedWebAppsEnabled(
browser_context) &&
!browser_context->ShutdownStarted()) {
return web_app::IsolatedWebAppURLLoaderFactory::Create(frame_tree_node_id,
browser_context);
return web_app::IsolatedWebAppURLLoaderFactory::CreateForFrame(
browser_context, /*app_origin=*/std::nullopt, frame_tree_node_id);
}
return {};
@@ -5925,10 +5958,9 @@ void ChromeContentBrowserClient::
if (content::IsolatedWebAppsPolicy::AreIsolatedWebAppsEnabled(
browser_context) &&
!browser_context->ShutdownStarted()) {
factories->emplace(
chrome::kIsolatedAppScheme,
web_app::IsolatedWebAppURLLoaderFactory::CreateForServiceWorker(
browser_context));
factories->emplace(chrome::kIsolatedAppScheme,
web_app::IsolatedWebAppURLLoaderFactory::Create(
browser_context, /*app_origin=*/std::nullopt));
}
#endif // !BUILDFLAG(IS_ANDROID)
@@ -5954,10 +5986,9 @@ void ChromeContentBrowserClient::
if (content::IsolatedWebAppsPolicy::AreIsolatedWebAppsEnabled(
browser_context) &&
!browser_context->ShutdownStarted()) {
factories->emplace(
chrome::kIsolatedAppScheme,
web_app::IsolatedWebAppURLLoaderFactory::CreateForServiceWorker(
browser_context));
factories->emplace(chrome::kIsolatedAppScheme,
web_app::IsolatedWebAppURLLoaderFactory::Create(
browser_context, /*app_origin=*/std::nullopt));
}
#endif // !BUILDFLAG(IS_ANDROID)
@@ -6202,23 +6233,25 @@ void ChromeContentBrowserClient::
#if !BUILDFLAG(IS_ANDROID)
{
content::BrowserContext* browser_context =
content::RenderProcessHost::FromID(render_process_id)
->GetBrowserContext();
auto* rph = content::RenderProcessHost::FromID(render_process_id);
content::BrowserContext* browser_context = rph->GetBrowserContext();
DCHECK(browser_context);
bool is_initiator_iwa =
request_initiator_origin.has_value() &&
request_initiator_origin->scheme() == chrome::kIsolatedAppScheme;
if (content::IsolatedWebAppsPolicy::AreIsolatedWebAppsEnabled(
browser_context) &&
!browser_context->ShutdownStarted()) {
!browser_context->ShutdownStarted() && is_initiator_iwa) {
if (frame_host != nullptr) {
factories->emplace(
chrome::kIsolatedAppScheme,
web_app::IsolatedWebAppURLLoaderFactory::Create(
frame_host->GetFrameTreeNodeId(), browser_context));
web_app::IsolatedWebAppURLLoaderFactory::CreateForFrame(
browser_context, request_initiator_origin,
frame_host->GetFrameTreeNodeId()));
} else {
factories->emplace(
chrome::kIsolatedAppScheme,
web_app::IsolatedWebAppURLLoaderFactory::CreateForServiceWorker(
browser_context));
factories->emplace(chrome::kIsolatedAppScheme,
web_app::IsolatedWebAppURLLoaderFactory::Create(
browser_context, request_initiator_origin));
}
}
}
@@ -6249,7 +6282,7 @@ void ChromeContentBrowserClient::
// For service worker contexts, we only allow file access. The remainder of
// this code is used to allow extensions to access chrome:-scheme
// resources, which we are moving away from.
// TODO(crbug.com/1280411) Factories should not be created for unloaded
// TODO(crbug.com/40811448) Factories should not be created for unloaded
// extensions.
if (extension) {
InitializeFileURLLoaderFactoryForExtension(
@@ -6301,7 +6334,7 @@ void ChromeContentBrowserClient::WillCreateURLLoaderFactory(
signin::ProxyingURLLoaderFactory::MaybeProxyRequest(
frame, type == URLLoaderFactoryType::kNavigation, request_initiator,
factory_builder);
isolation_info, factory_builder);
#if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION)
if (disable_secure_dns) {
@@ -6395,7 +6428,7 @@ void ChromeContentBrowserClient::CreateWebSocket(
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
handshake_client) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
// TODO(crbug.com/1243518): Request w/o a frame also should be proxied.
// TODO(crbug.com/40195467): Request w/o a frame also should be proxied.
if (!frame) {
return;
}
@@ -6487,7 +6520,7 @@ void ChromeContentBrowserClient::MaybeInterceptWebTransport(
WillCreateWebTransportCallback callback) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// TODO(1243518): Add a unit test which calls
// TODO(crbug.com/40195467): Add a unit test which calls
// ChromeContentBrowserClient::WillCreateWebTransport() with invalid process
// id and routing id.
auto* render_process_host = content::RenderProcessHost::FromID(process_id);
@@ -6873,8 +6906,8 @@ bool ChromeContentBrowserClient::HandleExternalProtocol(
sandbox_flags, has_user_gesture, initiating_origin,
std::move(weak_initiator_document), out_factory);
#else
// TODO(crbug.com/1394838): Figure out why this was initially made async, and,
// if possible, unify with the sync path above.
// TODO(crbug.com/40248796): Figure out why this was initially made async,
// and, if possible, unify with the sync path above.
content::GetUIThreadTaskRunner({})->PostTask(
FROM_HERE,
base::BindOnce(&LaunchURL, weak_factory_.GetWeakPtr(), url,
@@ -6949,7 +6982,7 @@ bool ChromeContentBrowserClient::HandleWebUI(
#endif
#if BUILDFLAG(IS_WIN)
// TODO(crbug.com/1003960): Remove when issue is resolved.
// TODO(crbug.com/40647483): Remove when issue is resolved.
if (url->SchemeIs(content::kChromeUIScheme) &&
url->host() == chrome::kChromeUIWelcomeWin10Host) {
*url =
@@ -7017,7 +7050,7 @@ bool ChromeContentBrowserClient::HandleWebUIReverse(
GURL* url,
content::BrowserContext* browser_context) {
#if BUILDFLAG(IS_WIN)
// TODO(crbug.com/1003960): Remove when issue is resolved.
// TODO(crbug.com/40647483): Remove when issue is resolved.
// No need to actually reverse-rewrite the URL, but return true to update the
// displayed URL when rewriting chrome://welcome-win10 to chrome://welcome.
if (url->SchemeIs(content::kChromeUIScheme) &&
@@ -7027,7 +7060,7 @@ bool ChromeContentBrowserClient::HandleWebUIReverse(
#endif // BUILDFLAG(IS_WIN)
#if !BUILDFLAG(IS_ANDROID)
// TODO(crbug.com/1420597): Remove this after feature is launched.
// TODO(crbug.com/40258836): Remove this after feature is launched.
// No need to actually reverse-rewrite the URL, but return true to update the
// displayed URL when rewriting chrome://settings/passwords to
// chrome://password-manager.
@@ -7350,15 +7383,8 @@ void ChromeContentBrowserClient::AugmentNavigationDownloadPolicy(
throttle_manager->IsRenderFrameHostTaggedAsAd(frame_host)) {
download_policy->SetAllowed(blink::NavigationDownloadType::kAdFrame);
if (!user_gesture) {
if (base::FeatureList::IsEnabled(
blink::features::
kBlockingDownloadsInAdFrameWithoutUserActivation)) {
download_policy->SetDisallowed(
blink::NavigationDownloadType::kAdFrameNoGesture);
} else {
download_policy->SetAllowed(
blink::NavigationDownloadType::kAdFrameNoGesture);
}
download_policy->SetDisallowed(
blink::NavigationDownloadType::kAdFrameNoGesture);
}
}
}
@@ -7546,7 +7572,7 @@ void ChromeContentBrowserClient::IsClipboardPasteAllowedByPolicy(
ClipboardPasteData clipboard_paste_data,
IsClipboardPasteAllowedCallback callback) {
#if BUILDFLAG(ENTERPRISE_DATA_CONTROLS)
enterprise_data_protection::PasteIfAllowedByPolicy(
enterprise_data_protection::PasteAllowedRequest::StartPasteAllowedRequest(
source, destination, metadata, std::move(clipboard_paste_data),
std::move(callback));
#else
@@ -7617,6 +7643,20 @@ bool ChromeContentBrowserClient::
#endif
}
void ChromeContentBrowserClient::
GrantAdditionalRequestPrivilegesToWorkerProcess(int child_id,
const GURL& script_url) {
#if !BUILDFLAG(IS_ANDROID)
// IWA Service Workers need to be explicitly granted access to their origin
// because isolated-app: isn't a web-safe scheme that can be accessed by
// default.
if (script_url.SchemeIs(chrome::kIsolatedAppScheme)) {
ChildProcessSecurityPolicy::GetInstance()->GrantRequestOrigin(
child_id, url::Origin::Create(script_url));
}
#endif // !BUILDFLAG(IS_ANDROID)
}
content::ContentBrowserClient::PrivateNetworkRequestPolicyOverride
ChromeContentBrowserClient::ShouldOverridePrivateNetworkRequestPolicy(
content::BrowserContext* browser_context,
@@ -7800,13 +7840,14 @@ void RunDigitalIdentityCallback(
void ChromeContentBrowserClient::ShowDigitalIdentityInterstitialIfNeeded(
content::WebContents& web_contents,
const url::Origin& origin,
bool is_only_requesting_age,
DigitalIdentityInterstitialCallback callback) {
auto bridge =
std::make_unique<DigitalIdentitySafetyInterstitialBridgeAndroid>();
auto* bridge_ptr = bridge.get();
// Callback takes ownership of |bridge|.
bridge_ptr->ShowInterstitialIfNeeded(
web_contents, origin,
web_contents, origin, is_only_requesting_age,
base::BindOnce(&RunDigitalIdentityCallback, std::move(bridge),
std::move(callback)));
}
@@ -8005,6 +8046,15 @@ void ChromeContentBrowserClient::OnSharedStorageWorkletHostCreated(
}
}
void ChromeContentBrowserClient::OnSharedStorageSelectURLCalled(
content::RenderFrameHost* main_rfh) {
if (auto* observer =
page_load_metrics::MetricsWebContentsObserver::FromWebContents(
WebContents::FromRenderFrameHost(main_rfh))) {
observer->OnSharedStorageSelectURLCalled(main_rfh);
}
}
bool ChromeContentBrowserClient::ShouldSendOutermostOriginToRenderer(
const url::Origin& outermost_origin) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -28,7 +28,6 @@
#include "chrome/browser/devtools/devtools_window.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/engagement/important_sites_util.h"
#include "chrome/browser/enterprise/connectors/connectors_prefs.h"
#include "chrome/browser/enterprise/reporting/prefs.h"
#include "chrome/browser/enterprise/util/managed_browser_utils.h"
#include "chrome/browser/external_protocol/external_protocol_handler.h"
@@ -116,6 +115,7 @@
#include "components/embedder_support/origin_trials/origin_trial_prefs.h"
#include "components/enterprise/browser/identifiers/identifiers_prefs.h"
#include "components/enterprise/buildflags/buildflags.h"
#include "components/enterprise/connectors/connectors_prefs.h"
#include "components/fingerprinting_protection_filter/browser/fingerprinting_protection_filter_constants.h"
#include "components/flags_ui/pref_service_flags_storage.h"
#include "components/history_clusters/core/history_clusters_prefs.h"
@@ -159,6 +159,7 @@
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
#include "components/safe_browsing/content/common/file_type_policies_prefs.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
#include "components/saved_tab_groups/pref_names.h"
#include "components/search_engines/template_url_prepopulate_data.h"
#include "components/security_interstitials/content/insecure_form_blocking_page.h"
#include "components/security_interstitials/content/stateful_ssl_host_state_delegate.h"
@@ -166,6 +167,7 @@
#include "components/segmentation_platform/public/segmentation_platform_service.h"
#include "components/sessions/core/session_id_generator.h"
#include "components/signin/public/base/signin_pref_names.h"
#include "components/signin/public/base/signin_prefs.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/site_engagement/content/site_engagement_service.h"
#include "components/subresource_filter/content/shared/browser/ruleset_service.h"
@@ -177,7 +179,7 @@
#include "components/sync_device_info/device_info_prefs.h"
#include "components/sync_preferences/pref_service_syncable.h"
#include "components/sync_sessions/session_sync_prefs.h"
#include "components/tpcd/metadata/prefs.h"
#include "components/tpcd/metadata/browser/prefs.h"
#include "components/tracing/common/pref_names.h"
#include "components/translate/core/browser/translate_prefs.h"
#include "components/update_client/update_client.h"
@@ -282,11 +284,11 @@
#include "chrome/browser/new_tab_page/promos/promo_service.h"
#include "chrome/browser/policy/developer_tools_policy_handler.h"
#include "chrome/browser/search/background/ntp_custom_background_service.h"
#include "chrome/browser/search_engine_choice/search_engine_choice_client_side_trial.h"
#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/ui/commerce/commerce_ui_tab_helper.h"
#include "chrome/browser/ui/lens/lens_overlay_permission_utils.h"
#include "chrome/browser/ui/safety_hub/safety_hub_prefs.h"
#include "chrome/browser/ui/startup/startup_browser_creator.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_utils.h"
@@ -319,6 +321,7 @@
#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/memory/oom_kills_monitor.h"
#include "chrome/browser/policy/annotations/blocklist_handler.h"
#include "chrome/browser/policy/networking/policy_cert_service.h"
#include "chrome/browser/policy/system_features_disable_list_policy_handler.h"
#include "chrome/browser/ui/webui/certificates_handler.h"
@@ -393,10 +396,9 @@
#include "chrome/browser/ash/login/signin/signin_error_notifier.h"
#include "chrome/browser/ash/login/signin/token_handle_fetcher.h"
#include "chrome/browser/ash/login/startup_utils.h"
#include "chrome/browser/ash/login/users/avatar/user_image_manager.h"
#include "chrome/browser/ash/login/users/avatar/user_image_manager_impl.h"
#include "chrome/browser/ash/login/users/avatar/user_image_prefs.h"
#include "chrome/browser/ash/login/users/avatar/user_image_sync_observer.h"
#include "chrome/browser/ash/login/users/chrome_user_manager_impl.h"
#include "chrome/browser/ash/net/ash_proxy_monitor.h"
#include "chrome/browser/ash/net/network_throttling_observer.h"
#include "chrome/browser/ash/plugin_vm/plugin_vm_pref_names.h"
@@ -419,7 +421,7 @@
#include "chrome/browser/ash/power/power_metrics_reporter.h"
#include "chrome/browser/ash/preferences.h"
#include "chrome/browser/ash/printing/cups_printers_manager.h"
#include "chrome/browser/ash/printing/enterprise_printers_provider.h"
#include "chrome/browser/ash/printing/enterprise/enterprise_printers_provider.h"
#include "chrome/browser/ash/release_notes/release_notes_storage.h"
#include "chrome/browser/ash/scanning/chrome_scanning_app_delegate.h"
#include "chrome/browser/ash/scheduler_configuration_manager.h"
@@ -457,8 +459,8 @@
#include "components/account_manager_core/chromeos/account_manager.h"
#include "components/onc/onc_pref_names.h"
#include "components/quirks/quirks_manager.h"
#include "components/user_manager/user_manager_base.h"
#include "extensions/browser/api/lock_screen_data/lock_screen_item_storage.h"
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_MAC)
@@ -491,7 +493,7 @@
#include "components/device_signals/core/browser/pref_names.h" // nogncheck due to crbug.com/1125897
#endif
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
@@ -520,7 +522,7 @@
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/device_identity/device_oauth2_token_store_desktop.h"
#include "chrome/browser/ui/startup/default_browser_prompt.h"
#include "chrome/browser/ui/startup/default_browser_prompt/default_browser_prompt.h"
#endif
#if defined(TOOLKIT_VIEWS)
@@ -1009,6 +1011,12 @@ constexpr char kPrivacySandboxApisEnabled[] = "privacy_sandbox.apis_enabled";
constexpr char kOobeGuestAcceptedTos[] = "oobe.guest_accepted_tos";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 04/2024
constexpr char kLastUploadedEuiccStatusPrefLegacy[] =
"esim.last_upload_euicc_status";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 03/2024.
constexpr char kShowInternalAccessibilityTree[] =
"accessibility.show_internal_accessibility_tree";
@@ -1035,9 +1043,50 @@ constexpr char kPreferencesMigratedToBasic[] =
inline constexpr char kOmniboxInstantKeywordUsed[] =
"omnibox.instant_keyword_used";
// Deprecated 04/2024.
inline constexpr char kWebAppPreinstalledAppWindowExperiment[] =
"web_apps.preinstalled_app_window_experiment";
// Deprecated 04/2024.
inline constexpr char kDIPSTimerLastUpdate[] = "dips_timer_last_update";
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 04/2024
constexpr char kMetricsUserInheritOwnerConsent[] =
"metrics.user_inherit_owner_consent";
constexpr char kGlanceablesEnabled[] = "ash.glanceables_enabled";
// Deprecated 05/2024.
// A preference to keep track of the device registered time.
constexpr char kDeviceRegisteredTime[] = "DeviceRegisteredTime";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if !BUILDFLAG(IS_ANDROID)
// Deprecated 05/2024
inline constexpr char kSearchEnginesStudyGroup[] =
"search_engines.client_side_study_group";
#endif
#if !BUILDFLAG(IS_ANDROID)
// Deprecated 05/2024
// Pref name for the whether whats new refresh page has been shown
// successfully.
inline constexpr char kHasShownRefreshWhatsNew[] =
"browser.has_shown_refresh_2023_whats_new";
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 05/2024
// A boolean pref which determines if you can pause mouse keys with a
// keyboard shortcut.
inline constexpr char kAccessibilityMouseKeysShortcutToPauseEnabled[] =
"settings.a11y.mouse_keys.ctrl_to_pause_enabled";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 05/2024.
inline constexpr char kSyncCachedTrustedVaultAutoUpgradeDebugInfo[] =
"sync.cached_trusted_vault_auto_upgrade_debug_info";
// Register local state used only for migration (clearing or moving to a new
// key).
void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
@@ -1156,7 +1205,25 @@ void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 03/2024.
registry->RegisterBooleanPref(kOobeGuestAcceptedTos, false);
// Deprecated 05/2024.
registry->RegisterTimePref(kDeviceRegisteredTime, base::Time());
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 04/2024.
#if BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterDictionaryPref(kLastUploadedEuiccStatusPrefLegacy);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if !BUILDFLAG(IS_ANDROID)
// Deprecated 05/2024.
registry->RegisterStringPref(kSearchEnginesStudyGroup, std::string());
#endif
#if !BUILDFLAG(IS_ANDROID)
// Deprecated 05/2024.
registry->RegisterBooleanPref(kHasShownRefreshWhatsNew, false);
#endif
}
// Register prefs used only for migration (clearing or moving to a new key).
@@ -1475,8 +1542,24 @@ void RegisterProfilePrefsForMigration(
// Deprecated 04/2024.
registry->RegisterBooleanPref(kOmniboxInstantKeywordUsed, false);
// Deprecated 04/2024.
registry->RegisterDictionaryPref(kWebAppPreinstalledAppWindowExperiment);
// Deprecated 04/2024.
registry->RegisterTimePref(kDIPSTimerLastUpdate, base::Time());
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 04/2024.
registry->RegisterBooleanPref(kMetricsUserInheritOwnerConsent, true);
registry->RegisterBooleanPref(kGlanceablesEnabled, true);
// Deprecated 05/2024.
registry->RegisterBooleanPref(kAccessibilityMouseKeysShortcutToPauseEnabled,
true);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 05/2024.
registry->RegisterStringPref(kSyncCachedTrustedVaultAutoUpgradeDebugInfo, "");
}
void ClearSyncRequestedPrefAndMaybeMigrate(PrefService* profile_prefs) {
@@ -1608,7 +1691,6 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
metrics::TabStatsTracker::RegisterPrefs(registry);
performance_manager::user_tuning::prefs::RegisterLocalStatePrefs(registry);
RegisterBrowserPrefs(registry);
SearchEngineChoiceClientSideTrial::RegisterLocalStatePrefs(registry);
speech::SodaInstaller::RegisterLocalStatePrefs(registry);
StartupBrowserCreator::RegisterLocalStatePrefs(registry);
task_manager::TaskManagerInterface::RegisterPrefs(registry);
@@ -1630,7 +1712,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
ash::CellularESimProfileHandlerImpl::RegisterLocalStatePrefs(registry);
ash::ManagedCellularPrefHandler::RegisterLocalStatePrefs(registry);
ash::ChromeSessionManager::RegisterPrefs(registry);
ash::ChromeUserManagerImpl::RegisterPrefs(registry);
user_manager::UserManagerBase::RegisterPrefs(registry);
crosapi::browser_util::RegisterLocalStatePrefs(registry);
ash::CupsPrintersManager::RegisterLocalStatePrefs(registry);
ash::BrowserDataMigratorImpl::RegisterLocalStatePrefs(registry);
@@ -1676,7 +1758,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
ash::StatsReportingController::RegisterLocalStatePrefs(registry);
ash::system::AutomaticRebootManager::RegisterPrefs(registry);
ash::TimeZoneResolver::RegisterPrefs(registry);
ash::UserImageManager::RegisterPrefs(registry);
ash::UserImageManagerImpl::RegisterPrefs(registry);
ash::UserSessionManager::RegisterPrefs(registry);
ash::WebKioskAppManager::RegisterPrefs(registry);
component_updater::MetadataTable::RegisterPrefs(registry);
@@ -1749,8 +1831,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
downgrade::RegisterPrefs(registry);
#endif
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS)
RegisterDefaultBrowserPromptPrefs(registry);
#endif
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
DeviceOAuth2TokenStoreDesktop::RegisterPrefs(registry);
#endif
@@ -1771,6 +1856,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(prefs::kOopPrintDriversAllowedByPolicy, true);
#endif
#if BUILDFLAG(ENABLE_PDF)
registry->RegisterBooleanPref(prefs::kPdfViewerOutOfProcessIframeEnabled,
true);
#endif // BUILDFLAG(ENABLE_PDF)
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
registry->RegisterBooleanPref(prefs::kChromeForTestingAllowed, true);
#endif
@@ -1798,6 +1888,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
ChromeContentBrowserClient::RegisterProfilePrefs(registry);
chrome_labs_prefs::RegisterProfilePrefs(registry);
ChromeLocationBarModelDelegate::RegisterProfilePrefs(registry);
content_settings::CookieSettings::RegisterProfilePrefs(registry);
StatefulSSLHostStateDelegate::RegisterProfilePrefs(registry);
ChromeVersionService::RegisterProfilePrefs(registry);
chrome_browser_net::NetErrorTabHelper::RegisterProfilePrefs(registry);
@@ -1865,6 +1956,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
registry);
SessionStartupPref::RegisterProfilePrefs(registry);
SharingSyncPreference::RegisterProfilePrefs(registry);
SigninPrefs::RegisterProfilePrefs(registry);
site_engagement::SiteEngagementService::RegisterProfilePrefs(registry);
supervised_user::RegisterProfilePrefs(registry);
sync_sessions::SessionSyncPrefs::RegisterProfilePrefs(registry);
@@ -1872,6 +1964,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
syncer::SyncPrefs::RegisterProfilePrefs(registry);
syncer::SyncTransportDataPrefs::RegisterProfilePrefs(registry);
TemplateURLPrepopulateData::RegisterProfilePrefs(registry);
tab_groups::prefs::RegisterProfilePrefs(registry);
tpcd::experiment::RegisterProfilePrefs(registry);
translate::TranslatePrefs::RegisterProfilePrefs(registry);
omnibox::RegisterProfilePrefs(registry);
@@ -1960,6 +2053,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
first_run::RegisterProfilePrefs(registry);
gcm::RegisterProfilePrefs(registry);
HatsServiceDesktop::RegisterProfilePrefs(registry);
lens::prefs::RegisterProfilePrefs(registry);
NtpCustomBackgroundService::RegisterProfilePrefs(registry);
media_router::RegisterAccessCodeProfilePrefs(registry);
media_router::RegisterProfilePrefs(registry);
@@ -1999,6 +2093,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
certificate_manager::CertificatesHandler::RegisterProfilePrefs(registry);
chromeos::cloud_storage::RegisterProfilePrefs(registry);
chromeos::cloud_upload::RegisterProfilePrefs(registry);
policy::NetworkAnnotationBlocklistHandler::RegisterPrefs(registry);
policy::PolicyCertService::RegisterProfilePrefs(registry);
quickoffice::RegisterProfilePrefs(registry);
registry->RegisterBooleanPref(prefs::kDeskAPIThirdPartyAccessEnabled, false);
@@ -2042,7 +2137,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
ash::bluetooth_config::BluetoothPowerControllerImpl::RegisterProfilePrefs(
registry);
ash::HatsBluetoothRevampTriggerImpl::RegisterProfilePrefs(registry);
ash::ChromeUserManagerImpl::RegisterProfilePrefs(registry);
user_manager::UserManagerBase::RegisterProfilePrefs(registry);
ash::ClientAppMetadataProviderService::RegisterProfilePrefs(registry);
ash::CupsPrintersManager::RegisterProfilePrefs(registry);
ash::device_sync::RegisterProfilePrefs(registry);
@@ -2156,6 +2251,9 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
registry->RegisterStringPref(
webauthn::pref_names::kLastUsedPairingFromSyncPublicKey, "");
registry->RegisterIntegerPref(
webauthn::pref_names::kEnclaveFailedPINAttemptsCount, 0);
side_panel_prefs::RegisterProfilePrefs(registry);
#endif
@@ -2201,11 +2299,23 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
#if BUILDFLAG(ENABLE_COMPOSE)
registry->RegisterBooleanPref(prefs::kPrefHasCompletedComposeFRE, false);
registry->RegisterBooleanPref(prefs::kEnableProactiveNudge, true);
registry->RegisterDictionaryPref(prefs::kProactiveNudgeDisabledSitesWithTime);
#endif
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA)
#if !BUILDFLAG(IS_ANDROID)
registry->RegisterIntegerPref(prefs::kChromeDataRegionSetting, 0);
#endif
registry->RegisterBooleanPref(prefs::kTabGroupsDeletionSkipDialogOnDelete,
false);
registry->RegisterBooleanPref(prefs::kTabGroupsDeletionSkipDialogOnUngroup,
false);
registry->RegisterBooleanPref(prefs::kTabGroupsDeletionSkipDialogOnRemoveTab,
false);
registry->RegisterBooleanPref(prefs::kTabGroupsDeletionSkipDialogOnCloseTab,
false);
registry->RegisterIntegerPref(prefs::kLensOverlayStartCount, 0);
}
void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
@@ -2362,8 +2472,26 @@ void MigrateObsoleteLocalStatePrefs(PrefService* local_state) {
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Added 03/2024.
local_state->ClearPref(kOobeGuestAcceptedTos);
// Added 05/2024.
local_state->ClearPref(kDeviceRegisteredTime);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Added 04/2024 .
#if BUILDFLAG(IS_CHROMEOS_ASH)
local_state->ClearPref(kLastUploadedEuiccStatusPrefLegacy);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if !BUILDFLAG(IS_ANDROID)
// Added 05/2024.
local_state->ClearPref(kSearchEnginesStudyGroup);
#endif
#if !BUILDFLAG(IS_ANDROID)
// Added 05/2024.
local_state->ClearPref(kHasShownRefreshWhatsNew);
#endif
// Please don't delete the following line. It is used by PRESUBMIT.py.
// END_MIGRATE_OBSOLETE_LOCAL_STATE_PREFS
@@ -2393,7 +2521,7 @@ void MigrateObsoleteProfilePrefs(PrefService* profile_prefs,
autofill::prefs::MigrateDeprecatedAutofillPrefs(profile_prefs);
// Added 3/2020.
// TODO(crbug.com/1062698): Remove this once the privacy settings redesign
// TODO(crbug.com/40122991): Remove this once the privacy settings redesign
// is fully launched.
chrome_browser_net::secure_dns::MigrateProbesSettingToOrFromBackup(
profile_prefs);
@@ -2415,7 +2543,7 @@ void MigrateObsoleteProfilePrefs(PrefService* profile_prefs,
// TODO(326079444): After experiment is over, update the deprecated date and
// allow this to be cleaned up.
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS)
MigrateDefaultBrowserLastDeclinedPref(profile_prefs);
#endif
@@ -2620,7 +2748,7 @@ void MigrateObsoleteProfilePrefs(PrefService* profile_prefs,
#if BUILDFLAG(IS_ANDROID)
// Added 11/2023, but DO NOT REMOVE after the usual year!
// TODO(crbug.com/1445497): The pref kPasswordsUseUPMLocalAndSeparateStores
// TODO(crbug.com/40268177): The pref kPasswordsUseUPMLocalAndSeparateStores
// and this call (to compute said pref) should be removed once
// kUnifiedPasswordManagerLocalPasswordsAndroidWithMigration is launched and
// enough clients have migrated. UsesSplitStoresAndUPMForLocal() should be
@@ -2782,9 +2910,24 @@ void MigrateObsoleteProfilePrefs(PrefService* profile_prefs,
// Added 04/2024.
profile_prefs->ClearPref(kOmniboxInstantKeywordUsed);
// Added 04/2024.
profile_prefs->ClearPref(kWebAppPreinstalledAppWindowExperiment);
// Added 04/2024.
profile_prefs->ClearPref(kDIPSTimerLastUpdate);
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Added 04/2024.
profile_prefs->ClearPref(kMetricsUserInheritOwnerConsent);
profile_prefs->ClearPref(kGlanceablesEnabled);
// Added 05/2024.
profile_prefs->ClearPref(kAccessibilityMouseKeysShortcutToPauseEnabled);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Added 05/2024.
profile_prefs->ClearPref(kSyncCachedTrustedVaultAutoUpgradeDebugInfo);
// Please don't delete the following line. It is used by PRESUBMIT.py.
// END_MIGRATE_OBSOLETE_PROFILE_PREFS
@@ -58,6 +58,7 @@
#include "chrome/browser/predictors/loading_predictor_tab_helper.h"
#include "chrome/browser/preloading/prefetch/no_state_prefetch/no_state_prefetch_manager_factory.h"
#include "chrome/browser/preloading/prefetch/no_state_prefetch/no_state_prefetch_tab_helper.h"
#include "chrome/browser/privacy_sandbox/tracking_protection_settings_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_key.h"
#include "chrome/browser/resource_coordinator/tab_helper.h"
@@ -130,6 +131,8 @@
#include "components/download/content/factory/navigation_monitor_factory.h"
#include "components/download/content/public/download_navigation_observer.h"
#include "components/feed/buildflags.h"
#include "components/fingerprinting_protection_filter/browser/fingerprinting_protection_filter_features.h"
#include "components/fingerprinting_protection_filter/browser/fingerprinting_protection_web_contents_helper.h"
#include "components/history/content/browser/web_contents_top_sites_observer.h"
#include "components/history/core/browser/top_sites.h"
#include "components/infobars/content/content_infobar_manager.h"
@@ -221,6 +224,7 @@
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ash/boot_times_recorder_tab_helper.h"
#include "chrome/browser/ash/growth/campaigns_manager_session_tab_helper.h"
#include "chrome/browser/ui/ash/google_one_offer_iph_tab_helper.h"
#endif
@@ -233,10 +237,11 @@
#include "chrome/browser/chromeos/cros_apps/cros_apps_tab_helper.h"
#include "chrome/browser/chromeos/mahi/mahi_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
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA)
BUILDFLAG(IS_CHROMEOS)
#include "chrome/browser/ui/blocked_content/framebust_block_tab_helper.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/hats/hats_helper.h"
@@ -307,6 +312,9 @@ const char kTabContentsAttachedTabHelpersUserDataKey[] =
} // namespace
// static
// WARNING: Do not use this class for desktop chrome. Use TabFeatures instead.
// See
// https://chromium.googlesource.com/chromium/src/+/main/docs/chrome_browser_design_principles.md
void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
// If already adopted, nothing to be done.
base::SupportsUserData::Data* adoption_tag =
@@ -396,6 +404,13 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
FileSystemAccessPermissionRequestManager::CreateForWebContents(web_contents);
FileSystemAccessTabHelper::CreateForWebContents(web_contents);
FindBarState::ConfigureWebContents(web_contents);
if (base::FeatureList::IsEnabled(fingerprinting_protection_filter::features::
kEnableFingerprintingProtectionFilter)) {
fingerprinting_protection_filter::
FingerprintingProtectionWebContentsHelper::CreateForWebContents(
web_contents, profile->GetPrefs(),
TrackingProtectionSettingsFactory::GetForProfile(profile));
}
download::DownloadNavigationObserver::CreateForWebContents(
web_contents,
download::NavigationMonitorFactory::GetForKey(profile->GetProfileKey()));
@@ -534,11 +549,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
v8_compile_hints::V8CompileHintsTabHelper::MaybeCreateForWebContents(
web_contents);
vr::VrTabHelper::CreateForWebContents(web_contents);
if (base::FeatureList::IsEnabled(permissions::features::kOneTimePermission) ||
base::FeatureList::IsEnabled(
features::kFileSystemAccessPersistentPermissions)) {
OneTimePermissionsTrackerHelper::CreateForWebContents(web_contents);
}
OneTimePermissionsTrackerHelper::CreateForWebContents(web_contents);
// NO! Do not just add your tab helper here. This is a large alphabetized
// block; please insert your tab helper above in alphabetical order.
@@ -660,6 +671,10 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
#if BUILDFLAG(IS_CHROMEOS_ASH)
GoogleOneOfferIphTabHelper::CreateForWebContents(web_contents);
// Do not create for Incognito mode.
if (!profile->IsOffTheRecord()) {
CampaignsManagerSessionTabHelper::CreateForWebContents(web_contents);
}
ash::BootTimesRecorderTabHelper::MaybeCreateForWebContents(web_contents);
#endif
@@ -678,7 +693,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
webapps::PreRedirectionURLObserver::CreateForWebContents(web_contents);
#endif
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
@@ -731,9 +746,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
#endif
#if !BUILDFLAG(IS_ANDROID)
if (customize_chrome::IsSidePanelEnabled()) {
CustomizeChromeTabHelper::CreateForWebContents(web_contents);
}
CustomizeChromeTabHelper::CreateForWebContents(web_contents);
#endif
// --- Section 3: Feature tab helpers behind BUILDFLAGs ---
@@ -781,7 +794,15 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
PluginObserver::CreateForWebContents(web_contents);
#endif
#if BUILDFLAG(ENABLE_PRINTING)
// Only enable ChromeOS print preview if `kPrintPreviewCrosPrimary` is enabled
// and is a ChromeOS build. Otherwise instantiate browser print preview.
#if BUILDFLAG(ENABLE_PRINTING) && BUILDFLAG(IS_CHROMEOS)
if (base::FeatureList::IsEnabled(::features::kPrintPreviewCrosPrimary)) {
chromeos::printing::InitializePrintingForWebContents(web_contents);
} else {
printing::InitializePrintingForWebContents(web_contents);
}
#elif BUILDFLAG(ENABLE_PRINTING)
printing::InitializePrintingForWebContents(web_contents);
#endif
@@ -13,12 +13,12 @@ namespace autofillPrivate {
// Controls whether the Autofill Sync toggle should be available (duplicated
// from the Sync Settings page) on the Autofill Settings page.
// TODO(crbug.com/1502843): Remove when toggle becomes available on the Sync
// TODO(crbug.com/40943238): Remove when toggle becomes available on the Sync
// page for non-syncing users.
boolean isAutofillSyncToggleAvailable;
// Represents the UserSelectableType::kAutofill state (enabled or not).
// TODO(crbug.com/1502843): Remove when toggle becomes available on the Sync
// TODO(crbug.com/40943238): Remove when toggle becomes available on the Sync
// page for non-syncing users.
boolean isAutofillSyncToggleEnabled;
};
@@ -67,7 +67,8 @@ namespace autotestPrivate {
Terminated,
UninstalledByUser,
Removed,
UninstalledByMigration
UninstalledByMigration,
DisabledByLocalSettings
};
// A mapping of arc::mojom::WakefulnessMode
@@ -314,7 +315,7 @@ namespace autotestPrivate {
// Specifies the mode Lacros is currently running.
// For a full list of supported mode, see LacrosMode enum definition.
// DEPRECATED: please use isEnabled.
// TODO(crbug.com/1494005): Remove this field after tests are fixed.
// TODO(crbug.com/40286020): Remove this field after tests are fixed.
LacrosMode mode;
// True iff Lacros is enabled for the current user session's primary user.
boolean isEnabled;
@@ -866,6 +867,10 @@ namespace autotestPrivate {
// Get login status.
static void loginStatus(LoginStatusCallback callback);
// Waits for the post login animation to be complete and then triggers the
// callback.
static void waitForLoginAnimationEnd(VoidCallback callback);
// Locks the screen.
static void lockScreen();
@@ -1104,7 +1109,7 @@ namespace autotestPrivate {
// |callback|: Called when the operation has completed.
static void installBorealis(VoidCallback callback);
// Register a component with CrOSComponentManager.
// Register a component with ComponentManagerAsh.
// |name|: The name of the component.
// |path|: Path to the component.
static void registerComponent(DOMString name, DOMString path);
@@ -96,6 +96,15 @@ namespace developerPrivate {
CHROME
};
enum SafetyCheckWarningReason {
UNPUBLISHED,
POLICY,
MALWARE,
OFFSTORE,
UNWANTED,
NO_PRIVACY_PRACTICE
};
dictionary AccessModifier {
boolean isEnabled;
boolean isActive;
@@ -257,6 +266,7 @@ namespace developerPrivate {
DOMString? path;
Permissions permissions;
DOMString? prettifiedPath;
DOMString? recommendationsUrl;
RuntimeError[] runtimeErrors;
DOMString[] runtimeWarnings;
ExtensionState state;
@@ -267,9 +277,12 @@ namespace developerPrivate {
ExtensionView[] views;
DOMString webStoreUrl;
boolean showSafeBrowsingAllowlistWarning;
SafetyCheckWarningReason? safetyCheckWarningReason;
boolean showAccessRequestsInToolbar;
boolean acknowledgeSafetyCheckWarning;
boolean? pinnedToToolbar;
boolean isAffectedByMV2Deprecation;
boolean didAcknowledgeMV2DeprecationWarning;
};
dictionary ProfileInfo {
@@ -278,6 +291,7 @@ namespace developerPrivate {
boolean isDeveloperModeControlledByPolicy;
boolean isIncognitoAvailable;
boolean isChildAccount;
boolean isMv2DeprecationWarningDismissed;
};
// DEPRECATED: Prefer ExtensionInfo.
@@ -329,12 +343,15 @@ namespace developerPrivate {
boolean? errorCollection;
HostAccess? hostAccess;
boolean? showAccessRequestsInToolbar;
SafetyCheckWarningReason? acknowledgeSafetyCheckWarningReason;
boolean? acknowledgeSafetyCheckWarning;
boolean? acknowledgeMv2DeprecationWarning;
boolean? pinnedToToolbar;
};
dictionary ProfileConfigurationUpdate {
boolean? inDeveloperMode;
boolean? isMv2DeprecationWarningDismissed;
};
dictionary ExtensionCommandUpdate {
@@ -411,7 +428,7 @@ namespace developerPrivate {
// The site set that `site` belongs to.
SiteSet siteSet;
// The number of extensions with access to `site`.
// TODO(crbug.com/1331137): A tricky edge case is when one extension
// TODO(crbug.com/40227416): A tricky edge case is when one extension
// specifies something like *.foo.com and another specifies foo.com.
// Patterns which match all subdomains should be represented differently.
long numExtensions;
@@ -6,7 +6,7 @@
// settings for Kiosk sessions.
// Note: This API is only available to extensions installed by enterprise
// policy in ChromeOS Kiosk sessions.
[platforms = ("chromeos"),
[platforms = ("chromeos", "lacros"),
implemented_in = "chrome/browser/extensions/api/enterprise_kiosk_input/enterprise_kiosk_input_api.h"]
namespace enterprise.kioskInput {
dictionary SetCurrentInputMethodOptions {
@@ -26,8 +26,7 @@ namespace odfsConfigPrivate {
callback GetAccountRestrictionsCallback = void(
AccountRestrictionsInfo restrictions);
callback ShowAutomatedMountErrorCallback = void();
callback IsCloudFileSystemEnabled = void(
boolean isCloudFileSystemEnabled);
callback BoolCallback = void(boolean result);
interface Functions {
// Returns the OneDrive mount mode from the admin policy.
@@ -46,7 +45,11 @@ namespace odfsConfigPrivate {
// Returns whether the FileSystemProviderCloudFileSystem feature flag is
// enabled.
static void isCloudFileSystemEnabled(IsCloudFileSystemEnabled callback);
static void isCloudFileSystemEnabled(BoolCallback callback);
// Returns whether the FileSystemProviderContentCache feature flag is
// enabled.
static void isContentCacheEnabled(BoolCallback callback);
};
interface Events {
@@ -261,6 +261,11 @@ namespace passwordsPrivate {
// Additional information in case a credential is compromised.
CompromisedInfo? compromisedInfo;
// The timestamp of when this credential was created, or undefined if not a
// passkey. Specified in milliseconds since the UNIX epoch. Intended to be
// passed to the JavaScript Date() constructor.
double? creationTime;
};
// Group representing affiliated PasswordUiEntries.
@@ -357,6 +362,9 @@ namespace passwordsPrivate {
callback CredentialsWithReusedPasswordCallback =
void(PasswordUiEntryList[] entries);
callback PasswordManagerPinAvailableCallback = void(boolean available);
callback PasswordManagerPinChangedCallback = void(boolean success);
callback DisconnectCloudAuthenticatorCallback = void(boolean success);
callback IsConnectedToCloudAuthenticatorCallback = void(boolean connected);
interface Functions {
// Function that logs that the Passwords page was accessed from the Chrome
@@ -552,11 +560,21 @@ namespace passwordsPrivate {
static void showExportedFileInShell(DOMString file_path);
// Shows a dialog for changing the Password Manager PIN.
static void changePasswordManagerPin();
static void changePasswordManagerPin(
optional PasswordManagerPinChangedCallback callback);
// Checks whether changing Password Manager PIN is possible.
static void isPasswordManagerPinAvailable(
PasswordManagerPinAvailableCallback callback);
// Disconnects the Chrome client from the cloud authenticator.
static void disconnectCloudAuthenticator(
DisconnectCloudAuthenticatorCallback callback);
// Checks whether the Chrome client is registered with/connected to
// the cloud authenticator.
static void isConnectedToCloudAuthenticator(
IsConnectedToCloudAuthenticatorCallback callback);
};
interface Events {
@@ -187,7 +187,7 @@ namespace scripting {
// and modify as a JS object. One instance exists per frame and is shared
// between all content scripts for a given extension. This object is
// initialized when the frame is created, before document_start.
// TODO(crbug.com/1054624): Enable this once implementation is complete.
// TODO(crbug.com/40119604): Enable this once implementation is complete.
[nodoc, nocompile] static long globalParams();
};
@@ -10,7 +10,7 @@
// [2] https://en.wikipedia.org/wiki/PC/SC
// [3] https://github.com/WICG/web-smart-card/blob/main/README.md#web-idl
//
// TODO(crbug.com/1386175): Add API for the remaining SCard* functions.
// TODO(crbug.com/40247152): Add API for the remaining SCard* functions.
[platforms=("chromeos", "lacros"),
implemented_in="chrome/browser/chromeos/extensions/smart_card_provider_private/smart_card_provider_private_api.h"]
namespace smartCardProviderPrivate {
@@ -560,14 +560,13 @@ void ChromeContentRendererClient::RenderThreadStarted() {
// This doesn't work in single-process mode.
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSingleProcess)) {
using HeapProfilerController = heap_profiling::HeapProfilerController;
const auto* heap_profiler_controller =
heap_profiling::HeapProfilerController::GetInstance();
// The HeapProfilerController should have been created in
// ChromeMainDelegate::PostEarlyInitialization.
DCHECK_NE(HeapProfilerController::GetProfilingEnabled(),
HeapProfilerController::ProfilingEnabled::kNoController);
CHECK(heap_profiler_controller);
if (ThreadProfiler::ShouldCollectProfilesForChildProcess() ||
HeapProfilerController::GetProfilingEnabled() ==
HeapProfilerController::ProfilingEnabled::kEnabled) {
heap_profiler_controller->IsEnabled()) {
ThreadProfiler::SetMainThreadTaskRunner(
base::SingleThreadTaskRunner::GetCurrentDefault());
mojo::PendingRemote<metrics::mojom::CallStackProfileCollector> collector;
@@ -1218,7 +1217,7 @@ GURL ChromeContentRendererClient::GetNaClContentHandlerURL(
void ChromeContentRendererClient::GetInterface(
const std::string& interface_name,
mojo::ScopedMessagePipeHandle interface_pipe) {
// TODO(crbug.com/977637): Get rid of the use of this implementation of
// TODO(crbug.com/40633267): Get rid of the use of this implementation of
// |service_manager::LocalInterfaceProvider|. This was done only to avoid
// churning spellcheck code while eliminting the "chrome" and
// "chrome_renderer" services. Spellcheck is (and should remain) the only
@@ -1827,7 +1826,7 @@ void ChromeContentRendererClient::AppendContentSecurityPolicy(
#if BUILDFLAG(ENABLE_EXTENSIONS)
#if BUILDFLAG(ENABLE_PDF)
// Don't apply default CSP to PDF renderers.
// TODO(crbug.com/1252096): Lock down the CSP once style and script are no
// TODO(crbug.com/40792950): Lock down the CSP once style and script are no
// longer injected inline by `pdf::PluginResponseWriter`. That class may be a
// better place to define such CSP, or we may continue doing so here.
if (pdf::IsPdfRenderer())
@@ -24,6 +24,7 @@
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/lazy_instance.h"
#include "base/location.h"
#include "base/logging.h"
@@ -52,6 +53,7 @@
#include "components/download/public/common/download_stats.h"
#include "components/url_formatter/url_formatter.h"
#include "components/viz/common/features.h"
#include "components/viz/host/host_frame_sink_manager.h"
#include "content/browser/accessibility/browser_accessibility.h"
#include "content/browser/accessibility/browser_accessibility_state_impl.h"
#include "content/browser/attribution_reporting/attribution_host.h"
@@ -63,6 +65,7 @@
#include "content/browser/browser_plugin/browser_plugin_guest.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/closewatcher/close_listener_manager.h"
#include "content/browser/compositor/surface_utils.h"
#include "content/browser/device_posture/device_posture_provider_impl.h"
#include "content/browser/devtools/protocol/page_handler.h"
#include "content/browser/devtools/render_frame_devtools_agent_host.h"
@@ -98,6 +101,7 @@
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/renderer_host/render_view_host_delegate_view.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_factory.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_input_event_router.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h"
@@ -134,9 +138,6 @@
#include "content/public/browser/javascript_dialog_manager.h"
#include "content/public/browser/keyboard_event_processing_result.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/preview_cancel_reason.h"
#include "content/public/browser/render_widget_host_iterator.h"
#include "content/public/browser/render_widget_host_observer.h"
@@ -162,6 +163,7 @@
#include "services/device/public/mojom/wake_lock.mojom.h"
#include "services/network/public/cpp/web_sandbox_flags.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "third_party/abseil-cpp/absl/cleanup/cleanup.h"
#include "third_party/blink/public/common/custom_handlers/protocol_handler_utils.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/loader/resource_type_util.h"
@@ -190,6 +192,7 @@
#include "ui/color/color_provider_key.h"
#include "ui/color/color_provider_manager.h"
#include "ui/color/color_provider_utils.h"
#include "ui/compositor/compositor.h"
#include "ui/display/screen.h"
#include "ui/display/types/display_constants.h"
#include "ui/events/base_event_utils.h"
@@ -230,7 +233,7 @@
#include "ui/wm/core/window_util.h"
#endif
#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(USE_STARSCAN)
#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && PA_BUILDFLAG(USE_STARSCAN)
#include "base/allocator/partition_allocator/src/partition_alloc/starscan/pcscan.h"
#include "content/browser/starscan_load_observer.h"
#endif
@@ -261,11 +264,6 @@ enum class PrimaryPointerType {
// The window which we dobounce load info updates in.
constexpr auto kUpdateLoadStatesInterval = base::Milliseconds(250);
// Kill switch for `BackNavigationLikely`.
BASE_FEATURE(kBackNavigationPredictionMetrics,
"BackNavigationPredictionMetrics",
base::FEATURE_ENABLED_BY_DEFAULT);
// Kill switch for crash immediately on dangling BrowserContext.
BASE_FEATURE(kCrashOnDanglingBrowserContext,
"CrashOnDanglingBrowserContext",
@@ -511,7 +509,7 @@ bool IsWindowManagementGranted(RenderFrameHost* host) {
// of the display where the window will be placed. The bounds may not extend
// outside a single screen's work area, and the `host` requires permission to
// specify bounds on a screen other than its current screen.
// TODO(crbug.com/897300): These adjustments are inaccurate for window.open(),
// TODO(crbug.com/40092782): These adjustments are inaccurate for window.open(),
// which specifies the inner content size, and for window.moveTo, resizeTo, etc.
// calls on newly created windows, which may pass empty sizes or positions to
// indicate uninitialized placement information in the renderer. Constraints
@@ -618,6 +616,19 @@ size_t GetFrameTreeSize(FrameTree* frame_tree) {
return tree_size;
}
using RenderWidgetHostAtPointCallback =
base::OnceCallback<void(base::WeakPtr<RenderWidgetHostViewBase>,
std::optional<gfx::PointF>)>;
void RunCallback(RenderWidgetHostAtPointCallback callback,
base::WeakPtr<RenderWidgetHostViewInput> view,
std::optional<gfx::PointF> point) {
auto* target = static_cast<RenderWidgetHostViewBase*>(view.get());
if (!callback.is_null()) {
std::move(callback).Run(target ? target->GetWeakPtr() : nullptr, point);
}
}
} // namespace
// This is a small helper class created while a JavaScript dialog is showing
@@ -1193,6 +1204,8 @@ WebContentsImpl::WebContentsImpl(BrowserContext* browser_context)
preferred_contrast_ = native_theme->GetPreferredContrast();
prefers_reduced_transparency_ = native_theme->GetPrefersReducedTransparency();
inverted_colors_ = native_theme->GetInvertedColors();
renderer_preferences_.caret_blink_interval =
native_theme->GetCaretBlinkInterval();
screen_change_monitor_ =
std::make_unique<ScreenChangeMonitor>(base::BindRepeating(
@@ -1202,13 +1215,14 @@ WebContentsImpl::WebContentsImpl(BrowserContext* browser_context)
SharedStorageBudgetCharger::CreateForWebContents(this);
}
#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(USE_STARSCAN)
// TODO(1231679): Remove or move to another place after finishing the PCScan
// experiment.
#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && PA_BUILDFLAG(USE_STARSCAN)
// TODO(crbug.com/40190798): Remove or move to another place after finishing
// the PCScan experiment.
if (partition_alloc::internal::PCScan::IsInitialized()) {
star_scan_load_observer_ = std::make_unique<StarScanLoadObserver>(this);
}
#endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(USE_STARSCAN)
#endif // PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) &&
// PA_BUILDFLAG(USE_STARSCAN)
}
WebContentsImpl::~WebContentsImpl() {
@@ -1487,7 +1501,7 @@ std::string WebContentsImpl::GetTitleForMediaControls() {
// Returns the NavigationController for the primary FrameTree, i.e. the one
// whose URL is shown in the omnibox. With MPArch we can have multiple
// FrameTrees in one WebContents and each has its own NavigationController.
// TODO(https://crbug.com/1170273): Make sure callers are aware of this.
// TODO(crbug.com/40165692): Make sure callers are aware of this.
NavigationControllerImpl& WebContentsImpl::GetController() {
return primary_frame_tree_.controller();
}
@@ -1829,7 +1843,7 @@ void WebContentsImpl::OnScreensChange(bool is_multi_screen_changed) {
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::OnScreensChange",
"is_multi_screen_changed", is_multi_screen_changed);
// Allow fullscreen requests shortly after user-generated screens changes.
// TODO(crbug.com/1169291): Mac should not activate this on local process
// TODO(crbug.com/40165350): Mac should not activate this on local process
// display::Screen signals, but via RenderWidgetHostViewMac screen updates.
if (base::FeatureList::IsEnabled(
blink::features::kWindowPlacementFullscreenOnScreensChange)) {
@@ -1838,7 +1852,7 @@ void WebContentsImpl::OnScreensChange(bool is_multi_screen_changed) {
// Mac display info may originate from a remote process hosting the NSWindow;
// this local process display::Screen signal should not trigger updates.
// TODO(crbug.com/1169291): Unify screen info plumbing, caching, etc.
// TODO(crbug.com/40165350): Unify screen info plumbing, caching, etc.
#if !BUILDFLAG(IS_MAC)
// This updates Screen attributes and fires Screen.change events as needed,
// propagating to all widgets through the VisualProperties update waterfall.
@@ -1903,7 +1917,7 @@ void WebContentsImpl::SetAccessibilityMode(ui::AXMode mode) {
"mode", mode.ToString(), "previous_mode",
accessibility_mode_.ToString());
if (accessibility_fatal_error_) {
if (unrecoverable_accessibility_error_) {
DUMP_WILL_BE_CHECK(accessibility_mode_.is_mode_off());
return;
}
@@ -2269,7 +2283,7 @@ bool WebContentsImpl::IsLoading() {
}
double WebContentsImpl::GetLoadProgress() {
// TODO(crbug.com/1199682): Make this MPArch friendly considering primary
// TODO(crbug.com/40177943): Make this MPArch friendly considering primary
// frame tree and its descendants.
return primary_frame_tree_.GetLoadProgress();
}
@@ -2884,11 +2898,11 @@ void WebContentsImpl::AttachInnerWebContents(
render_frame_host_impl);
// Create a proxy in top-level RenderFrameHostManager, pointing to the
// SiteInstance of the outer WebContents. The proxy will be used to send
// SiteInstanceGroup of the outer WebContents. The proxy will be used to send
// postMessage to the inner WebContents.
auto* proxy =
inner_main_frame->browsing_context_state()->CreateOuterDelegateProxy(
render_frame_host_impl->GetSiteInstance(),
render_frame_host_impl->GetSiteInstance()->group(),
inner_main_frame->frame_tree_node(), blink::RemoteFrameToken());
if (remote_frame && remote_frame_host_receiver) {
proxy->BindRemoteFrameInterfaces(std::move(remote_frame),
@@ -2999,7 +3013,7 @@ void WebContentsImpl::RecursivelyRegisterRenderWidgetHostViews() {
// rather than registering the view directly; the view caches the
// TextInputManager.
//
// TODO(crbug.com/1292036): This probably could be made more symmetrical
// TODO(crbug.com/40212969): This probably could be made more symmetrical
// with unregistration. Getting rid of lazy registration might also allow
// eliminating some special cases in TextInputManager.
auto* text_input_manager_for_view = view->GetTextInputManager();
@@ -3157,7 +3171,7 @@ const blink::web_pref::WebPreferences WebContentsImpl::ComputeWebPreferences() {
prefs.viewport_enabled = command_line.HasSwitch(switches::kEnableViewport);
#if BUILDFLAG(IS_ANDROID)
// TODO(crbug.com/1469720): GetPrimaryDisplay() won't be correct for
// TODO(crbug.com/40925473): GetPrimaryDisplay() won't be correct for
// externally connected displays. Get the display where Chrome is opened
// instead.
display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay();
@@ -3207,9 +3221,6 @@ const blink::web_pref::WebPreferences WebContentsImpl::ComputeWebPreferences() {
prefs.strict_powerful_feature_restrictions = command_line.HasSwitch(
switches::kEnableStrictPowerfulFeatureRestrictions);
prefs.fake_no_alloc_direct_call_for_testing_enabled =
command_line.HasSwitch(switches::kEnableFakeNoAllocDirectCallForTesting);
const std::string blockable_mixed_content_group =
base::FieldTrialList::FindFullName("BlockableMixedContent");
prefs.strictly_block_blockable_mixed_content =
@@ -3454,6 +3465,22 @@ void WebContentsImpl::OnSharedDictionaryAccessed(
observers_.NotifyObservers(func, rfh, details);
}
void WebContentsImpl::NotifyStorageAccessed(
RenderFrameHostImpl* rfh,
blink::mojom::StorageTypeAccessed storage_type,
bool blocked) {
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::NotifyStorageAccessed",
"render_frame_host", rfh);
observers_.NotifyObservers(&WebContentsObserver::NotifyStorageAccessed, rfh,
storage_type, blocked);
}
void WebContentsImpl::OnVibrate(RenderFrameHostImpl* rfh) {
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::OnVibrate",
"render_frame_host", rfh);
observers_.NotifyObservers(&WebContentsObserver::VibrationRequested);
}
std::optional<blink::ParsedPermissionsPolicy>
WebContentsImpl::GetPermissionsPolicyForIsolatedWebApp(
RenderFrameHostImpl* source) {
@@ -3677,12 +3704,13 @@ void WebContentsImpl::AddRenderWidgetHostDestructionObserver(
TRACE_DISABLED_BY_DEFAULT("content.verbose"),
"WebContentsImpl::AddRenderWidgetHostDestructionObserver");
if (!base::Contains(render_widget_host_destruction_observers_,
render_widget_host)) {
render_widget_host_destruction_observers_[render_widget_host] =
std::make_unique<RenderWidgetHostDestructionObserver>(
this, render_widget_host);
}
DCHECK(!base::Contains(render_widget_host_destruction_observers_,
render_widget_host));
render_widget_host_destruction_observers_.insert(
{render_widget_host,
std::make_unique<RenderWidgetHostDestructionObserver>(
this, render_widget_host)});
}
void WebContentsImpl::RemoveRenderWidgetHostDestructionObserver(
@@ -3886,12 +3914,33 @@ RenderWidgetHostInputEventRouter* WebContentsImpl::GetInputEventRouter() {
if (!rwh_input_event_router_.get()) {
rwh_input_event_router_ =
std::make_unique<RenderWidgetHostInputEventRouter>();
std::make_unique<RenderWidgetHostInputEventRouter>(
GetHostFrameSinkManager());
}
}
return rwh_input_event_router_.get();
}
void WebContentsImpl::GetRenderWidgetHostAtPointAsynchronously(
RenderWidgetHostViewBase* root_view,
const gfx::PointF& point,
base::OnceCallback<void(base::WeakPtr<RenderWidgetHostViewBase>,
std::optional<gfx::PointF>)> callback) {
GetInputEventRouter()->GetRenderWidgetHostAtPointAsynchronously(
root_view, point, base::BindOnce(&RunCallback, std::move(callback)));
}
std::vector<RenderWidgetHostView*>
WebContentsImpl::GetRenderWidgetHostViewsForTests() {
auto input_hosts =
GetInputEventRouter()->GetRenderWidgetHostViewInputsForTests();
std::vector<RenderWidgetHostView*> hosts;
for (auto host : input_hosts) {
hosts.push_back(static_cast<RenderWidgetHostViewBase*>(host));
}
return hosts;
}
RenderWidgetHostImpl* WebContentsImpl::GetFocusedRenderWidgetHost(
RenderWidgetHostImpl* receiving_widget) {
// Events for widgets other than the main frame (e.g., popup menus) should be
@@ -3928,8 +3977,7 @@ RenderWidgetHostImpl* WebContentsImpl::GetRenderWidgetHostWithPageFocus() {
}
bool WebContentsImpl::CanEnterFullscreenMode(
RenderFrameHostImpl* requesting_frame,
const blink::mojom::FullscreenOptions& options) {
RenderFrameHostImpl* requesting_frame) {
// It's possible that this WebContents was spawned while blocking UI was on
// the screen, or that it was downstream from a WebContents when UI was
// blocked. Therefore, disqualify it from fullscreen if it or any upstream
@@ -3938,14 +3986,14 @@ bool WebContentsImpl::CanEnterFullscreenMode(
[](auto* opener) {
return opener->fullscreen_blocker_count_ == 0;
}) &&
delegate_->CanEnterFullscreenModeForTab(requesting_frame, options);
delegate_->CanEnterFullscreenModeForTab(requesting_frame);
}
void WebContentsImpl::EnterFullscreenMode(
RenderFrameHostImpl* requesting_frame,
const blink::mojom::FullscreenOptions& options) {
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode");
DCHECK(CanEnterFullscreenMode(requesting_frame, options));
DCHECK(CanEnterFullscreenMode(requesting_frame));
DCHECK(requesting_frame->IsActive());
DCHECK(ContainsOrIsFocusedWebContents());
if (base::FeatureList::IsEnabled(
@@ -4587,7 +4635,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
// Check whether there is an available prerendered page for this navigation if
// this is not for guest. If it exists, take WebContents pre-created for
// hosting the prerendered page instead of creating new WebContents.
// TODO(crbug.com/1350676): Instead of filtering out the guest case here,
// TODO(crbug.com/40234240): Instead of filtering out the guest case here,
// check it and drop prerender requests before starting prerendering.
std::unique_ptr<WebContentsImpl> new_contents;
if (base::FeatureList::IsEnabled(blink::features::kPrerender2InNewTab) &&
@@ -4756,9 +4804,8 @@ RenderWidgetHostImpl* WebContentsImpl::CreateNewPopupWidget(
return nullptr;
}
RenderWidgetHostImpl* widget_host = RenderWidgetHostImpl::CreateSelfOwned(
&primary_frame_tree_, this, site_instance_group, route_id, IsHidden(),
std::make_unique<FrameTokenMessageQueue>());
RenderWidgetHostImpl* widget_host = RenderWidgetHostFactory::CreateSelfOwned(
&primary_frame_tree_, this, site_instance_group, route_id, IsHidden());
widget_host->BindWidgetInterfaces(std::move(blink_widget_host),
std::move(blink_widget));
@@ -4772,8 +4819,9 @@ RenderWidgetHostImpl* WebContentsImpl::CreateNewPopupWidget(
widget_view->SetWidgetType(WidgetType::kPopup);
// Save the created widget associated with the route so we can show it later.
pending_widgets_[GlobalRoutingID(site_instance_group->process()->GetID(),
route_id)] = widget_host;
pending_widgets_.insert(
{GlobalRoutingID(site_instance_group->process()->GetID(), route_id),
widget_host});
AddRenderWidgetHostDestructionObserver(widget_host);
return widget_host;
@@ -4853,7 +4901,7 @@ void WebContentsImpl::ShowCreatedWindow(
// the window.open() feature string did not specify a value. This code does
// not distinguish between an unspecified value and 0.
// Assume that if any single value is non-zero, all values should be used.
// TODO(crbug.com/897300): Utilize window_features.has_x and others.
// TODO(crbug.com/40092782): Utilize window_features.has_x and others.
blink::mojom::WindowFeatures adjusted_features = window_features;
int64_t display_id = AdjustWindowRect(&adjusted_features.bounds, opener);
@@ -5119,7 +5167,7 @@ void WebContentsImpl::AXTreeIDForMainFrameHasChanged() {
}
void WebContentsImpl::AccessibilityEventReceived(
const AXEventNotificationDetails& details) {
const ui::AXUpdatesAndEvents& details) {
OPTIONAL_TRACE_EVENT0("content",
"WebContentsImpl::AccessibilityEventReceived");
observers_.NotifyObservers(&WebContentsObserver::AccessibilityEventReceived,
@@ -5127,7 +5175,7 @@ void WebContentsImpl::AccessibilityEventReceived(
}
void WebContentsImpl::AccessibilityLocationChangesReceived(
const std::vector<AXLocationChangeNotificationDetails>& details) {
const std::vector<ui::AXLocationChanges>& details) {
OPTIONAL_TRACE_EVENT0(
"content", "WebContentsImpl::AccessibilityLocationChangesReceived");
observers_.NotifyObservers(
@@ -5170,7 +5218,7 @@ std::string WebContentsImpl::DumpAccessibilityTree(
// Developer mode: crash immediately on any accessibility fatal error.
// This only runs during integration tests, or if a developer is
// using an inspection tool, e.g. chrome://accessibility.
BrowserAccessibilityManager::AlwaysFailFast();
ui::AXTreeManager::AlwaysFailFast();
DCHECK(base::Contains(AXInspectFactory::SupportedApis(), api_type));
std::unique_ptr<ui::AXTreeFormatter> formatter =
AXInspectFactory::CreateFormatter(api_type);
@@ -5219,9 +5267,9 @@ void WebContentsImpl::RecordAccessibilityEvents(
}
}
void WebContentsImpl::AccessibilityFatalError() {
void WebContentsImpl::UnrecoverableAccessibilityError() {
SetAccessibilityMode(ui::AXMode::kNone);
accessibility_fatal_error_ = true;
unrecoverable_accessibility_error_ = true;
}
device::mojom::GeolocationContext* WebContentsImpl::GetGeolocationContext() {
@@ -6427,12 +6475,12 @@ void WebContentsImpl::ReadyToCommitNavigation(
// possible to avoid race conditions with pages attempting to access
// WebGL early on.
//
// TODO(crbug.com/617904): currently navigations initiated by the browser
// TODO(crbug.com/41257523): currently navigations initiated by the browser
// (reload button, reload menu option, pressing return in the Omnibox)
// return false from HasUserGesture(). If or when that is addressed,
// remove the check for IsRendererInitiated() below.
//
// TODO(crbug.com/832180): HasUserGesture comes from the renderer
// TODO(crbug.com/40571460): HasUserGesture comes from the renderer
// process and isn't validated. Until it is, don't trust it.
if (!navigation_handle->IsRendererInitiated()) {
GpuDataManagerImpl::GetInstance()->UnblockDomainFrom3DAPIs(
@@ -6494,7 +6542,7 @@ void WebContentsImpl::DidFinishNavigation(NavigationHandle* navigation_handle) {
}
}
// TODO(crbug.com/1223113) : Move this tracking to PageImpl.
// TODO(crbug.com/40774464) : Move this tracking to PageImpl.
if (navigation_handle->IsInPrimaryMainFrame() &&
!navigation_handle->IsSameDocument()) {
was_ever_audible_ = false;
@@ -6545,7 +6593,7 @@ void WebContentsImpl::DidFinishNavigation(NavigationHandle* navigation_handle) {
// bfcached renderers). Same for prerendering.
// TODO(rakina): Maybe handle the back-forward cache case in
// ReadyToCommitNavigation instead?
// TODO(https://crbug.com/1194880): Maybe sync RendererPreferences as well?
// TODO(crbug.com/40758687): Maybe sync RendererPreferences as well?
if (value_changed_due_to_override ||
NavigationRequest::From(navigation_handle)->IsPageActivation()) {
SetWebPreferences(*web_preferences_.get());
@@ -6767,7 +6815,7 @@ void WebContentsImpl::DidNavigateAnyFramePostCommit(
// RenderFrameHostManager::UnloadOldFrame in
// content/browser/renderer_host/render_frame_host_manager.cc
//
// TODO(crbug.com/1299379): Note that fenced frames cannot open modal dialogs
// TODO(crbug.com/40215909): Note that fenced frames cannot open modal dialogs
// so this only affects dialogs outside the fenced frame tree. If this is ever
// changed then the navigation should be deferred till the dialog from within
// the fenced frame is open.
@@ -6779,7 +6827,7 @@ void WebContentsImpl::DidNavigateAnyFramePostCommit(
// If this is a user-initiated navigation, start allowing JavaScript dialogs
// again.
//
// TODO(https://crbug.com/1399296): Consider using the actual value of
// TODO(crbug.com/40249773): Consider using the actual value of
// "whether a navigation started with user activation or not" instead of
// has_user_gesture, which might get filtered out when navigating from
// proxies. If so, we can remove tracking of
@@ -7172,7 +7220,7 @@ void WebContentsImpl::OnDidFinishLoad(RenderFrameHostImpl* render_frame_host,
}
bool WebContentsImpl::IsAllowedToGoToEntryAtOffset(int32_t offset) {
// TODO(https://crbug.com/1170277): This should probably be renamed to
// TODO(crbug.com/40165695): This should probably be renamed to
// WebContentsDelegate::IsAllowedToGoToEntryAtOffset or
// ShouldGoToEntryAtOffset
return !delegate_ || delegate_->OnGoToEntryOffset(offset);
@@ -7196,9 +7244,9 @@ void WebContentsImpl::EnumerateDirectory(
OPTIONAL_TRACE_EVENT2("content", "WebContentsImpl::EnumerateDirectory",
"render_frame_host", render_frame_host,
"directory_path", directory_path);
base::ScopedClosureRunner cancel_chooser(base::BindOnce(
&FileChooserImpl::FileSelectListenerImpl::FileSelectionCanceled,
listener));
absl::Cleanup cancel_chooser = [&listener] {
listener->FileSelectionCanceled();
};
if (visibility_ == Visibility::HIDDEN) {
// Do not allow background tab to open file chooser.
return;
@@ -7216,7 +7264,7 @@ void WebContentsImpl::EnumerateDirectory(
if (delegate_) {
active_file_chooser_ = std::move(file_chooser);
delegate_->EnumerateDirectory(this, std::move(listener), directory_path);
std::ignore = cancel_chooser.Release();
std::move(cancel_chooser).Cancel();
}
}
@@ -7687,7 +7735,7 @@ void WebContentsImpl::OnDidBlockNavigation(
blink::mojom::NavigationBlockedReason reason) {
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::OnDidBlockNavigation",
"details", [&](perfetto::TracedValue context) {
// TODO(crbug.com/1183371): Replace this with passing
// TODO(crbug.com/40751990): Replace this with passing
// more parameters to TRACE_EVENT directly when
// available.
auto dict = std::move(context).WriteDictionary();
@@ -7982,9 +8030,9 @@ void WebContentsImpl::RunFileChooser(
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RunFileChooser",
"render_frame_host", render_frame_host);
base::ScopedClosureRunner cancel_chooser(base::BindOnce(
&FileChooserImpl::FileSelectListenerImpl::FileSelectionCanceled,
listener));
absl::Cleanup cancel_chooser = [&listener] {
listener->FileSelectionCanceled();
};
if (visibility_ == Visibility::HIDDEN) {
// Do not allow background tab to open file chooser.
return;
@@ -8002,7 +8050,7 @@ void WebContentsImpl::RunFileChooser(
if (delegate_) {
active_file_chooser_ = std::move(file_chooser);
delegate_->RunFileChooser(render_frame_host, std::move(listener), params);
std::ignore = cancel_chooser.Release();
std::move(cancel_chooser).Cancel();
}
}
@@ -8310,7 +8358,8 @@ void WebContentsImpl::SetWindowRect(const gfx::Rect& new_bounds) {
// Members of |new_bounds| may be 0 to indicate uninitialized values for newly
// opened windows, even if the |GetContainerBounds()| inner rect is correct.
// TODO(crbug.com/897300): Plumb values as specified; fallback on outer rect.
// TODO(crbug.com/40092782): Plumb values as specified; fallback on outer
// rect.
auto bounds = new_bounds;
if (bounds.IsEmpty()) {
bounds.set_size(GetContainerBounds().size());
@@ -8448,9 +8497,9 @@ void WebContentsImpl::DidStopLoading() {
// loading. Notify the spare renderer manager about the page loading
// completion. This is a no-op if a spare rendere already exists.
//
// TODO(crbug.com/1517067): replace the implicit treatment of TimeDelta::Max()
// with an enum and optional TimeDelta if we decide to launch deferred spare
// renderer.
// TODO(crbug.com/41490050): replace the implicit treatment of
// TimeDelta::Max() with an enum and optional TimeDelta if we decide to launch
// deferred spare renderer.
bool immediately_warmup_spare_renderer =
GetContentClient()->browser()->GetSpareRendererDelayForSiteURL(
GetURL()) == base::TimeDelta::Max();
@@ -8770,11 +8819,12 @@ void WebContentsImpl::EnsureOpenerProxiesExist(
// process but we intentionally do not expose the embedder's opener chain
// to it.
source_web_contents->GetRenderManager()->CreateRenderFrameProxy(
GetSiteInstance(),
GetSiteInstance()->group(),
source_web_contents->GetPrimaryMainFrame()->browsing_context_state());
} else {
source_rfh->frame_tree_node()->render_manager()->CreateOpenerProxies(
GetSiteInstance(), nullptr, source_rfh->browsing_context_state());
GetSiteInstance()->group(), nullptr,
source_rfh->browsing_context_state());
}
}
}
@@ -8811,6 +8861,16 @@ void WebContentsImpl::SetFocusedFrameTree(FrameTree* frame_tree_to_focus) {
*frame_tree_to_focus->root()
->current_frame_host()
->GetOutermostMainFrameOrEmbedder());
if (frame_tree_to_focus->GetFocusedFrame() &&
frame_tree_to_focus->GetFocusedFrame()
->current_frame_host()
->inner_tree_main_frame_tree_node_id() !=
FrameTreeNode::kFrameTreeNodeInvalidId) {
// If an inner frame tree, in `frame_tree_to_focus`, had focus, the
// placeholder RenderFrameHost needs to be unset as the focused frame in
// `frame_tree_to_focus`.
frame_tree_to_focus->SetFocusedFrame(frame_tree_to_focus->root(), nullptr);
}
frame_tree_to_focus->FocusOuterFrameTrees();
frame_tree_to_focus->root()
@@ -9143,7 +9203,7 @@ void WebContentsImpl::NotifySwappedFromRenderManager(
// Only fire RenderViewHostChanged if it is related to our FrameTree, as
// observers can not deal with events coming from non-primary FrameTree.
// TODO(https://crbug.com/1168562): Update observers to deal with the events,
// TODO(crbug.com/40165060): Update observers to deal with the events,
// and fire events for all frame trees.
if (new_frame->IsInPrimaryMainFrame()) {
// The |new_frame| and its various compadres are already swapped into place
@@ -9195,7 +9255,7 @@ void WebContentsImpl::NotifyMainFrameSwappedFromRenderManager(
// Only fire RenderViewHostChanged if it is
// related to our FrameTree, as observers cannot deal with events coming
// from non-primary FrameTree.
// TODO(https://crbug.com/1168562): Update observers to deal with the events,
// TODO(crbug.com/40165060): Update observers to deal with the events,
// and fire events for all frame trees.
if (!new_frame->IsInPrimaryMainFrame()) {
return;
@@ -9247,7 +9307,7 @@ bool WebContentsImpl::CreateRenderViewForRenderManager(
const auto proxy_routing_id =
proxy_host ? proxy_host->GetRoutingID() : MSG_ROUTING_NONE;
// TODO(https://crbug.com/1171646): Given MPArch, should we pass
// TODO(crbug.com/40166243): Given MPArch, should we pass
// opened_by_another_window_ for non primary FrameTrees?
if (!rvh_impl->CreateRenderView(opener_frame_token, proxy_routing_id,
opened_by_another_window_)) {
@@ -9476,7 +9536,7 @@ gfx::Size WebContentsImpl::GetSize() {
ui::ViewAndroid* view_android = GetNativeView();
return view_android->bounds().size();
#elif BUILDFLAG(IS_IOS)
// TODO(crbug.com/1411704): Implement me.
// TODO(crbug.com/40254930): Implement me.
NOTREACHED();
return gfx::Size();
#endif
@@ -10195,28 +10255,6 @@ void WebContentsImpl::DidChangeScreenOrientation() {
last_screen_orientation_change_time_ = ui::EventTimeForNow();
}
// TODO(crbug.com/328100331): This method should be renamed since it doesn't
// actually show a popup menu.
bool WebContentsImpl::ShowPopupMenu(RenderFrameHostImpl* render_frame_host,
const gfx::Rect& bounds) {
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::ShowPopupMenu",
"render_frame_host", render_frame_host);
if (visibility_ != Visibility::VISIBLE) {
// Don't create popups for hidden tabs. http://crbug.com/1521345
// Returning true here makes RenderFrameHostImpl::ShowPopupMenu abort
// before showing a popup.
return true;
}
DCHECK(render_frame_host->IsActive());
if (show_popup_menu_callback_) {
std::move(show_popup_menu_callback_).Run(bounds);
return true;
}
return false;
}
void WebContentsImpl::UpdateWebContentsVisibility(Visibility visibility) {
OPTIONAL_TRACE_EVENT1("content",
"WebContentsImpl::UpdateWebContentsVisibility",
@@ -10309,7 +10347,7 @@ WebContentsImpl::ParseDownloadHeaders(const std::string& headers) {
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::ParseDownloadHeaders",
"headers", headers);
download::DownloadUrlParameters::RequestHeadersType request_headers;
for (const std::string_view& key_value : base::SplitStringPiece(
for (std::string_view key_value : base::SplitStringPiece(
headers, "\r\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) {
std::vector<std::string> pair = base::SplitString(
key_value, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
@@ -10369,6 +10407,8 @@ void WebContentsImpl::OnNativeThemeUpdated(ui::NativeTheme* observed_theme) {
bool prefers_reduced_transparency =
observed_theme->GetPrefersReducedTransparency();
bool inverted_colors = observed_theme->GetInvertedColors();
base::TimeDelta caret_blink_interval =
observed_theme->GetCaretBlinkInterval();
bool preferences_changed = false;
if (using_dark_colors_ != using_dark_colors) {
@@ -10399,6 +10439,14 @@ void WebContentsImpl::OnNativeThemeUpdated(ui::NativeTheme* observed_theme) {
if (preferences_changed) {
NotifyPreferencesChanged();
}
// Only caret blink interval from NativeTheme impacts
// blink::RendererPreferences, which are not synced in
// NotifyPreferencesChanged(). Sync these if the interval has changed.
if (renderer_preferences_.caret_blink_interval != caret_blink_interval) {
renderer_preferences_.caret_blink_interval = caret_blink_interval;
SyncRendererPrefs();
}
}
void WebContentsImpl::OnCaptionStyleUpdated() {
@@ -10570,7 +10618,7 @@ void WebContentsImpl::RenderFrameHostStateChanged(
"WebContentsImpl::RenderFrameHostStateChanged",
"render_frame_host", render_frame_host, "states",
[&](perfetto::TracedValue context) {
// TODO(crbug.com/1183371): Replace this with passing
// TODO(crbug.com/40751990): Replace this with passing
// more parameters to TRACE_EVENT directly when
// available.
auto dict = std::move(context).WriteDictionary();
@@ -10699,6 +10747,26 @@ VisibleTimeRequestTrigger& WebContentsImpl::GetVisibleTimeRequestTrigger() {
return visible_time_request_trigger_;
}
gfx::mojom::DelegatedInkPointRenderer* WebContentsImpl::GetDelegatedInkRenderer(
ui::Compositor* compositor) {
if (!delegated_ink_point_renderer_.is_bound()) {
// The remote can't be bound if the compositor is null, so bail if
// that is the case so we don't crash by trying to use an unbound
// remote.
if (!compositor) {
return nullptr;
}
TRACE_EVENT_INSTANT0("delegated_ink_trails",
"Binding mojo interface for delegated ink points.",
TRACE_EVENT_SCOPE_THREAD);
compositor->SetDelegatedInkPointRenderer(
delegated_ink_point_renderer_.BindNewPipeAndPassReceiver());
delegated_ink_point_renderer_.reset_on_disconnect();
}
return delegated_ink_point_renderer_.get();
}
std::unique_ptr<PrerenderHandle> WebContentsImpl::StartPrerendering(
const GURL& prerendering_url,
PreloadingTriggerType trigger_type,
@@ -10732,12 +10800,13 @@ std::unique_ptr<PrerenderHandle> WebContentsImpl::StartPrerendering(
return nullptr;
}
void WebContentsImpl::CancelAllPrerendering() {
GetPrerenderHostRegistry()->CancelAllHosts(
PrerenderFinalStatus::kAllPrerenderingCanceled);
}
void WebContentsImpl::BackNavigationLikely(PreloadingPredictor predictor,
WindowOpenDisposition disposition) {
if (!base::FeatureList::IsEnabled(kBackNavigationPredictionMetrics)) {
return;
}
CHECK(!IsBeingDestroyed());
// See the comment of `last_back_navigation_hint_time_` for why this cooldown
@@ -156,7 +156,7 @@ void SetRuntimeFeatureFromChromiumFeature(const base::Feature& chromium_feature,
using FeatureList = base::FeatureList;
const bool feature_enabled = FeatureList::IsEnabled(chromium_feature);
const bool is_overridden =
FeatureList::GetInstance()->IsFeatureOverridden(chromium_feature.name);
FeatureList::GetStateIfOverridden(chromium_feature).has_value();
switch (option) {
case kSetOnlyIfOverridden:
if (is_overridden) {
@@ -194,8 +194,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
raw_ref(features::kUseAXPositionForDocumentMarkers)},
{wf::EnableAOMAriaRelationshipProperties,
raw_ref(features::kEnableAriaElementReflection)},
{wf::EnableAutoplayIgnoresWebAudio,
raw_ref(media::kAutoplayIgnoreWebAudio)},
{wf::EnableBackgroundFetch, raw_ref(features::kBackgroundFetch)},
{wf::EnableBoundaryEventDispatchTracksNodeRemoval,
raw_ref(blink::features::kBoundaryEventDispatchTracksNodeRemoval)},
@@ -205,8 +203,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
raw_ref(features::kBrowserVerifiedUserActivationMouse)},
{wf::EnableCompositeBGColorAnimation,
raw_ref(features::kCompositeBGColorAnimation)},
{wf::EnableConsolidatedMovementXY,
raw_ref(features::kConsolidatedMovementXY)},
{wf::EnableCooperativeScheduling,
raw_ref(features::kCooperativeScheduling)},
{wf::EnableDigitalGoods, raw_ref(features::kDigitalGoodsApi),
@@ -230,22 +226,21 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
raw_ref(features::kPrivacySandboxAdsAPIsOverride),
kSetOnlyIfOverridden},
{wf::EnableSharedStorageAPI,
raw_ref(features::kPrivacySandboxAdsAPIsM1Override),
kSetOnlyIfOverridden},
raw_ref(features::kPrivacySandboxAdsAPIsM1Override)},
{wf::EnableSharedStorageAPIM118,
raw_ref(blink::features::kSharedStorageAPIM118), kDefault},
{wf::EnableSharedStorageAPIM125,
raw_ref(blink::features::kSharedStorageAPIM125), kDefault},
{wf::EnableFedCmMultipleIdentityProviders,
raw_ref(features::kFedCmMultipleIdentityProviders), kDefault},
raw_ref(features::kFedCmMultipleIdentityProviders),
kSetOnlyIfOverridden},
{wf::EnableFedCmSelectiveDisclosure,
raw_ref(features::kFedCmSelectiveDisclosure), kDefault},
{wf::EnableFencedFrames,
raw_ref(features::kPrivacySandboxAdsAPIsOverride),
kSetOnlyIfOverridden},
{wf::EnableFencedFrames,
raw_ref(features::kPrivacySandboxAdsAPIsM1Override),
kSetOnlyIfOverridden},
raw_ref(features::kPrivacySandboxAdsAPIsM1Override)},
{wf::EnableForcedColors, raw_ref(features::kForcedColors)},
{wf::EnableFractionalScrollOffsets,
raw_ref(features::kFractionalScrollOffsets)},
@@ -296,8 +291,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
raw_ref(features::kTouchDragAndContextMenu)},
{wf::EnableUserActivationSameOriginVisibility,
raw_ref(features::kUserActivationSameOriginVisibility)},
{wf::EnableVideoPlaybackQuality,
raw_ref(features::kVideoPlaybackQuality)},
{wf::EnableWebBluetooth, raw_ref(features::kWebBluetooth),
kSetOnlyIfOverridden},
{wf::EnableWebBluetoothGetDevices,
@@ -348,8 +341,9 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
*mapping.chromium_feature, mapping.option, mapping.feature_enabler);
}
// TODO(crbug/832393): Cleanup the inconsistency between custom WRF enabler
// function and using feature string name with EnableFeatureFromString.
// TODO(crbug.com/40571563): Cleanup the inconsistency between custom WRF
// enabler function and using feature string name with
// EnableFeatureFromString.
const RuntimeFeatureToChromiumFeatureMap<const char*>
runtimeFeatureNameToChromiumFeatureMapping[] = {
{"AllowContentInitiatedDataUrlNavigations",
@@ -359,14 +353,12 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
raw_ref(features::kPrivacySandboxAdsAPIsOverride),
kSetOnlyIfOverridden},
{"AllowURNsInIframes",
raw_ref(features::kPrivacySandboxAdsAPIsM1Override),
kSetOnlyIfOverridden},
raw_ref(features::kPrivacySandboxAdsAPIsM1Override)},
{"AttributionReporting",
raw_ref(features::kPrivacySandboxAdsAPIsOverride),
kSetOnlyIfOverridden},
{"AttributionReporting",
raw_ref(features::kPrivacySandboxAdsAPIsM1Override),
kSetOnlyIfOverridden},
raw_ref(features::kPrivacySandboxAdsAPIsM1Override)},
{"AttributionReportingCrossAppWeb",
raw_ref(features::kPrivacySandboxAdsAPIsOverride),
kSetOnlyIfOverridden},
@@ -388,7 +380,8 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
kSetOnlyIfOverridden},
{"DocumentPolicyIncludeJSCallStacksInCrashReports",
raw_ref(blink::features::
kDocumentPolicyIncludeJSCallStacksInCrashReports)},
kDocumentPolicyIncludeJSCallStacksInCrashReports),
kSetOnlyIfOverridden},
{"FencedFramesLocalUnpartitionedDataAccess",
raw_ref(blink::features::kFencedFramesLocalUnpartitionedDataAccess)},
{"Fledge", raw_ref(blink::features::kFledge), kSetOnlyIfOverridden},
@@ -409,14 +402,12 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
{"SerialPortConnected", raw_ref(features::kSerialPortConnected)},
{"TopicsAPI", raw_ref(features::kPrivacySandboxAdsAPIsOverride),
kSetOnlyIfOverridden},
{"TopicsAPI", raw_ref(features::kPrivacySandboxAdsAPIsM1Override),
kSetOnlyIfOverridden},
{"TopicsAPI", raw_ref(features::kPrivacySandboxAdsAPIsM1Override)},
{"TopicsDocumentAPI",
raw_ref(features::kPrivacySandboxAdsAPIsOverride),
kSetOnlyIfOverridden},
{"TopicsDocumentAPI",
raw_ref(features::kPrivacySandboxAdsAPIsM1Override),
kSetOnlyIfOverridden},
raw_ref(features::kPrivacySandboxAdsAPIsM1Override)},
{"TouchTextEditingRedesign",
raw_ref(features::kTouchTextEditingRedesign)},
{"TrustedTypesFromLiteral",
@@ -427,8 +418,7 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
raw_ref(features::kMediaStreamTrackTransfer)},
{"PrivateNetworkAccessPermissionPrompt",
raw_ref(network::features::kPrivateNetworkAccessPermissionPrompt),
kSetOnlyIfOverridden},
{"PermissionElement", raw_ref(features::kPermissionElement)}};
kSetOnlyIfOverridden}};
for (const auto& mapping : runtimeFeatureNameToChromiumFeatureMapping) {
SetRuntimeFeatureFromChromiumFeature(
*mapping.chromium_feature, mapping.option, [&mapping](bool enabled) {
@@ -732,6 +722,16 @@ void ResolveInvalidConfigurations() {
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())
<< "PermissionElement cannot be enabled in this configuration. Use --"
<< switches::kEnableFeatures << "="
<< blink::features::kPermissionElement.name << " instead.";
WebRuntimeFeatures::EnablePermissionElement(false);
}
}
} // namespace
@@ -9,11 +9,13 @@
#include <utility>
#include "base/check.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/functional/callback_helpers.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/values.h"
@@ -583,7 +585,8 @@ bool ContentBrowserClient::IsSharedStorageAllowed(
content::RenderFrameHost* rfh,
const url::Origin& top_frame_origin,
const url::Origin& accessing_origin,
std::string* out_debug_message) {
std::string* out_debug_message,
bool* out_block_is_site_setting_specific) {
return false;
}
@@ -591,14 +594,16 @@ bool ContentBrowserClient::IsSharedStorageSelectURLAllowed(
content::BrowserContext* browser_context,
const url::Origin& top_frame_origin,
const url::Origin& accessing_origin,
std::string* out_debug_message) {
std::string* out_debug_message,
bool* out_block_is_site_setting_specific) {
return false;
}
bool ContentBrowserClient::IsPrivateAggregationAllowed(
content::BrowserContext* browser_context,
const url::Origin& top_frame_origin,
const url::Origin& reporting_origin) {
const url::Origin& reporting_origin,
bool* out_block_is_site_setting_specific) {
return true;
}
@@ -943,6 +948,11 @@ std::wstring ContentBrowserClient::GetAppContainerSidForSandboxType(
L"924012148-129201922");
}
std::string ContentBrowserClient::GetAppContainerId() {
return base::WideToUTF8(
base::CommandLine::ForCurrentProcess()->GetProgram().value());
}
bool ContentBrowserClient::IsRendererAppContainerDisabled() {
return false;
}
@@ -959,7 +969,7 @@ bool ContentBrowserClient::IsRendererCodeIntegrityEnabled() {
}
bool ContentBrowserClient::ShouldEnableAudioProcessHighPriority() {
// TODO(crbug.com/1374069): Delete this method when the
// TODO(crbug.com/40242320): Delete this method when the
// kAudioProcessHighPriorityEnabled enterprise policy is deprecated.
return false;
}
@@ -1462,6 +1472,10 @@ bool ContentBrowserClient::ShouldServiceWorkerInheritPolicyContainerFromCreator(
return url.SchemeIsLocal();
}
void ContentBrowserClient::GrantAdditionalRequestPrivilegesToWorkerProcess(
int child_id,
const GURL& script_url) {}
ContentBrowserClient::PrivateNetworkRequestPolicyOverride
ContentBrowserClient::ShouldOverridePrivateNetworkRequestPolicy(
BrowserContext* browser_context,
@@ -1511,6 +1525,7 @@ ContentBrowserClient::CreateIdentityRequestDialogController(
void ContentBrowserClient::ShowDigitalIdentityInterstitialIfNeeded(
WebContents& web_contents,
const url::Origin& origin,
bool is_only_requesting_age,
DigitalIdentityInterstitialCallback callback) {
std::move(callback).Run(
DigitalIdentityProvider::RequestStatusForMetrics::kErrorOther);
@@ -46,7 +46,8 @@ namespace app.runtime {
context_menu,
arc,
intent_url,
app_home_page
app_home_page,
focus_mode
};
// An app can be launched with a specific action in mind, for example, to
@@ -79,7 +79,7 @@
mediaStoppedPlaying,
menuEnd,
menuItemSelected,
menuListValueChanged,
menuListValueChangedDeprecated,
menuPopupEnd,
menuPopupStart,
menuStart,
@@ -174,7 +174,7 @@
desktop,
details,
dialog,
directory,
directoryDeprecated,
disclosureTriangle,
disclosureTriangleGrouped,
// --------------------------------------------------------------
@@ -326,6 +326,7 @@
search,
searchBox,
section,
sectionWithoutName,
slider,
spinButton,
splitter,
@@ -105,7 +105,7 @@ namespace bluetooth {
// Type of filter to apply to the device list. Default is all.
FilterType? filterType;
// Maximum number of bluetoth devices to return. Default is 0 (no limit)
// Maximum number of bluetooth devices to return. Default is 0 (no limit)
// if unspecified.
long? limit;
};
@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Private API for HDMI CEC functionality.
[platforms=("chromeos")]
[platforms=("chromeos", "lacros")]
namespace cecPrivate {
enum DisplayCecPowerState {
@@ -57,7 +57,7 @@ namespace contentScripts {
extensionTypes.RunAt? run_at;
// The JavaScript "world" to run the script in. Defaults to
// <code>ISOLATED</code>. Only available in Manifest V3 extensions.
[nodoc] extensionTypes.ExecutionWorld? world;
extensionTypes.ExecutionWorld? world;
};
dictionary ManifestKeys {
@@ -170,7 +170,7 @@ namespace declarativeNetRequest {
DOMString? regexSubstitution;
};
// TODO(crbug.com/1141166): Add documentation once feature is complete.
// TODO(crbug.com/40727004): Add documentation once feature is complete.
[nodoc] dictionary HeaderInfo {
// The name of the header. This condition matches on the name
// only if both `values` and `excludedValues` are not specified.
@@ -355,14 +355,14 @@ namespace declarativeNetRequest {
// Rule matches if the request matches any response header condition in this
// list (if specified).
// TODO(crbug.com/1141166): Add documentation once feature is complete.
// TODO(crbug.com/40727004): Add documentation once feature is complete.
[nodoc] HeaderInfo[]? responseHeaders;
// Rule does not match if the request matches any response header
// condition in this list (if specified). If both `excludedResponseHeaders`
// and `responseHeaders` are specified, then the `excludedResponseHeaders`
// property takes precedence.
// TODO(crbug.com/1141166): Add documentation once feature is complete.
// TODO(crbug.com/40727004): Add documentation once feature is complete.
[nodoc] HeaderInfo[]? excludedResponseHeaders;
};
@@ -9,7 +9,7 @@
// Icon specification similar to an ImageResource.
dictionary Icon {
// TODO(crbug.com/1362192) Add `DOMString? label;` for accessibility.
// TODO(crbug.com/40238266) Add `DOMString? label;` for accessibility.
// URL from which a user agent can fetch image data.
DOMString src;
@@ -77,7 +77,7 @@ namespace offscreen {
static void closeDocument(VoidCallback callback);
// Determines whether the extension has an active document.
// TODO(https://crbug.com/1339382): This probably isn't something we want to
// TODO(crbug.com/40849649): This probably isn't something we want to
// ship in its current form (hence the nodoc). Instead of this, we should
// integrate offscreen documents into a service worker-compatible getViews()
// alternative. But this is pretty useful in testing environments.
@@ -110,6 +110,10 @@ namespace userScripts {
callback ConfigureWorldCallback = void();
callback GetAllWorldConfigurationsCallback = void(WorldProperties[] worlds);
callback ResetWorldConfigurationCallback = void();
interface Functions {
// Registers one or more user scripts for this extension.
// |scripts|: Contains a list of user scripts to be registered.
@@ -155,5 +159,22 @@ namespace userScripts {
static void configureWorld(
WorldProperties properties,
optional ConfigureWorldCallback callback);
// Retrieves all registered world configurations.
// |callback|: Called with the registered world configurations.
// TODO(https://crbug.com/331680187): Remove nodoc.
[nodoc] static void getWorldConfigurations(
GetAllWorldConfigurationsCallback callback);
// Resets the configuration for a user script world. Any scripts that inject
// into the world with the specified ID will use the default world
// configuration.
// |worldId|: The ID of the user script world to reset. If omitted, resets
// the default world's configuration.
// |callback|: Called when the configuration is reset.
// TODO(https://crbug.com/331680187): Remove nodoc.
[nodoc] static void resetWorldConfiguration(
optional DOMString worldId,
ResetWorldConfigurationCallback callback);
};
};
+16 -10
View File
@@ -20,6 +20,7 @@
#include "base/bits.h"
#include "base/check.h"
#include "base/check_op.h"
#include "base/containers/span.h"
#include "base/debug/alias.h"
#include "base/debug/crash_logging.h"
#include "base/feature_list.h"
@@ -64,7 +65,12 @@ std::optional<gin::V8SnapshotFileType> g_snapshot_file_type;
#endif
bool GenerateEntropy(unsigned char* buffer, size_t amount) {
base::RandBytes(buffer, amount);
base::RandBytes(
// SAFETY: This depends on callers providing a valid pointer/size pair.
//
// TODO(crbug.com/338574383): The signature is fixed as it's a callback
// from v8, but maybe v8 can use a span.
UNSAFE_BUFFERS(base::span(buffer, amount)));
return true;
}
@@ -283,6 +289,12 @@ void SetFlags(IsolateHolder::ScriptMode mode,
SetV8FlagsFormatted("--memory-reducer-gc-count=%i",
features::kV8MemoryReducerGCCount.Get());
}
SetV8FlagsIfOverridden(features::kV8IdleGcOnContextDisposal,
"--idle-gc-on-context-disposal",
"--no-idle-gc-on-context-disposal");
SetV8FlagsIfOverridden(features::kV8GCOptimizeSweepForMutator,
"--cppheap-optimize-sweep-for-mutator",
"--no-cppheap-optimize-sweep-for-mutator");
SetV8FlagsIfOverridden(features::kV8MinorMS, "--minor-ms", "--no-minor-ms");
SetV8FlagsIfOverridden(features::kV8Sparkplug, "--sparkplug",
"--no-sparkplug");
@@ -386,14 +398,6 @@ void SetFlags(IsolateHolder::ScriptMode mode,
"--no-intel-jcc-erratum-mitigation");
// JavaScript language features.
if (base::FeatureList::IsEnabled(features::kJavaScriptRabGsab)) {
SetV8Flags("--harmony-rab-gsab");
} else {
SetV8Flags("--no-harmony-rab-gsab");
}
SetV8FlagsIfOverridden(features::kJavaScriptArrayBufferTransfer,
"--harmony-rab-gsab-transfer",
"--no-harmony-rab-gsab-transfer");
SetV8FlagsIfOverridden(features::kJavaScriptIteratorHelpers,
"--harmony-iterator-helpers",
"--no-harmony-iterator-helpers");
@@ -437,6 +441,8 @@ void SetFlags(IsolateHolder::ScriptMode mode,
SetV8FlagsIfOverridden(features::kWebAssemblyInlining,
"--experimental-wasm-inlining",
"--no-experimental-wasm-inlining");
SetV8FlagsIfOverridden(features::kWebAssemblyLiftoffCodeFlushing,
"--flush-liftoff-code", "--no-flush-liftoff-code");
SetV8FlagsIfOverridden(features::kWebAssemblyGenericWrapper,
"--wasm-to-js-generic-wrapper",
"--no-wasm-to-js-generic-wrapper");
@@ -579,7 +585,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
// static
void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
if (g_mapped_snapshot) {
// TODO(crbug.com/802962): Confirm not loading different type of snapshot
// TODO(crbug.com/40558459): Confirm not loading different type of snapshot
// files in a process.
return;
}
@@ -607,7 +607,7 @@ NetworkContext::NetworkContext(
app_status_listeners_.push_back(
std::make_unique<NetworkContextApplicationStatusListener>());
#endif // BUILDFLAG(IS_ANDROID)
// TODO(crbug.com/1413922): Set `file_operations_factory` to support
// TODO(crbug.com/40255884): Set `file_operations_factory` to support
// sandboxed network service on Android.
shared_dictionary_manager_ = SharedDictionaryManager::CreateOnDisk(
params_->file_paths->shared_dictionary_directory->path().Append(
@@ -860,7 +860,7 @@ void NetworkContext::CreateURLLoaderFactory(
void NetworkContext::CreateURLLoaderFactoryForCertNetFetcher(
mojo::PendingReceiver<mojom::URLLoaderFactory> factory_receiver) {
// TODO(crbug.com/1087790): investigate changing these params.
// TODO(crbug.com/40695068): investigate changing these params.
auto url_loader_factory_params = mojom::URLLoaderFactoryParams::New();
url_loader_factory_params->is_trusted = true;
url_loader_factory_params->process_id = mojom::kBrowserProcessId;
@@ -1569,7 +1569,7 @@ int NetworkContext::CheckCTRequirementsForSignedExchange(
// For old certificates (issued before 2018-05-01),
// CheckCTRequirements() may return CT_NOT_REQUIRED, so we check the
// compliance status here.
// TODO(https://crbug.com/851778): Remove this condition once we require
// TODO(crbug.com/40580363): Remove this condition once we require
// signing certificates to have CanSignHttpExchanges extension, because
// such certificates should be naturally after 2018-05-01.
if (cert_verify_result.policy_compliance ==
@@ -1794,7 +1794,7 @@ void NetworkContext::CreateHostResolver(
// with the specified configuration overrides. Because we are using a non-
// standard resolver, disable the cache.
//
// TODO(crbug.com/846423): Consider allowing per-resolve overrides, so the
// TODO(crbug.com/40577881): Consider allowing per-resolve overrides, so the
// same net::HostResolver with the same scheduler and cache can be used with
// different overrides. But since this is only used for special cases for
// now, much easier to create entirely separate net::HostResolver instances.
@@ -2224,7 +2224,7 @@ void NetworkContext::LookupProxyAuthCredentials(
url_request_context_->http_transaction_factory()
->GetSession()
->http_auth_cache();
// TODO(https://crbug.com/1103768): Mapping proxy addresses to URLs is a
// TODO(crbug.com/40704785): Mapping proxy addresses to URLs is a
// lossy conversion, shouldn't do this.
const char* scheme =
proxy_server.is_secure_http_like() ? "https://" : "http://";
@@ -2259,6 +2259,16 @@ size_t NetworkContext::NumOpenWebTransports() const {
return base::ranges::count(web_transports_, false, &WebTransport::torn_down);
}
bool NetworkContext::AllURLLoaderFactoriesAreBoundToNetworkForTesting(
net::handles::NetworkHandle target_network) const {
for (const auto& factory : url_loader_factories_) {
if (factory->GetBoundNetworkForTesting() != target_network) {
return false;
}
}
return true;
}
void NetworkContext::OnHttpAuthDynamicParamsChanged(
const mojom::HttpAuthDynamicParams*
http_auth_dynamic_network_service_params) {
@@ -2328,7 +2338,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
DCHECK(params_->cert_verifier_params);
// base::Unretained() is safe below because |this| will own
// |cert_verifier|.
// TODO(https://crbug.com/1085233): this cert verifier should deal with
// TODO(crbug.com/40693524): this cert verifier should deal with
// disconnections if the CertVerifierService is run outside of the browser
// process.
cert_verifier = std::make_unique<cert_verifier::MojoCertVerifier>(
@@ -2347,7 +2357,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
std::move(cert_verifier)));
#if BUILDFLAG(IS_CHROMEOS)
// TODO(https://crbug.com/1477317): The TrustAnchorUsed callback should
// TODO(crbug.com/40928765): The TrustAnchorUsed callback should
// work on all platforms. (Also consider whether this wrapper is the best
// way to handle this or if it should be refactored.)
cert_verifier_with_trust_anchors_ =
@@ -2709,8 +2719,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
#if BUILDFLAG(ENABLE_DEVICE_BOUND_SESSIONS)
if (params_->device_bound_sessions_enabled) {
builder.set_device_bound_session_service(
net::DeviceBoundSessionService::Create());
builder.set_has_device_bound_session_service(true);
}
#endif
@@ -3078,9 +3087,7 @@ void NetworkContext::RevokeNetworkForNonces(
network_revocation_nonces_.insert(nonce);
const std::set<GURL>& exemptions = network_revocation_exemptions_[nonce];
for (const auto& factory : url_loader_factories_) {
for (const auto& loader : factory->url_loaders()) {
loader->CancelRequestIfNonceMatchesAndUrlNotExempted(nonce, exemptions);
}
factory->CancelRequestsIfNonceMatchesAndUrlNotExempted(nonce, exemptions);
}
#if BUILDFLAG(ENABLE_WEBSOCKETS)
if (websocket_factory_) {
@@ -3088,7 +3095,10 @@ void NetworkContext::RevokeNetworkForNonces(
}
#endif // BUILDFLAG(ENABLE_WEBSOCKETS)
}
std::move(callback).Run();
if (callback) {
std::move(callback).Run();
}
}
void NetworkContext::ExemptUrlFromNetworkRevocationForNonce(
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,4 @@
// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -3787,10 +3786,10 @@ enum WebFeature {
kDisableThirdPartyStoragePartitioning = 4444,
kServiceWorkerFetchHandlerAddedAfterInitialization = 4445,
kObsoleteCreateImageBitmapImageOrientationNone = 4446,
kWindowManagementPermissionDescriptorUsed = 4447,
kWindowPlacementPermissionDescriptorUsed = 4448,
kWindowManagementPermissionPolicyParsed = 4449,
kWindowPlacementPermissionPolicyParsed = 4450,
kOBSOLETE_kWindowManagementPermissionDescriptorUsed = 4447,
kOBSOLETE_kWindowPlacementPermissionDescriptorUsed = 4448,
kOBSOLETE_kWindowManagementPermissionPolicyParsed = 4449,
kOBSOLETE_kWindowPlacementPermissionPolicyParsed = 4450,
kContentDispositionInSvgUse = 4451,
kSameDocumentCrossOriginInitiator = 4452,
kServiceWorkerFetchHandlerModifiedAfterInitialization = 4453,
@@ -3821,7 +3820,6 @@ enum WebFeature {
kGetDisplayMediaWithPreferCurrentTabTrue = 4476,
kFencedFrameConfigAttribute = 4477,
kURLSearchParams_Has_Delete_MultipleArguments = 4478,
kPaymentHandlerMinimalHeaderUX = 4479,
// The items above roughly this point are available in the M112 branch.
kPopoverTypeHint = 4480,
@@ -3874,7 +3872,7 @@ enum WebFeature {
// The items above roughly this point are available in the M113 branch.
kAttributeValueContainsLtOrGt = 4527,
kV8ImportAssertionDeprecatedSyntax = 4528,
kOBSOLETE_V8ImportAssertionDeprecatedSyntax = 4528,
kImageCaptureBackgroundBlur = 4529,
kPrivateNetworkAccessPreflightError = 4530,
kPrivateNetworkAccessPreflightSuccess = 4531,
@@ -4327,6 +4325,46 @@ enum WebFeature {
kIdentityDigitalCredentialsSuccess = 4942,
kV8DeviceProperties_UniqueId_AttributeGetter = 4943,
kSharedStorageAPI_SelectURLOverallPageloadBudgetInsufficient = 4944,
kV8LanguageTranslator_Translate_Method = 4945,
kV8Translation_CanTranslate_Method = 4946,
kV8Translation_CreateTranslator_Method = 4947,
kIdentityDigitalCredentialsDeepLink = 4948,
kV8WebView_GetExperimentalMediaIntegrityTokenProvider_Method = 4949,
kV8MediaIntegrityTokenProvider_RequestToken_Method = 4950,
kCanvas2DLayersFilters = 4951,
kCanvas2DLayersCSSFilters = 4952,
kCanvas2DLayersFilterObjects = 4953,
// https://drafts.csswg.org/css-scroll-snap-2/#scroll-start-target
kCSSScrollStartTarget = 4954,
kFedCmContinueOnResponse = 4955,
kFedCmMultipleIdentityProviders = 4956,
kFedCmWithStorageAccessAPI = 4957,
kCSSSelectorUserValid = 4958,
kCSSSelectorUserInvalid = 4959,
kCrossShadowAtomicMove = 4960,
kPrefersReducedMotionMediaFeature = 4961,
kPrefersReducedTransparencyMediaFeature = 4962,
kPrefersReducedDataMediaFeature = 4963,
kScriptingMediaFeature = 4964,
kInvertedColorsMediaFeature = 4965,
kCSSLightDark = 4966,
kPrivateAggregationApiFilteringIds = 4967,
kHTMLInputInSelect = 4968,
kCanvas2DMesh = 4969,
kCaretPositionFromPoint = 4970,
kDocumentPolicyIncludeJSCallStacksInCrashReports = 4971,
kMaximumHTMLParserDOMTreeDepthHit = 4972,
// Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots.
// Also, run update_use_counter_feature_enum.py in
@@ -211,7 +211,6 @@ struct WebPreferences {
bool initialize_at_minimum_page_scale;
bool smart_insert_delete_enabled;
bool spatial_navigation_enabled;
bool fake_no_alloc_direct_call_for_testing_enabled;
V8CacheOptions v8_cache_options;
bool record_whole_document;
@@ -419,10 +418,12 @@ struct WebPreferences {
// when to apply system color overrides to author specified styles.
bool in_forced_colors;
// The preferred color scheme set by the user's browser settings. The scheme
// is used to evaluate the used color scheme. Currently, only used for the
// scrollbars' used color scheme.
PreferredColorScheme browser_preferred_color_scheme;
// The preferred color scheme set by the user's browser settings. The variable
// follows the browser's color mode setting unless a browser theme (custom or
// not) is defined, in which case the color scheme is set to the default
// value. This value is used to evaluate the used color scheme in non overlay
// root scrollbars.
PreferredColorScheme preferred_root_scrollbar_color_scheme;
// The preferred color scheme for the web content. The scheme is used to
// evaluate the prefers-color-scheme media query and resolve UA color scheme
@@ -20,14 +20,9 @@
// https://drafts.csswg.org/cssom/#the-csspagerule-interface
// TODO(foolip): CSSPageRule should inherit from CSSGroupingRule.
// crbug.com/496381. To internally implement this as grouping rule,
// margin at-rules should be implemented crbug.com/320370, since the
// spec https://drafts.csswg.org/css-page/#at-page-rule allows only
// margin at-rules inside @page.
[
Exposed=Window
] interface CSSPageRule : CSSRule {
] interface CSSPageRule : CSSGroupingRule {
[SetterCallWith=ExecutionContext] attribute DOMString selectorText;
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
};
@@ -3,8 +3,7 @@
// found in the LICENSE file.
[
Exposed=Window,
RuntimeEnabled=CSSScope
Exposed=Window
] interface CSSScopeRule : CSSGroupingRule {
readonly attribute CSSOMString? start;
readonly attribute CSSOMString? end;
@@ -76,8 +76,9 @@ class MediaQueryFeatureSet : public MediaQueryParser::FeatureSet {
feature == media_feature_names::kPrefersColorSchemeMediaFeature ||
feature == media_feature_names::kPrefersContrastMediaFeature ||
feature == media_feature_names::kPrefersReducedMotionMediaFeature ||
(feature == media_feature_names::kUpdateMediaFeature &&
RuntimeEnabledFeatures::CSSUpdateMediaFeatureEnabled()) ||
feature == media_feature_names::kOverflowInlineMediaFeature ||
feature == media_feature_names::kOverflowBlockMediaFeature ||
feature == media_feature_names::kUpdateMediaFeature ||
(feature == media_feature_names::kPrefersReducedDataMediaFeature &&
RuntimeEnabledFeatures::PrefersReducedDataEnabled()) ||
feature ==
@@ -99,10 +100,6 @@ class MediaQueryFeatureSet : public MediaQueryParser::FeatureSet {
execution_context)) ||
(feature == media_feature_names::kDevicePostureMediaFeature &&
RuntimeEnabledFeatures::DevicePostureEnabled(execution_context)) ||
(feature == media_feature_names::kOverflowInlineMediaFeature &&
RuntimeEnabledFeatures::CSSOverflowMediaFeaturesEnabled()) ||
(feature == media_feature_names::kOverflowBlockMediaFeature &&
RuntimeEnabledFeatures::CSSOverflowMediaFeaturesEnabled()) ||
(feature == media_feature_names::kInvertedColorsMediaFeature &&
RuntimeEnabledFeatures::InvertedColorsEnabled()) ||
CSSVariableParser::IsValidVariableName(feature) ||
@@ -184,12 +184,7 @@ typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement;
[MeasureAs=DocumentCaretRangeFromPoint] Range caretRangeFromPoint(optional long x = 0, optional long y = 0);
// https://www.w3.org/TR/cssom-view/#dom-document-caretpositionfrompoint
[NewObject, RuntimeEnabled=CaretPositionFromPoint] CaretPosition? caretPositionFromPoint(float x, float y);
// Storage Access API
[CallWith=ScriptState, NewObject, MeasureAs=StorageAccessAPI_HasStorageAccess_Method] Promise<boolean> hasStorageAccess();
[CallWith=ScriptState, NewObject, MeasureAs=StorageAccessAPI_requestStorageAccess_Method] Promise<undefined> requestStorageAccess();
[CallWith=ScriptState, NewObject, MeasureAs=StorageAccessAPI_requestStorageAccessFor_Method] Promise<undefined> requestStorageAccessFor(USVString requestedOrigin);
[NewObject, MeasureAs=CaretPositionFromPoint, RuntimeEnabled=CaretPositionFromPoint] CaretPosition? caretPositionFromPoint(float x, float y, ShadowRoot... shadowRoots);
// Text fragment directive API
// https://wicg.github.io/scroll-to-text-fragment/#feature-detectability
@@ -58,6 +58,7 @@ interface mixin GlobalEventHandlers {
attribute EventHandler onemptied;
attribute EventHandler onended;
attribute OnErrorEventHandler onerror;
[RuntimeEnabled=FencedFramesLocalUnpartitionedDataAccess] attribute EventHandler onfencedtreeclick;
attribute EventHandler onfocus;
attribute EventHandler onformdata;
attribute EventHandler oninput;
@@ -13,7 +13,20 @@ callback Mapper = any (any element, unsigned long long index);
// Differs from Mapper only in return type, since this callback is exclusively
// used to visit each element in a sequence, not transform it.
callback Visitor = undefined (any element, unsigned long long index);
callback Predicate = boolean (any value);
// This matches the predicate in the ECMAScript Iterator helpers proposal, i.e.,
// including the `index` parameter.
callback Predicate = boolean (any value, unsigned long long index);
callback ObservableInspectorAbortHandler = undefined (any value);
dictionary ObservableInspector {
ObserverCallback next;
ObserverCallback error;
ObserverCompleteCallback complete;
VoidFunction subscribe;
ObservableInspectorAbortHandler abort;
};
dictionary Observer {
ObserverCallback next;
@@ -26,6 +39,7 @@ dictionary SubscribeOptions {
};
typedef (ObserverCallback or Observer) ObserverUnion;
typedef (ObserverCallback or ObservableInspector) ObservableInspectorUnion;
[Exposed=(Window,Worker), RuntimeEnabled=ObservableAPI]
interface Observable {
@@ -47,6 +61,7 @@ interface Observable {
[CallWith=ScriptState] Observable drop(unsigned long long number_to_drop);
[CallWith=ScriptState, RaisesException] Observable flatMap(Mapper mapper);
[CallWith=ScriptState, RaisesException] Observable switchMap(Mapper mapper);
[CallWith=ScriptState] Observable inspect(optional ObservableInspectorUnion inspect_observer = {});
// Promise-returning operators.
// See https://wicg.github.io/observable/#promise-returning-operators.
@@ -54,5 +69,8 @@ interface Observable {
[CallWith=ScriptState] Promise<undefined> forEach(Visitor callback, optional SubscribeOptions options = {});
[CallWith=ScriptState] Promise<any> first(optional SubscribeOptions options = {});
[CallWith=ScriptState] Promise<any> last(optional SubscribeOptions options = {});
[CallWith=ScriptState] Promise<boolean> some(Predicate predicate, optional SubscribeOptions options = {});
[CallWith=ScriptState] Promise<boolean> every(Predicate predicate, optional SubscribeOptions options = {});
[CallWith=ScriptState] Promise<any> find(Predicate predicate, optional SubscribeOptions options = {});
};
@@ -50,7 +50,7 @@ interface ShadowRoot : DocumentFragment {
// The serializable attribute controls whether the shadow root will be
// serialized by getHTML({serializableShadowRoots:true}).
[RuntimeEnabled=ElementGetHTML] attribute boolean serializable;
[RuntimeEnabled=ElementGetHTML] readonly attribute boolean serializable;
// The clonable attribute controls whether the shadow root will be
// cloned by DOM cloning operations.
@@ -20,7 +20,7 @@
[MeasureAs=PointerEventAttributeCount] readonly attribute long twist;
[MeasureAs=PointerEventAttributeCount] readonly attribute DOMString pointerType;
[MeasureAs=PointerEventAttributeCount] readonly attribute boolean isPrimary;
[MeasureAs=PointerEventAttributeCount, RuntimeEnabled=PointerEventDeviceId] readonly attribute DeviceProperties deviceProperties;
[MeasureAs=PointerEventAttributeCount, RuntimeEnabled=PointerEventDeviceId] readonly attribute DeviceProperties? deviceProperties;
// https://w3c.github.io/pointerevents/extension.html#extensions-to-the-pointerevent-interface
[Measure] sequence<PointerEvent> getCoalescedEvents();
@@ -17,7 +17,7 @@ dictionary PointerEventInit : MouseEventInit {
long twist = 0;
DOMString pointerType = "";
boolean isPrimary = false;
DeviceProperties deviceProperties;
DeviceProperties? deviceProperties = null;
// https://w3c.github.io/pointerevents/extension.html#extensions-to-the-pointerevent-interface
sequence<PointerEvent> coalescedEvents = [];
@@ -614,7 +614,7 @@ WebViewImpl::WebViewImpl(
SetVisibilityState(visibility, /*is_initial_state=*/true);
page_->SetIsPrerendering(is_prerendering);
// TODO(crbug.com/1498140): Remove the in_inside_portal parameter.
// TODO(crbug.com/40287334): Remove the is_inside_portal parameter.
if (fenced_frame_mode && features::IsFencedFramesEnabled()) {
page_->SetIsMainFrameFencedFrameRoot();
@@ -1642,9 +1642,6 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
settings->SetSelectionIncludesAltImageText(true);
RuntimeEnabledFeatures::SetFakeNoAllocDirectCallForTestingEnabled(
prefs.fake_no_alloc_direct_call_for_testing_enabled);
settings->SetV8CacheOptions(prefs.v8_cache_options);
settings->SetImageAnimationPolicy(prefs.animation_policy);
@@ -1792,8 +1789,8 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
settings->SetLazyLoadEnabled(prefs.lazy_load_enabled);
settings->SetInForcedColors(prefs.in_forced_colors);
settings->SetBrowserPreferredColorScheme(
prefs.browser_preferred_color_scheme);
settings->SetPreferredRootScrollbarColorScheme(
prefs.preferred_root_scrollbar_color_scheme);
settings->SetPreferredColorScheme(prefs.preferred_color_scheme);
settings->SetPreferredContrast(prefs.preferred_contrast);
@@ -2577,8 +2574,12 @@ void WebViewImpl::SetPageLifecycleStateInternal(
if (RuntimeEnabledFeatures::PageRevealEventEnabled()) {
if (restoring_from_bfcache) {
if (auto* main_frame = DynamicTo<LocalFrame>(GetPage()->MainFrame())) {
main_frame->GetDocument()->EnqueuePageRevealEvent();
for (Frame* frame = GetPage()->MainFrame(); frame;
frame = frame->Tree().TraverseNext()) {
if (auto* local_frame = DynamicTo<LocalFrame>(frame)) {
CHECK(local_frame->GetDocument());
local_frame->GetDocument()->EnqueuePageRevealEvent();
}
}
}
}
@@ -44,10 +44,10 @@
[HighEntropy=Direct, Measure] readonly attribute long availTop;
// Fired when the windows screen or that screen's attributes change.
// https://w3c.github.io/window-placement/
// https://w3c.github.io/window-management/
[SecureContext, HighEntropy, MeasureAs=WindowScreenChange] attribute EventHandler onchange;
// Whether the devices visual output extends over multiple screens.
// https://w3c.github.io/window-placement/
// https://w3c.github.io/window-management/
[SecureContext, HighEntropy=Direct, MeasureAs=WindowScreenIsExtended] readonly attribute boolean isExtended;
};
@@ -1092,11 +1092,13 @@
type: "bool",
},
// Preferred color scheme from the browser settings passed to the renderer
// for evaluating the used color scheme. Currently, only used for the
// scrollbars' used color scheme.
// The preferred color scheme set by the user's browser settings. The
// variable follows the browser's color mode setting unless a browser theme
// (custom or not) is defined, in which case the color scheme is set to the
// default value. This value is used to evaluate the used color scheme in
// non overlay root scrollbars.
{
name: "browserPreferredColorScheme",
name: "preferredRootScrollbarColorScheme",
initial: "mojom::blink::PreferredColorScheme::kLight",
invalidate: ["ColorScheme"],
type: "mojom::blink::PreferredColorScheme",
@@ -184,7 +184,7 @@
[RuntimeEnabled=AccessibilityObjectModel, CallWith=ScriptState] Promise<ComputedAccessibleNode> getComputedAccessibleNode(Element element);
// https://dom.spec.whatwg.org/#interface-window-extensions
[Replaceable, GetterCallWith=ScriptState, MeasureAs=WindowEvent, NotEnumerable] readonly attribute any event;
[Replaceable, GetterCallWith=ScriptState, MeasureAs=WindowEvent] readonly attribute any event;
// Non-standard APIs
[MeasureAs=WindowClientInformation, Replaceable] readonly attribute Navigator clientInformation;
@@ -14,6 +14,6 @@ dictionary FullscreenOptions {
FullscreenNavigationUI navigationUI = "auto";
// Specifies a screen for element fullscreen requests.
// https://w3c.github.io/window-placement/
// https://w3c.github.io/window-management/
Screen screen;
};
@@ -13,5 +13,4 @@ interface HTMLFencedFrameElement : HTMLElement {
// Feature Policy
[CEReactions, Reflect, RuntimeEnabled=FencedFramesAPIChanges] attribute DOMString allow;
[PutForwards=value] readonly attribute DOMTokenList sandbox;
attribute EventHandler onfencedtreeclick;
};
@@ -5,5 +5,5 @@
// https://w3c.github.io/pointerevents/#pointerevent-interface
dictionary DevicePropertiesInit {
long uniqueId = -1;
long uniqueId = 0;
};
@@ -412,6 +412,17 @@ bool OriginTrialContext::InstallFeatures(
ScriptState* script_state) {
bool added_binding_features = false;
for (mojom::blink::OriginTrialFeature enabled_feature : features) {
// TODO(https://crbug.com/40243430): add support for workers/non-frames that
// are enabling origin trials to send their information to the browser too.
if (context_->IsWindow() && feature_to_tokens_.Contains(enabled_feature)) {
// Note that, as we support third-party origin trials, the tokens must be
// sent anytime there is an update. We cannot depend on sending once as
// not all tokens activate the feature for the same scope.
context_->GetRuntimeFeatureStateOverrideContext()
->ApplyOriginTrialOverride(
enabled_feature, feature_to_tokens_.find(enabled_feature)->value);
}
if (installed_features_.Contains(enabled_feature))
continue;
@@ -422,14 +433,6 @@ bool OriginTrialContext::InstallFeatures(
InstallPropertiesPerFeature(script_state, enabled_feature);
added_binding_features = true;
// TODO(https://crbug.com/1410817): add support for workers/non-frames that
// are enabling origin trials to send their information to the browser too.
if (context_->IsWindow() && feature_to_tokens_.Contains(enabled_feature)) {
context_->GetRuntimeFeatureStateOverrideContext()
->ApplyOriginTrialOverride(
enabled_feature, feature_to_tokens_.find(enabled_feature)->value);
}
}
return added_binding_features;
@@ -561,6 +564,10 @@ bool OriginTrialContext::CanEnableTrialFromName(const StringView& trial_name) {
base::FeatureList::IsEnabled(features::kDevicePosture);
}
if (trial_name == "PermissionElement") {
return base::FeatureList::IsEnabled(blink::features::kPermissionElement);
}
return true;
}
@@ -683,7 +690,7 @@ bool OriginTrialContext::EnableTrialFromToken(
TrialTokenResult token_result =
trial_token_validator_->ValidateTokenAndTrialWithOriginInfo(
token_string.AsStringPiece(),
token_string.AsStringView(),
TrialTokenValidator::OriginInfo(origin_info.origin->ToUrlOrigin(),
origin_info.is_secure),
script_url_origins, base::Time::Now());
@@ -18,11 +18,11 @@ enum ReadableStreamType { "bytes" };
readonly attribute boolean locked;
// TODO(yhirano): function length is different from what's specced. Fix it.
[RaisesException, CallWith=ScriptState] Promise<any> cancel(optional any reason);
[RaisesException, CallWith=ScriptState] Promise<undefined> cancel(optional any reason);
[RaisesException, CallWith=ScriptState, MeasureAs=ReadableStreamGetReader] ReadableStreamReader getReader(optional ReadableStreamGetReaderOptions options);
[RaisesException, CallWith=ScriptState, MeasureAs=ReadableStreamPipeThrough] ReadableStream pipeThrough(
ReadableWritablePair transform, optional StreamPipeOptions options);
[RaisesException, CallWith=ScriptState, MeasureAs=ReadableStreamPipeTo] Promise<any> pipeTo(
[RaisesException, CallWith=ScriptState, MeasureAs=ReadableStreamPipeTo] Promise<undefined> pipeTo(
WritableStream destination, optional StreamPipeOptions options);
[RaisesException, CallWith=ScriptState] sequence<ReadableStream> tee();
};
@@ -1,10 +0,0 @@
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://streams.spec.whatwg.org/#dictdef-readablestreambyobreadresult
dictionary ReadableStreamBYOBReadResult {
ArrayBufferView value;
boolean done;
};
@@ -8,7 +8,7 @@
] interface ReadableStreamBYOBReader {
[CallWith=ScriptState, RaisesException] constructor(ReadableStream stream);
[CallWith=ScriptState, RaisesException] Promise<ReadableStreamBYOBReadResult> read(ArrayBufferView view);
[CallWith=ScriptState, RaisesException] Promise<ReadableStreamReadResult> read(ArrayBufferView view);
[CallWith=ScriptState, RaisesException] void releaseLock();
};
@@ -6,6 +6,6 @@
[
Exposed=(Window,Worker,Worklet)
] interface mixin ReadableStreamGenericReader {
[CallWith=ScriptState] readonly attribute Promise<void> closed;
[CallWith=ScriptState, RaisesException] Promise<void> cancel(optional any reason);
[CallWith=ScriptState] readonly attribute Promise<undefined> closed;
[CallWith=ScriptState, RaisesException] Promise<undefined> cancel(optional any reason);
};
@@ -8,8 +8,8 @@
] interface WritableStream {
[CallWith=ScriptState, RaisesException, MeasureAs=WritableStreamConstructor] constructor(optional any underlyingSink, optional any strategy);
readonly attribute boolean locked;
[RaisesException, CallWith=ScriptState] Promise<void> abort(
[RaisesException, CallWith=ScriptState] Promise<undefined> abort(
optional any reason);
[RaisesException, CallWith=ScriptState] Promise<void> close();
[RaisesException, CallWith=ScriptState] Promise<undefined> close();
[RaisesException, CallWith=ScriptState] WritableStreamDefaultWriter getWriter();
};
@@ -9,17 +9,17 @@
Exposed=(Window,Worker,Worklet)
] interface WritableStreamDefaultWriter {
[CallWith=ScriptState, RaisesException] constructor(WritableStream stream);
[CallWith=ScriptState] readonly attribute Promise<void>
[CallWith=ScriptState] readonly attribute Promise<undefined>
closed;
[RaisesException, CallWith=ScriptState] readonly attribute
any desiredSize;
[CallWith=ScriptState] readonly attribute Promise<void>
[CallWith=ScriptState] readonly attribute Promise<undefined>
ready;
[CallWith=ScriptState, RaisesException] Promise<void> abort(
[CallWith=ScriptState, RaisesException] Promise<undefined> abort(
optional any reason);
[CallWith=ScriptState, RaisesException] Promise<void> close();
[CallWith=ScriptState, RaisesException] Promise<undefined> close();
[CallWith=ScriptState] void releaseLock();
[CallWith=ScriptState, RaisesException] Promise<void> write(
[CallWith=ScriptState, RaisesException] Promise<undefined> write(
optional any chunk);
};
@@ -31,3 +31,4 @@ interface SVGAElement : SVGGraphicsElement {
};
SVGAElement includes SVGURIReference;
SVGAElement includes InterestInvokerElement;
@@ -344,6 +344,7 @@ interface Internals {
void setVisualViewportOffset(long x, long y);
boolean isUseCounted(Document document, unsigned long feature);
boolean isWebDXFeatureUseCounted(Document document, unsigned long feature);
boolean isCSSPropertyUseCounted(Document document, DOMString propertyName);
boolean isAnimatedCSSPropertyUseCounted(Document document, DOMString propertyName);
void clearUseCounter(Document document, unsigned long feature);
@@ -448,6 +449,10 @@ interface Internals {
void setBackForwardCacheRestorationBufferSize(long maxSize);
void setEventTimingBufferSize(long maxSize);
void stopResponsivenessMetricsUkmSampling();
sequence<DOMString> getCreatorScripts(HTMLImageElement img);
// Wait until predicted LCP is painted. Never called if prediction is
@@ -33,6 +33,7 @@
] interface URL {
[RaisesException] constructor(USVString url, optional USVString base);
[RuntimeEnabled=URLParse] static URL? parse(USVString url, optional USVString base);
static boolean canParse(USVString url, optional USVString base);
[RaisesException=Setter] stringifier attribute USVString href;
@@ -32,7 +32,7 @@
// SharedWorkers also support the `sameSiteCookies` option outlined in:
// https://privacycg.github.io/saa-non-cookie-storage/shared-workers.html
dictionary SharedWorkerOptions : WorkerOptions {
[RuntimeEnabled=StorageAccessAPIBeyondCookies] SharedWorkerSameSiteCookies sameSiteCookies;
SharedWorkerSameSiteCookies sameSiteCookies;
};
enum SharedWorkerSameSiteCookies { "all", "none" };
@@ -15,5 +15,6 @@
// device, which includes the pased-in contentBinding as a defense against
// replay attacks.
// Throws MediaIntegrityError.
[CallWith=ScriptState, HighEntropy, RaisesException] Promise<DOMString> requestToken(optional DOMString? contentBinding = null);
[CallWith=ScriptState, HighEntropy, RaisesException, Measure]
Promise<DOMString> requestToken(optional DOMString? contentBinding = null);
};
@@ -20,5 +20,14 @@ dictionary GetMediaIntegrityTokenProviderParams {
// time to resolve (> 1s).
//
// The promise may reject as a MediaIntegrityError.
[NewObject, CallWith=ScriptState, HighEntropy, RaisesException, RuntimeEnabled=BlinkExtensionWebViewMediaIntegrity, SecureContext] Promise<MediaIntegrityTokenProvider> getExperimentalMediaIntegrityTokenProvider(GetMediaIntegrityTokenProviderParams params);
[ NewObject,
CallWith=ScriptState,
HighEntropy,
RaisesException,
RuntimeEnabled=BlinkExtensionWebViewMediaIntegrity,
SecureContext,
Measure
]
Promise<MediaIntegrityTokenProvider>
getExperimentalMediaIntegrityTokenProvider(GetMediaIntegrityTokenProviderParams params);
};
@@ -30,6 +30,10 @@ dictionary AuctionReportBuyerDebugModeConfig {
bigint? debugKey;
};
dictionary AuctionRealTimeReportingConfig {
required DOMString type;
};
dictionary AuctionAdConfig {
required USVString seller;
@@ -97,6 +101,11 @@ dictionary AuctionAdConfig {
ProtectedAudiencePrivateAggregationConfig privateAggregationConfig;
[RuntimeEnabled=FledgeRealTimeReporting]
AuctionRealTimeReportingConfig sellerRealTimeReportingConfig;
[RuntimeEnabled=FledgeRealTimeReporting]
record<USVString, AuctionRealTimeReportingConfig> perBuyerRealTimeReportingConfig;
sequence<AuctionAdConfig> componentAuctions;
AbortSignal? signal;
@@ -137,13 +137,13 @@ interface CanvasRenderingContext2D {
[RaisesException] void drawImage(CanvasImageSource image, unrestricted double sx, unrestricted double sy, unrestricted double sw, unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
// triangle mesh API
[RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DVertexBuffer createMesh2DVertexBuffer(Float32Array buffer);
[RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DUVBuffer createMesh2DUVBuffer(Float32Array buffer);
[RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DIndexBuffer createMesh2DIndexBuffer(Uint16Array buffer);
[RuntimeEnabled=Canvas2dMesh, HighEntropy, RaisesException] void drawMesh(Mesh2DVertexBuffer vertex_buffer,
Mesh2DUVBuffer uv_buffer,
Mesh2DIndexBuffer index_buffer,
CanvasImageSource image);
[MeasureAs=Canvas2DMesh, RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DVertexBuffer createMesh2DVertexBuffer(Float32Array buffer);
[MeasureAs=Canvas2DMesh, RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DUVBuffer createMesh2DUVBuffer(Float32Array buffer);
[MeasureAs=Canvas2DMesh, RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DIndexBuffer createMesh2DIndexBuffer(Uint16Array buffer);
[MeasureAs=Canvas2DMesh, RuntimeEnabled=Canvas2dMesh, HighEntropy, RaisesException] void drawMesh(Mesh2DVertexBuffer vertex_buffer,
Mesh2DUVBuffer uv_buffer,
Mesh2DIndexBuffer index_buffer,
CanvasImageSource image);
// pixel manipulation
[RaisesException] ImageData createImageData(ImageData imagedata);
@@ -9,4 +9,11 @@ dictionary CanvasWebGPUAccessOption {
// This label will be assigned to the GPUTexture returned by beginWebGPUAccess.
DOMString? label;
// This controls the GPUTextureUsage flags of the GPUTexture returned by
// beginWebGPUAccess. (The returned texture might actually have additional
// texture usage flags beyond the requested flags.)
// The default value will return a canvas texture that is usable as a render
// attachment, and bindable as a 2D texture.
GPUTextureUsageFlags usage = 0x14; // TEXTURE_BINDING | RENDER_ATTACHMENT
};
@@ -84,13 +84,13 @@
[RaisesException] void drawImage(CanvasImageSource image, unrestricted double sx, unrestricted double sy, unrestricted double sw, unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
// triangle mesh API
[RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DVertexBuffer createMesh2DVertexBuffer(Float32Array buffer);
[RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DUVBuffer createMesh2DUVBuffer(Float32Array buffer);
[RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DIndexBuffer createMesh2DIndexBuffer(Uint16Array buffer);
[RuntimeEnabled=Canvas2dMesh, HighEntropy, RaisesException] void drawMesh(Mesh2DVertexBuffer vertex_buffer,
Mesh2DUVBuffer uv_buffer,
Mesh2DIndexBuffer index_buffer,
CanvasImageSource image);
[MeasureAs=Canvas2DMesh, RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DVertexBuffer createMesh2DVertexBuffer(Float32Array buffer);
[MeasureAs=Canvas2DMesh, RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DUVBuffer createMesh2DUVBuffer(Float32Array buffer);
[MeasureAs=Canvas2DMesh, RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DIndexBuffer createMesh2DIndexBuffer(Uint16Array buffer);
[MeasureAs=Canvas2DMesh, RuntimeEnabled=Canvas2dMesh, HighEntropy, RaisesException] void drawMesh(Mesh2DVertexBuffer vertex_buffer,
Mesh2DUVBuffer uv_buffer,
Mesh2DIndexBuffer index_buffer,
CanvasImageSource image);
// pixel manipulation
[RaisesException] ImageData createImageData(ImageData imagedata);
[RaisesException] ImageData createImageData([EnforceRange] long sw, [EnforceRange] long sh);
@@ -20,6 +20,9 @@ dictionary IdentityCredentialDisconnectOptions : IdentityProviderConfig {
[RuntimeEnabled=FedCmAutoSelectedFlag]
readonly attribute boolean isAutoSelected;
// The config URL of the selected identity provider.
[RuntimeEnabled=FedCmMultipleIdentityProviders] readonly attribute USVString configURL;
// https://github.com/fedidcg/FedCM/pull/515
[RuntimeEnabled=FedCmDisconnect, CallWith=ScriptState, RaisesException, MeasureAs=FedCmDisconnect] static Promise<undefined> disconnect(optional IdentityCredentialDisconnectOptions options = {});
@@ -18,48 +18,6 @@ dictionary IdentityProviderRequestOptions : IdentityProviderConfig {
USVString nonce;
DOMString loginHint;
[RuntimeEnabled=FedCmDomainHint] DOMString domainHint;
[RuntimeEnabled=FedCmAuthz] sequence<USVString> scope;
[RuntimeEnabled=FedCmAuthz] sequence<USVString> responseType;
[RuntimeEnabled=FedCmAuthz] sequence<USVString> fields;
[RuntimeEnabled=FedCmAuthz] record<USVString, USVString> params;
};
// extends the IdentityProviderConfig with DigitalCredential-specific attributes
partial dictionary IdentityProviderConfig {
[RuntimeEnabled=WebIdentityDigitalCredentials] DigitalCredentialProvider holder;
};
dictionary DigitalCredentialProvider {
// A query selector that is used by wallets to filter credentials for
// selection.
DigitalCredentialSelector selector;
// An opaque map of parameters sent to wallets upon selection.
record<USVString, USVString> params;
};
dictionary DigitalCredentialSelector {
// A list of desired formats for the credential.
sequence<USVString> format;
// The top-level type of document (e.g. a passport, driver's license, etc).
DOMString doctype;
// The amount of time the verifier intends to retain the credential.
// Omitting `retention` implies that the identity information will not be stored.
// How long the verifier intends to retent the credential.
DigitalCredentialStorageDuration retention;
// The requested fields.
sequence<(DigitalCredentialFieldRequirement or DOMString)> fields;
};
dictionary DigitalCredentialFieldRequirement {
required DOMString name;
DOMString equals;
};
dictionary DigitalCredentialStorageDuration {
// Exactly one of the following must be provided.
boolean forever;
long days;
};
@@ -74,13 +74,13 @@
[RaisesException] void drawImage(CanvasImageSource image, unrestricted double sx, unrestricted double sy, unrestricted double sw, unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
// triangle mesh API
[RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DVertexBuffer createMesh2DVertexBuffer(Float32Array buffer);
[RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DUVBuffer createMesh2DUVBuffer(Float32Array buffer);
[RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DIndexBuffer createMesh2DIndexBuffer(Uint16Array buffer);
[RuntimeEnabled=Canvas2dMesh, HighEntropy, RaisesException] void drawMesh(Mesh2DVertexBuffer vertex_buffer,
Mesh2DUVBuffer uv_buffer,
Mesh2DIndexBuffer index_buffer,
CanvasImageSource image);
[MeasureAs=Canvas2DMesh, RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DVertexBuffer createMesh2DVertexBuffer(Float32Array buffer);
[MeasureAs=Canvas2DMesh, RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DUVBuffer createMesh2DUVBuffer(Float32Array buffer);
[MeasureAs=Canvas2DMesh, RuntimeEnabled=Canvas2dMesh, RaisesException] Mesh2DIndexBuffer createMesh2DIndexBuffer(Uint16Array buffer);
[MeasureAs=Canvas2DMesh, RuntimeEnabled=Canvas2dMesh, HighEntropy, RaisesException] void drawMesh(Mesh2DVertexBuffer vertex_buffer,
Mesh2DUVBuffer uv_buffer,
Mesh2DIndexBuffer index_buffer,
CanvasImageSource image);
// FIXME: factor out to CanvasDrawingStyles
// line caps/joins
attribute unrestricted double lineWidth; // (default 1)
@@ -0,0 +1,10 @@
// 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.
[
ImplementedAs=InternalsDevicePosture
] partial interface Internals {
[CallWith=ScriptState] Promise<undefined> setDevicePostureOverride(DevicePostureType posture);
[CallWith=ScriptState] Promise<undefined> clearDevicePostureOverride();
};
@@ -37,5 +37,6 @@
readonly attribute DOMString encoding;
readonly attribute boolean fatal;
readonly attribute boolean ignoreBOM;
[RaisesException, MeasureAs=TextDecoderDecode] DOMString decode(optional BufferSource input, optional TextDecodeOptions options = {});
// TODO(40102463): investigate support of SharedArrayBuffers.
[RaisesException, MeasureAs=TextDecoderDecode] DOMString decode(optional [PassAsSpan] BufferSource input, optional TextDecodeOptions options = {});
};
@@ -10,7 +10,7 @@ enum FileSystemChangeType {
"errored",
"modified",
"moved",
"unsupported",
"unknown",
};
[
@@ -33,4 +33,5 @@
readonly attribute double? altitudeAccuracy;
readonly attribute double? heading;
readonly attribute double? speed;
[CallWith=ScriptState] object toJSON();
};
@@ -31,4 +31,5 @@
] interface GeolocationPosition {
readonly attribute GeolocationCoordinates coords;
readonly attribute EpochTimeStamp timestamp;
[CallWith=ScriptState] object toJSON();
};
@@ -29,8 +29,7 @@
*/
[
ImplementedAs=HTMLVideoElementMediaSource,
RuntimeEnabled=VideoPlaybackQuality
ImplementedAs=HTMLVideoElementMediaSource
] partial interface HTMLVideoElement {
[Measure] VideoPlaybackQuality getVideoPlaybackQuality();
};
@@ -28,8 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
[
Exposed=Window,
RuntimeEnabled=VideoPlaybackQuality
Exposed=Window
] interface VideoPlaybackQuality {
readonly attribute DOMHighResTimeStamp creationTime;
readonly attribute unsigned long totalVideoFrames;
@@ -31,7 +31,7 @@
[
RuntimeEnabled = GetAllScreensMedia, CallWith = ScriptState, RaisesException,
MeasureAs = GetAllScreensMedia
MeasureAs = GetAllScreensMedia, InjectionMitigated
] Promise<sequence<MediaStream>>
getAllScreensMedia();
@@ -19,6 +19,8 @@ dictionary MLComputeResult {
MLNamedArrayBufferViews outputs;
};
typedef record<DOMString, MLBuffer> MLNamedBuffers;
[
RuntimeEnabled=MachineLearningCommon,
SecureContext,
@@ -68,4 +70,12 @@ dictionary MLComputeResult {
RaisesException
] Promise<ArrayBuffer> readBuffer(
MLBuffer srcBuffer);
// TODO(crbug.com/1273291): enable partial buffer dispatches.
[
RuntimeEnabled=MachineLearningNeuralNetwork,
CallWith=ScriptState,
RaisesException
] void dispatch(
MLGraph graph, MLNamedBuffers inputs, MLNamedBuffers outputs);
};
@@ -189,10 +189,6 @@ dictionary MLResample2dOptions {
sequence<[EnforceRange] unsigned long> axes;
};
dictionary MLSoftplusOptions {
float steepness = 1.0;
};
dictionary MLTransposeOptions {
sequence<[EnforceRange] unsigned long> permutation;
};
@@ -268,6 +264,9 @@ dictionary MLTriangularOptions {
[RaisesException] MLOperand gather(MLOperand input, MLOperand indices, optional MLGatherOptions options = {});
[RaisesException] MLOperand gelu(MLOperand input);
[RaisesException] MLActivation gelu();
[RaisesException] MLOperand gemm(MLOperand a, MLOperand b, optional MLGemmOptions options = {});
[RaisesException] sequence<MLOperand> gru(MLOperand input, MLOperand weight, MLOperand recurrentWeight,
@@ -339,8 +338,8 @@ dictionary MLTriangularOptions {
[RaisesException] MLOperand softmax(MLOperand input);
[RaisesException] MLActivation softmax();
[RaisesException] MLOperand softplus(MLOperand input, optional MLSoftplusOptions options = {});
[RaisesException] MLActivation softplus(optional MLSoftplusOptions options = {});
[RaisesException] MLOperand softplus(MLOperand input);
[RaisesException] MLActivation softplus();
[RaisesException] MLOperand softsign(MLOperand input);
[RaisesException] MLActivation softsign();
@@ -2,16 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
enum GenericModelAvailability { "readily", "after-download", "no" };
enum GenericModelAvailability {
"readily",
"after-download",
"no"
};
[
RuntimeEnabled=ModelExecutionAPI,
Exposed=Window
]
interface ModelManager {
[Measure, CallWith=ScriptState, RaisesException] Promise<GenericModelAvailability> canCreateGenericSession();
[Measure, CallWith=ScriptState, RaisesException] Promise<ModelGenericSession> createGenericSession(
[
Measure,
CallWith=ScriptState,
RaisesException
]
Promise<GenericModelAvailability> canCreateGenericSession();
[
Measure,
CallWith=ScriptState,
RaisesException
]
Promise<ModelGenericSession> createGenericSession(
optional ModelGenericSessionOptions options = {}
);
[Measure, CallWith=ScriptState, RaisesException] Promise<ModelGenericSessionOptions> defaultGenericSessionOptions();
[
Measure,
CallWith=ScriptState,
RaisesException
]
Promise<ModelGenericSessionOptions> defaultGenericSessionOptions();
};
@@ -7,5 +7,5 @@
ImplementedAs=WindowModel,
RuntimeEnabled=ModelExecutionAPI
] partial interface Window {
readonly attribute ModelManager model;
[Replaceable] readonly attribute ModelManager model;
};
@@ -0,0 +1,16 @@
// Copyright 2024 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
RuntimeEnabled=TranslationAPI,
Exposed=(Window,Worker)
]
interface LanguageTranslator {
[
Measure,
CallWith=ScriptState,
RaisesException
]
Promise<DOMString> translate(DOMString input);
};
@@ -0,0 +1,34 @@
// Copyright 2024 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
enum TranslationAvailability {
"readily",
"after-download",
"no"
};
[
RuntimeEnabled=TranslationAPI,
Exposed=(Window,Worker)
]
interface Translation {
[
RuntimeEnabled=TranslationAPI,
Measure,
CallWith=ScriptState,
RaisesException
]
Promise<TranslationAvailability> canTranslate(
TranslationLanguageOptions options
);
[
RuntimeEnabled=TranslationAPI,
Measure,
CallWith=ScriptState,
RaisesException
]
Promise<LanguageTranslator> createTranslator(
TranslationLanguageOptions options
);
};
@@ -0,0 +1,8 @@
// Copyright 2024 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
dictionary TranslationLanguageOptions {
required DOMString sourceLanguage;
required DOMString targetLanguage;
};
@@ -0,0 +1,11 @@
// 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.
[
ImplementedAs=DOMTranslation,
RuntimeEnabled=TranslationAPI,
Exposed=(Window,Worker)
] partial interface mixin WindowOrWorkerGlobalScope {
[Replaceable] readonly attribute Translation translation;
};
@@ -9,10 +9,6 @@
Exposed=ServiceWorker
] interface CanMakePaymentEvent : ExtendableEvent {
constructor(DOMString type, CanMakePaymentEventInit eventInitDict);
[DeprecateAs=IdentityInCanMakePaymentEvent, RuntimeEnabled=AddIdentityInCanMakePaymentEvent] readonly attribute USVString topOrigin;
[DeprecateAs=IdentityInCanMakePaymentEvent, RuntimeEnabled=AddIdentityInCanMakePaymentEvent] readonly attribute USVString paymentRequestOrigin;
[DeprecateAs=IdentityInCanMakePaymentEvent, RuntimeEnabled=AddIdentityInCanMakePaymentEvent] readonly attribute FrozenArray<PaymentMethodData> methodData;
[DeprecateAs=IdentityInCanMakePaymentEvent, RuntimeEnabled=AddIdentityInCanMakePaymentEvent] readonly attribute FrozenArray<PaymentDetailsModifier> modifiers;
[CallWith=ScriptState, RaisesException] void respondWith(Promise<boolean> canMakePaymentResponse);
};
@@ -1,16 +0,0 @@
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://w3c.github.io/payment-request/#merchantvalidationevent-interface
// https://crbug.com/867904
[
RuntimeEnabled=PaymentRequestMerchantValidationEvent,
SecureContext,
Exposed=Window
] interface MerchantValidationEvent : Event {
[CallWith=ScriptState, RaisesException] constructor(DOMString type, optional MerchantValidationEventInit eventInitDict = {});
readonly attribute DOMString methodName;
readonly attribute USVString validationURL;
[CallWith=ScriptState,RaisesException] void complete(Promise<any> merchantSessionPromise);
};
@@ -1,10 +0,0 @@
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://w3c.github.io/payment-request/#merchantvalidationeventinit-dictionary
// https://crbug.com/867904
dictionary MerchantValidationEventInit : EventInit {
DOMString methodName = "";
USVString validationURL = "";
};
@@ -17,4 +17,17 @@ dictionary SecurePaymentConfirmationRequest {
// Whether or not to show an opt-out flow in the SPC UX.
[RuntimeEnabled=SecurePaymentConfirmationOptOut, MeasureAs=SecurePaymentConfirmationOptOut] boolean showOptOut;
// Experimental support for showing network and issuer icons in addition to
// the payment instrument. These members are purely experimental; if we
// were to launch this we should find a non-card specific way to encode
// this information in the SecurePaymentConfirmationRequest, or better
// encapsulate it into a single sub-dictionary.
[RuntimeEnabled=SecurePaymentConfirmationNetworkAndIssuerIcons] NetworkOrIssuerInformation networkInfo;
[RuntimeEnabled=SecurePaymentConfirmationNetworkAndIssuerIcons] NetworkOrIssuerInformation issuerInfo;
};
dictionary NetworkOrIssuerInformation {
required USVString name;
required USVString icon;
};
@@ -9,7 +9,7 @@
Exposed=(Window, DedicatedWorker)
] interface RTCEncodedAudioFrame {
[RuntimeEnabled=RTCEncodedFrameSetMetadata, Measure, RaisesException]
constructor (RTCEncodedAudioFrame originalFrame, optional RTCEncodedAudioFrameMetadata newMetadata);
constructor (RTCEncodedAudioFrame originalFrame, optional RTCEncodedAudioFrameOptions options = {});
readonly attribute unsigned long timestamp; // RTP timestamp.
attribute ArrayBuffer data;
RTCEncodedAudioFrameMetadata getMetadata();
@@ -0,0 +1,9 @@
// 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.
// https://www.w3.org/TR/webrtc-encoded-transform/#RTCEncodedAudioFrame-interface
dictionary RTCEncodedAudioFrameOptions {
RTCEncodedAudioFrameMetadata metadata;
};
@@ -15,7 +15,7 @@ enum RTCEncodedVideoFrameType {
Exposed=(Window, DedicatedWorker)
] interface RTCEncodedVideoFrame {
[RuntimeEnabled=RTCEncodedFrameSetMetadata, Measure, RaisesException]
constructor (RTCEncodedVideoFrame originalFrame, optional RTCEncodedVideoFrameMetadata newMetadata);
constructor (RTCEncodedVideoFrame originalFrame, optional RTCEncodedVideoFrameOptions options = {});
readonly attribute RTCEncodedVideoFrameType type;
readonly attribute unsigned long timestamp; // RTP timestamp.
attribute ArrayBuffer data;
@@ -0,0 +1,9 @@
// 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.
// https://www.w3.org/TR/webrtc-encoded-transform/#RTCEncodedVideoFrame-interface
dictionary RTCEncodedVideoFrameOptions {
RTCEncodedVideoFrameMetadata metadata;
};
@@ -35,12 +35,12 @@ enum PermissionName {
"system-wake-lock",
"storage-access",
"window-management",
// Alias for 'window-management' (crbug.com/1328581).
"window-placement",
"local-fonts",
"top-level-storage-access",
"captured-surface-control",
"speaker-selection",
"keyboard-lock",
"pointer-lock",
};
// The PermissionDescriptor dictionary is a base to describe permissions. Some
@@ -42,6 +42,7 @@ dictionary WebPrintJobTemplateAttributes {
unsigned long copies;
WebPrintingMediaCollectionRequested mediaCol;
DOMString mediaSource;
WebPrintingMultipleDocumentHandling multipleDocumentHandling;
WebPrintingOrientationRequested orientationRequested;
WebPrintingResolution printerResolution;
@@ -59,6 +60,9 @@ dictionary WebPrinterAttributes {
WebPrintingMediaCollection mediaColDefault;
sequence<WebPrintingMediaCollection> mediaColDatabase;
DOMString mediaSourceDefault;
sequence<DOMString> mediaSourceSupported;
WebPrintingMimeMediaType documentFormatDefault;
sequence<WebPrintingMimeMediaType> documentFormatSupported;
@@ -5,4 +5,5 @@
dictionary PrivateAggregationHistogramContribution {
required bigint bucket;
required long value;
[RuntimeEnabled=PrivateAggregationApiFilteringIds] bigint filteringId;
};
@@ -1,4 +1,6 @@
dictionary SharedStoragePrivateAggregationConfig {
USVString aggregationCoordinatorOrigin;
USVString contextId;
[EnforceRange, RuntimeEnabled=PrivateAggregationApiFilteringIds]
unsigned long long filteringIdMaxBytes;
};
@@ -2,10 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
ImplementedAs=DocumentStorageAccess,
RuntimeEnabled=StorageAccessAPIBeyondCookies
] partial interface Document {
[ImplementedAs=DocumentStorageAccess]
partial interface Document {
[
CallWith=ScriptState,
NewObject,
MeasureAs=StorageAccessAPI_HasStorageAccess_Method
] Promise<boolean> hasStorageAccess();
[
CallWith=ScriptState,
NewObject,
MeasureAs=StorageAccessAPI_requestStorageAccess_Method
] Promise<undefined> requestStorageAccess();
[
CallWith=ScriptState,
NewObject,
@@ -16,4 +24,9 @@
NewObject,
MeasureAs=StorageAccessAPI_hasUnpartitionedCookieAccess
] Promise<boolean> hasUnpartitionedCookieAccess();
[
CallWith=ScriptState,
NewObject,
MeasureAs=StorageAccessAPI_requestStorageAccessFor_Method
] Promise<undefined> requestStorageAccessFor(USVString requestedOrigin);
};
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[RuntimeEnabled=StorageAccessAPIBeyondCookies]
interface StorageAccessHandle {
[LogActivity=GetterOnly, RaisesException=Getter] readonly attribute Storage sessionStorage;
[LogActivity=GetterOnly, RaisesException=Getter] readonly attribute Storage localStorage;

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