[AUTO][FILECONTROL] - version 125.0.6422.60

This commit is contained in:
uazo
2024-05-16 02:42:03 +00:00
committed by GitHub
parent 5e764c70a2
commit 6e898120cd
120 changed files with 4103 additions and 1903 deletions
+1 -1
View File
@@ -1 +1 @@
124.0.6367.159
125.0.6422.60
@@ -73,10 +73,11 @@
#include "components/policy/content/policy_blocklist_navigation_throttle.h"
#include "components/policy/core/browser/browser_policy_connector_base.h"
#include "components/prefs/pref_service.h"
#include "components/safe_browsing/content/browser/async_check_tracker.h"
#include "components/safe_browsing/content/browser/browser_url_loader_throttle.h"
#include "components/safe_browsing/content/browser/mojo_safe_browsing_impl.h"
#include "components/safe_browsing/core/browser/hashprefix_realtime/hash_realtime_utils.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.h"
#include "components/url_matcher/url_matcher.h"
#include "components/url_matcher/url_util.h"
#include "components/version_info/version_info.h"
@@ -129,9 +130,10 @@
using content::BrowserThread;
using content::WebContents;
using safe_browsing::AsyncCheckTracker;
using safe_browsing::hash_realtime_utils::HashRealTimeSelection;
using AttributionReportType =
content::ContentBrowserClient::AttributionReportingOsReportType;
using AttributionReportingOsRegistrar =
content::ContentBrowserClient::AttributionReportingOsRegistrar;
namespace android_webview {
namespace {
@@ -147,6 +149,57 @@ bool g_created_network_context_params = false;
// On apps targeting API level O or later, check cleartext is enforced.
bool g_check_cleartext_permitted = false;
BASE_FEATURE(kWebViewOptimizeXrwNavigationFlow,
"WebViewOptimizeXrwNavigationFlow",
base::FEATURE_DISABLED_BY_DEFAULT);
// A throttle which checks if the XRW origin trial is enabled for this
// navigation, and forwards it to the proxying loader factory.
class XrwNavigationThrottle : public content::NavigationThrottle {
public:
explicit XrwNavigationThrottle(content::NavigationHandle* handle)
: NavigationThrottle(handle) {}
~XrwNavigationThrottle() override {
AwProxyingURLLoaderFactory::ClearXrwResultForNavigation(
navigation_handle()->GetNavigationId());
}
ThrottleCheckResult WillStartRequest() override {
auto* handle = navigation_handle();
AwProxyingURLLoaderFactory::SetXrwResultForNavigation(
handle->GetURL(),
handle->IsInOutermostMainFrame()
? blink::mojom::ResourceType::kMainFrame
: blink::mojom::ResourceType::kSubFrame,
handle->GetFrameTreeNodeId(), handle->GetNavigationId());
return content::NavigationThrottle::PROCEED;
}
const char* GetNameForLogging() override { return "XrwNavigationThrottle"; }
};
// Get async check tracker to make Safe Browsing v5 check asynchronous
base::WeakPtr<AsyncCheckTracker> GetAsyncCheckTracker(
const base::RepeatingCallback<content::WebContents*()>& wc_getter,
int frame_tree_node_id) {
if (!base::FeatureList::IsEnabled(
safe_browsing::kSafeBrowsingAsyncRealTimeCheck)) {
return nullptr;
}
content::WebContents* web_contents = wc_getter.Run();
// Check whether current frame is a pre-rendered frame. WebView does not
// support NoStatePrefetch, so we do not check for that.
if (web_contents == nullptr ||
web_contents->IsPrerenderedFrame(frame_tree_node_id)) {
return nullptr;
}
return AsyncCheckTracker::GetOrCreateForWebContents(
web_contents,
AwBrowserProcess::GetInstance()->GetSafeBrowsingUIManager())
->GetWeakPtr();
}
} // anonymous namespace
std::string GetProduct() {
@@ -223,6 +276,12 @@ void AwContentBrowserClient::OnNetworkServiceCreated(
network::mojom::HttpAuthStaticParams::New());
content::GetNetworkService()->ConfigureHttpAuthPrefs(
AwBrowserProcess::GetInstance()->CreateHttpAuthDynamicParams());
if (base::FeatureList::IsEnabled(features::kWebViewAsyncDns)) {
content::GetNetworkService()->ConfigureStubHostResolver(
/*insecure_dns_client_enabled=*/true, net::SecureDnsMode::kAutomatic,
net::DnsOverHttpsConfig(),
/*additional_dns_types_enabled=*/true);
}
}
void AwContentBrowserClient::ConfigureNetworkContextParams(
@@ -494,8 +553,9 @@ bool AwContentBrowserClient::IsPepperVpnProviderAPIAllowed(
return false;
}
content::TracingDelegate* AwContentBrowserClient::GetTracingDelegate() {
return new AwTracingDelegate();
std::unique_ptr<content::TracingDelegate>
AwContentBrowserClient::CreateTracingDelegate() {
return std::make_unique<AwTracingDelegate>();
}
void AwContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
@@ -577,6 +637,10 @@ AwContentBrowserClient::CreateThrottlesForNavigation(
if (safe_browsing_throttle) {
throttles.push_back(std::move(safe_browsing_throttle));
}
if (base::FeatureList::IsEnabled(kWebViewOptimizeXrwNavigationFlow)) {
throttles.push_back(
std::make_unique<XrwNavigationThrottle>(navigation_handle));
}
return throttles;
}
@@ -596,10 +660,16 @@ AwContentBrowserClient::CreateURLLoaderThrottles(
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Set lookup mechanism based on feature flag
HashRealTimeSelection hash_real_time_selection =
(base::FeatureList::IsEnabled(safe_browsing::kHashPrefixRealTimeLookups))
? HashRealTimeSelection::kDatabaseManager
: HashRealTimeSelection::kNone;
HashRealTimeSelection hash_real_time_selection;
base::WeakPtr<AsyncCheckTracker> async_check_tracker;
if (base::FeatureList::IsEnabled(safe_browsing::kHashPrefixRealTimeLookups)) {
hash_real_time_selection = HashRealTimeSelection::kDatabaseManager;
async_check_tracker = GetAsyncCheckTracker(wc_getter, frame_tree_node_id);
} else {
hash_real_time_selection = HashRealTimeSelection::kNone;
async_check_tracker = nullptr;
}
std::vector<std::unique_ptr<blink::URLLoaderThrottle>> result;
result.push_back(safe_browsing::BrowserURLLoaderThrottle::Create(
base::BindRepeating(
@@ -615,9 +685,7 @@ AwContentBrowserClient::CreateURLLoaderThrottles(
/* hash_realtime_service */ nullptr,
/* hash_realtime_selection */
hash_real_time_selection,
// TODO(crbug.com/1501194): pass in async_check_tracker to support async
// check on WV.
/* async_check_tracker */ nullptr));
/* async_check_tracker */ async_check_tracker));
if (request.destination == network::mojom::RequestDestination::kDocument) {
const bool is_load_url =
@@ -836,7 +904,8 @@ bool AwContentBrowserClient::HandleExternalProtocol(
new android_webview::AwProxyingURLLoaderFactory(
frame_tree_node_id, std::move(receiver), mojo::NullRemote(),
true /* intercept_only */, std::nullopt /* security_options */,
nullptr /* xrw_allowlist_matcher */, std::move(browser_context_handle));
nullptr /* xrw_allowlist_matcher */, std::move(browser_context_handle),
std::nullopt /* navigation_id */);
} else {
content::GetIOThreadTaskRunner({})->PostTask(
FROM_HERE,
@@ -851,7 +920,8 @@ bool AwContentBrowserClient::HandleExternalProtocol(
true /* intercept_only */,
std::nullopt /* security_options */,
nullptr /* xrw_allowlist_matcher */,
std::move(browser_context_handle));
std::move(browser_context_handle),
std::nullopt /* navigation_id */);
},
std::move(receiver), frame_tree_node_id,
std::move(browser_context_handle)));
@@ -945,6 +1015,7 @@ void AwContentBrowserClient::WillCreateURLLoaderFactory(
int render_process_id,
URLLoaderFactoryType type,
const url::Origin& request_initiator,
const net::IsolationInfo& isolation_info,
std::optional<int64_t> navigation_id,
ukm::SourceIdObj ukm_source_id,
network::URLLoaderFactoryBuilder& factory_builder,
@@ -1014,7 +1085,7 @@ void AwContentBrowserClient::WillCreateURLLoaderFactory(
frame->GetFrameTreeNodeId(), std::move(proxied_receiver),
std::move(target_factory_remote), security_options,
std::move(xrw_allowlist_matcher),
std::move(browser_context_handle)));
std::move(browser_context_handle), navigation_id));
} else {
// A service worker and worker subresources set nullptr to |frame|, and
// work without seeing the AllowUniversalAccessFromFileURLs setting. So,
@@ -1029,7 +1100,7 @@ void AwContentBrowserClient::WillCreateURLLoaderFactory(
std::move(proxied_receiver), std::move(target_factory_remote),
std::nullopt /* security_options */,
aw_browser_context->service_worker_xrw_allowlist_matcher(),
std::move(browser_context_handle)));
std::move(browser_context_handle), navigation_id));
}
}
@@ -1235,8 +1306,8 @@ bool AwContentBrowserClient::IsAttributionReportingOperationAllowed(
NOTREACHED_NORETURN();
}
content::ContentBrowserClient::AttributionReportingOsReportTypes
AwContentBrowserClient::GetAttributionReportingOsReportTypes(
content::ContentBrowserClient::AttributionReportingOsRegistrars
AwContentBrowserClient::GetAttributionReportingOsRegistrars(
content::WebContents* web_contents) {
// Attribution reporting can register a source to either the top level origin
// or the app. For WebView the default is to register sources against the app
@@ -1258,7 +1329,8 @@ AwContentBrowserClient::GetAttributionReportingOsReportTypes(
AwSettings* aw_settings = AwSettings::FromWebContents(web_contents);
if (!aw_settings) {
return {AttributionReportType::kDisabled, AttributionReportType::kDisabled};
return {AttributionReportingOsRegistrar::kDisabled,
AttributionReportingOsRegistrar::kDisabled};
}
AwSettings::AttributionBehavior attribution_behavior =
@@ -1266,14 +1338,17 @@ AwContentBrowserClient::GetAttributionReportingOsReportTypes(
switch (attribution_behavior) {
case AwSettings::AttributionBehavior::WEB_SOURCE_AND_WEB_TRIGGER:
return {AttributionReportType::kWeb, AttributionReportType::kWeb};
return {AttributionReportingOsRegistrar::kWeb,
AttributionReportingOsRegistrar::kWeb};
case AwSettings::AttributionBehavior::APP_SOURCE_AND_WEB_TRIGGER:
return {AttributionReportType::kOs, AttributionReportType::kWeb};
return {AttributionReportingOsRegistrar::kOs,
AttributionReportingOsRegistrar::kWeb};
case AwSettings::AttributionBehavior::APP_SOURCE_AND_APP_TRIGGER:
return {AttributionReportType::kOs, AttributionReportType::kOs};
return {AttributionReportingOsRegistrar::kOs,
AttributionReportingOsRegistrar::kOs};
case AwSettings::AttributionBehavior::DISABLED:
return {AttributionReportType::kDisabled,
AttributionReportType::kDisabled};
return {AttributionReportingOsRegistrar::kDisabled,
AttributionReportingOsRegistrar::kDisabled};
}
NOTREACHED_NORETURN();
@@ -117,6 +117,9 @@ by a child template that "extends" this file.
<!-- Feature declarations required to support conditional install for VR DFM -->
<uses-feature android:name="android.hardware.sensor.gyroscope" android:required="false"/>
<uses-feature android:name="android.hardware.sensor.accelerometer" android:required="false"/>
<uses-permission-sdk-23 android:name="android.permission.SCENE_UNDERSTANDING" />
<uses-permission-sdk-23 android:name="android.permission.HAND_TRACKING" />
{% endif %}
<permission android:name="{{ manifest_package }}.permission.CHILD_SERVICE" android:protectionLevel="signature" />
@@ -1095,6 +1098,8 @@ by a child template that "extends" this file.
</intent-filter>
</service>
<receiver android:name="org.chromium.chrome.browser.data_sharing.DataSharingNotificationManager$Receiver"
android:exported="false" />
<receiver android:name="org.chromium.chrome.browser.announcement.AnnouncementNotificationManager$Receiver"
android:exported="false"/>
@@ -1140,10 +1145,6 @@ by a child template that "extends" this file.
<receiver android:name="org.chromium.chrome.browser.sharing.click_to_call.ClickToCallMessageHandler$TapReceiver"
android:exported="false"/>
<receiver android:name="org.chromium.chrome.browser.sharing.shared_clipboard.SharedClipboardMessageHandler$TapReceiver"
android:exported="false"/>
<receiver android:name="org.chromium.chrome.browser.sharing.shared_clipboard.SharedClipboardMessageHandler$TryAgainReceiver"
android:exported="false"/>
<receiver android:name="org.chromium.chrome.browser.sharing.sms_fetcher.SmsFetcherMessageHandler$NotificationReceiver"
android:exported="false"/>
@@ -76,6 +76,7 @@
#include "chrome/browser/spellchecker/spellcheck_factory.h"
#include "chrome/browser/spellchecker/spellcheck_service.h"
#include "chrome/browser/sync/sync_service_factory.h"
#include "chrome/browser/tpcd/metadata/manager_factory.h"
#include "chrome/browser/translate/chrome_translate_client.h"
#include "chrome/browser/ui/find_bar/find_bar_state.h"
#include "chrome/browser/ui/find_bar/find_bar_state_factory.h"
@@ -125,6 +126,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/web_cache/browser/web_cache_manager.h"
#include "components/webrtc_logging/browser/log_cleanup.h"
#include "components/webrtc_logging/browser/text_log_list.h"
@@ -649,7 +651,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
website_settings_filter,
host_content_settings_map_);
if (!filter_builder->IsCrossSiteClearSiteDataForCookies()) {
if (!filter_builder->PartitionedCookiesOnly()) {
browsing_data::RemoveEmbedderCookieData(
delete_begin, delete_end, filter_builder, host_content_settings_map_,
safe_browsing_context,
@@ -664,8 +666,14 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
BrowsingDataFilterBuilder::Mode::kPreserve) {
auto* privacy_sandbox_settings =
PrivacySandboxSettingsFactory::GetForProfile(profile_);
if (privacy_sandbox_settings)
if (privacy_sandbox_settings) {
privacy_sandbox_settings->OnCookiesCleared();
}
if (tpcd::metadata::Manager* manager =
tpcd::metadata::ManagerFactory::GetForProfile(profile_)) {
manager->ResetCohorts();
}
#if BUILDFLAG(IS_ANDROID)
Java_PackageHash_onCookiesDeleted(
@@ -676,7 +684,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
#if !BUILDFLAG(IS_ANDROID)
if (nullable_filter.is_null() ||
(!filter_builder->IsCrossSiteClearSiteDataForCookies() &&
(!filter_builder->PartitionedCookiesOnly() &&
nullable_filter.Run(GaiaUrls::GetInstance()->google_url()))) {
// Set a flag to clear account storage settings later instead of clearing
// it now as we can not reset this setting before passwords are deleted.
@@ -859,6 +867,10 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
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);
host_content_settings_map_->ClearSettingsForOneTypeWithPredicate(
ContentSettingsType::PRIVATE_NETWORK_GUARD, delete_begin_, delete_end_,
website_settings_filter);
@@ -879,7 +891,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
// DATA_TYPE_COOKIES.
DIPSEventRemovalType dips_mask = DIPSEventRemovalType::kNone;
if ((remove_mask & content::BrowsingDataRemover::DATA_TYPE_COOKIES) &&
!filter_builder->IsCrossSiteClearSiteDataForCookies()) {
!filter_builder->PartitionedCookiesOnly()) {
dips_mask |= DIPSEventRemovalType::kStorage;
}
if (remove_mask & constants::DATA_TYPE_HISTORY) {
@@ -984,7 +996,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
CHECK(deferred_disable_passwords_auto_signin_cb_.is_null(),
base::NotFatalUntil::M125);
if ((remove_mask & content::BrowsingDataRemover::DATA_TYPE_COOKIES) &&
!filter_builder->IsCrossSiteClearSiteDataForCookies()) {
!filter_builder->PartitionedCookiesOnly()) {
// Unretained() is safe, this is only executed in OnTasksComplete() if the
// object is still alive. Also, see the field docs for motivation.
deferred_disable_passwords_auto_signin_cb_ = base::BindOnce(
@@ -1194,7 +1206,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
// results only when their respective URLs are in the filter.
if ((remove_mask & (content::BrowsingDataRemover::DATA_TYPE_CACHE |
content::BrowsingDataRemover::DATA_TYPE_COOKIES)) &&
!filter_builder->IsCrossSiteClearSiteDataForCookies()) {
!filter_builder->PartitionedCookiesOnly()) {
// If there is no template service or DSE, clear the caches.
bool should_clear_zero_suggest_and_session_token = true;
bool should_clear_search_prefetch = true;
@@ -37,7 +37,6 @@
#include "chrome/browser/ui/search_engines/search_engine_tab_helper.h"
#include "chrome/browser/ui/side_panel/companion/companion_utils.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/ui/web_applications/draggable_region_host_impl.h"
#include "chrome/browser/ui/webui/browsing_topics/browsing_topics_internals_ui.h"
#include "chrome/browser/ui/webui/engagement/site_engagement_ui.h"
#include "chrome/browser/ui/webui/internals/internals_ui.h"
@@ -53,6 +52,7 @@
#include "chrome/browser/ui/webui/usb_internals/usb_internals.mojom.h"
#include "chrome/browser/ui/webui/usb_internals/usb_internals_ui.h"
#include "chrome/browser/web_applications/web_app_utils.h"
#include "chrome/common/buildflags.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/webui_url_constants.h"
@@ -83,7 +83,7 @@
#include "components/privacy_sandbox/privacy_sandbox_features.h"
#include "components/reading_list/features/reading_list_switches.h"
#include "components/safe_browsing/buildflags.h"
#include "components/search_engines/search_engine_choice_utils.h"
#include "components/search_engines/search_engine_choice/search_engine_choice_utils.h"
#include "components/security_state/content/content_utils.h"
#include "components/security_state/core/security_state.h"
#include "components/signin/public/identity_manager/identity_manager.h"
@@ -153,12 +153,13 @@
#else
#include "chrome/browser/badging/badge_manager.h"
#include "chrome/browser/cart/chrome_cart.mojom.h"
#include "chrome/browser/new_tab_page/modules/drive/drive.mojom.h"
#include "chrome/browser/new_tab_page/modules/feed/feed.mojom.h"
#include "chrome/browser/new_tab_page/modules/file_suggestion/file_suggestion.mojom.h"
#include "chrome/browser/new_tab_page/modules/history_clusters/history_clusters.mojom.h"
#include "chrome/browser/new_tab_page/modules/photos/photos.mojom.h"
#include "chrome/browser/new_tab_page/modules/recipes/recipes.mojom.h"
#include "chrome/browser/new_tab_page/modules/v2/history_clusters/history_clusters_v2.mojom.h"
#include "chrome/browser/new_tab_page/modules/v2/most_relevant_tab_resumption/most_relevant_tab_resumption.mojom.h"
#include "chrome/browser/new_tab_page/modules/v2/tab_resumption/tab_resumption.mojom.h"
#include "chrome/browser/new_tab_page/new_tab_page_util.h"
#include "chrome/browser/payments/payment_request_factory.h"
@@ -171,7 +172,6 @@
#include "chrome/browser/ui/webui/on_device_internals/on_device_internals_ui.h"
#include "chrome/browser/ui/webui/web_app_internals/web_app_internals.mojom.h"
#include "chrome/browser/ui/webui/web_app_internals/web_app_internals_ui.h"
#include "components/omnibox/browser/omnibox.mojom.h"
#if !defined(OFFICIAL_BUILD)
#include "chrome/browser/ui/webui/new_tab_page/foo/foo.mojom.h" // nogncheck crbug.com/1125897
#endif
@@ -182,6 +182,7 @@
#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"
@@ -218,6 +219,7 @@
#include "ui/webui/resources/cr_components/history_clusters/history_clusters.mojom.h"
#include "ui/webui/resources/cr_components/history_embeddings/history_embeddings.mojom.h"
#include "ui/webui/resources/cr_components/most_visited/most_visited.mojom.h"
#include "ui/webui/resources/cr_components/searchbox/searchbox.mojom.h"
#include "ui/webui/resources/cr_components/theme_color_picker/theme_color_picker.mojom.h"
#include "ui/webui/resources/js/browser_command/browser_command.mojom.h"
#include "ui/webui/resources/js/metrics_reporter/metrics_reporter.mojom.h"
@@ -246,6 +248,11 @@
#include "ui/webui/resources/cr_components/customize_themes/customize_themes.mojom.h"
#endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
#include "ash/webui/conch/conch_ui.h"
#include "ash/webui/conch/mojom/conch.mojom.h"
#endif // BUILDFLAG(IS_CHROMEOS_ASH) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/constants/ash_features.h"
#include "ash/public/mojom/hid_preserving_bluetooth_state_controller.mojom.h"
@@ -253,6 +260,7 @@
#include "ash/webui/camera_app_ui/camera_app_ui.h"
#include "ash/webui/color_internals/color_internals_ui.h"
#include "ash/webui/color_internals/mojom/color_internals.mojom.h"
#include "ash/webui/common/mojom/accelerator_fetcher.mojom.h"
#include "ash/webui/common/mojom/accessibility_features.mojom.h"
#include "ash/webui/common/mojom/sea_pen.mojom.h"
#include "ash/webui/common/mojom/shortcut_input_provider.mojom.h"
@@ -306,6 +314,7 @@
#include "chrome/browser/ui/webui/ash/add_supervision/add_supervision.mojom.h"
#include "chrome/browser/ui/webui/ash/add_supervision/add_supervision_ui.h"
#include "chrome/browser/ui/webui/ash/app_install/app_install.mojom.h"
#include "chrome/browser/ui/webui/ash/app_install/app_install_dialog.h"
#include "chrome/browser/ui/webui/ash/app_install/app_install_ui.h"
#include "chrome/browser/ui/webui/ash/audio/audio.mojom.h"
#include "chrome/browser/ui/webui/ash/audio/audio_ui.h"
@@ -326,11 +335,14 @@
#include "chrome/browser/ui/webui/ash/emoji/seal.mojom.h"
#include "chrome/browser/ui/webui/ash/enterprise_reporting/enterprise_reporting.mojom.h"
#include "chrome/browser/ui/webui/ash/enterprise_reporting/enterprise_reporting_ui.h"
#include "chrome/browser/ui/webui/ash/extended_updates/extended_updates.mojom.h"
#include "chrome/browser/ui/webui/ash/extended_updates/extended_updates_ui.h"
#include "chrome/browser/ui/webui/ash/internet_config_dialog.h"
#include "chrome/browser/ui/webui/ash/internet_detail_dialog.h"
#include "chrome/browser/ui/webui/ash/launcher_internals/launcher_internals.mojom.h"
#include "chrome/browser/ui/webui/ash/launcher_internals/launcher_internals_ui.h"
#include "chrome/browser/ui/webui/ash/lock_screen_reauth/lock_screen_network_ui.h"
#include "chrome/browser/ui/webui/ash/login/mojom/screens_factory.mojom.h"
#include "chrome/browser/ui/webui/ash/login/oobe_ui.h"
#include "chrome/browser/ui/webui/ash/mako/mako_ui.h"
#include "chrome/browser/ui/webui/ash/manage_mirrorsync/manage_mirrorsync.mojom.h"
@@ -465,6 +477,10 @@
#include "chrome/browser/ui/webui/dlp_internals/dlp_internals_ui.h"
#endif
#if BUILDFLAG(CHROME_ROOT_STORE_CERT_MANAGEMENT_UI)
#include "ui/webui/resources/cr_components/certificate_manager/certificate_manager_v2.mojom.h"
#endif // BUILDFLAG(CHROME_ROOT_STORE_CERT_MANAGEMENT_UI)
namespace chrome::internal {
using content::RegisterWebUIControllerInterfaceBinder;
@@ -1029,14 +1045,6 @@ void PopulateChromeFrameBinders(
#endif
#endif // BUILDFLAG(ENABLE_SPEECH_SERVICE)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_CHROMEOS)
if (!render_frame_host->GetParent()) {
map->Add<chrome::mojom::DraggableRegions>(
base::BindRepeating(&DraggableRegionsHostImpl::CreateIfAllowed));
}
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_CHROMEOS)
if (base::FeatureList::IsEnabled(blink::features::kDesktopPWAsSubApps) &&
@@ -1076,11 +1084,6 @@ void PopulateChromeFrameBinders(
map->Add<blink::mojom::WebPrintingService>(
base::BindRepeating(&printing::CreateWebPrintingServiceForFrame));
#endif
if (base::FeatureList::IsEnabled(blink::features::kEnableModelExecutionAPI)) {
map->Add<blink::mojom::ModelManager>(
base::BindRepeating(&ModelManagerImpl::Create));
}
}
void PopulateChromeWebUIFrameBinders(
@@ -1160,6 +1163,8 @@ void PopulateChromeWebUIFrameBinders(
if (lens::features::IsLensOverlayEnabled()) {
RegisterWebUIControllerInterfaceBinder<lens::mojom::LensPageHandlerFactory,
lens::LensUntrustedUI>(map);
RegisterWebUIControllerInterfaceBinder<
lens::mojom::SearchBubblePageHandlerFactory, lens::SearchBubbleUI>(map);
}
RegisterWebUIControllerInterfaceBinder<
@@ -1221,7 +1226,7 @@ void PopulateChromeWebUIFrameBinders(
browser_command::mojom::CommandHandlerFactory, NewTabPageUI, WhatsNewUI>(
map);
RegisterWebUIControllerInterfaceBinder<omnibox::mojom::PageHandler,
RegisterWebUIControllerInterfaceBinder<searchbox::mojom::PageHandler,
NewTabPageUI, OmniboxPopupUI>(map);
RegisterWebUIControllerInterfaceBinder<suggest_internals::mojom::PageHandler,
@@ -1249,6 +1254,12 @@ void PopulateChromeWebUIFrameBinders(
#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
>(map);
#if BUILDFLAG(CHROME_ROOT_STORE_CERT_MANAGEMENT_UI)
RegisterWebUIControllerInterfaceBinder<
certificate_manager_v2::mojom::CertificateManagerPageHandlerFactory,
settings::SettingsUI>(map);
#endif // BUILDFLAG(CHROME_ROOT_STORE_CERT_MANAGEMENT_UI)
RegisterWebUIControllerInterfaceBinder<
help_bubble::mojom::HelpBubbleHandlerFactory, InternalsUI,
settings::SettingsUI, ReadingListUI, NewTabPageUI, CustomizeChromeUI,
@@ -1269,8 +1280,8 @@ void PopulateChromeWebUIFrameBinders(
}
if (IsDriveModuleEnabled()) {
RegisterWebUIControllerInterfaceBinder<drive::mojom::DriveHandler,
NewTabPageUI>(map);
RegisterWebUIControllerInterfaceBinder<
file_suggestion::mojom::FileSuggestionHandler, NewTabPageUI>(map);
}
if (base::FeatureList::IsEnabled(ntp_features::kNtpPhotosModule)) {
@@ -1305,6 +1316,13 @@ void PopulateChromeWebUIFrameBinders(
ntp::tab_resumption::mojom::PageHandler, NewTabPageUI>(map);
}
if (base::FeatureList::IsEnabled(
ntp_features::kNtpMostRelevantTabResumptionModule)) {
RegisterWebUIControllerInterfaceBinder<
ntp::most_relevant_tab_resumption::mojom::PageHandler, NewTabPageUI>(
map);
}
#if BUILDFLAG(IS_CHROMEOS_ASH)
if (ash::features::IsBluetoothDisconnectWarningEnabled()) {
RegisterWebUIControllerInterfaceBinder<
@@ -1422,6 +1440,12 @@ void PopulateChromeWebUIFrameBinders(
ash::settings::mojom::DisplaySettingsProvider,
ash::settings::OSSettingsUI>(map);
if (::features::IsShortcutCustomizationEnabled()) {
RegisterWebUIControllerInterfaceBinder<
ash::common::mojom::AcceleratorFetcher, ash::settings::OSSettingsUI>(
map);
}
RegisterWebUIControllerInterfaceBinder<
ash::common::mojom::ShortcutInputProvider, ash::settings::OSSettingsUI,
ash::ShortcutCustomizationAppUI>(map);
@@ -1655,6 +1679,10 @@ void PopulateChromeWebUIFrameBinders(
RegisterWebUIControllerInterfaceBinder<audio::mojom::PageHandlerFactory,
ash::AudioUI>(map);
RegisterWebUIControllerInterfaceBinder<
ash::extended_updates::mojom::PageHandlerFactory,
ash::extended_updates::ExtendedUpdatesUI>(map);
RegisterWebUIControllerInterfaceBinder<
ash::firmware_update::mojom::UpdateProvider, ash::FirmwareUpdateAppUI>(
map);
@@ -1688,10 +1716,10 @@ void PopulateChromeWebUIFrameBinders(
ash::settings::google_drive::mojom::PageHandlerFactory,
ash::settings::OSSettingsUI>(map);
if (base::FeatureList::IsEnabled(
chromeos::features::kCrosWebAppInstallDialog) ||
base::FeatureList::IsEnabled(
chromeos::features::kCrosOmniboxInstallDialog)) {
RegisterWebUIControllerInterfaceBinder<
ash::screens_factory::mojom::ScreensFactory, ash::OobeUI>(map);
if (ash::app_install::AppInstallDialog::IsEnabled()) {
RegisterWebUIControllerInterfaceBinder<
ash::app_install::mojom::PageHandlerFactory,
ash::app_install::AppInstallDialogUI>(map);
@@ -1792,6 +1820,12 @@ void PopulateChromeWebUIFrameInterfaceBrokers(
.Add<ash::mojom::status_area_internals::PageHandler>();
#endif // BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OFFICIAL_BUILD)
#if BUILDFLAG(IS_CHROMEOS_ASH) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
registry.ForWebUI<ash::ConchUI>()
.Add<ash::conch::mojom::PageHandler>()
.Add<color_change_listener::mojom::PageHandler>();
#endif // BUILDFLAG(IS_CHROMEOS_ASH) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
#if BUILDFLAG(IS_CHROMEOS_ASH)
registry.ForWebUI<ash::CameraAppUI>()
.Add<color_change_listener::mojom::PageHandler>()
@@ -1854,7 +1888,9 @@ void PopulateChromeWebUIFrameInterfaceBrokers(
#if !BUILDFLAG(IS_ANDROID)
if (lens::features::IsLensOverlayEnabled()) {
registry.ForWebUI<lens::LensUntrustedUI>()
.Add<lens::mojom::LensPageHandlerFactory>();
.Add<lens::mojom::LensPageHandlerFactory>()
.Add<searchbox::mojom::PageHandler>()
.Add<color_change_listener::mojom::PageHandler>();
}
if (companion::IsCompanionFeatureEnabled()) {
registry.ForWebUI<CompanionSidePanelUntrustedUI>()
@@ -82,6 +82,7 @@
#include "chrome/browser/font_family_cache.h"
#include "chrome/browser/gpu/chrome_browser_main_extra_parts_gpu.h"
#include "chrome/browser/hid/chrome_hid_delegate.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/interstitials/enterprise_util.h"
#include "chrome/browser/lifetime/browser_shutdown.h"
#include "chrome/browser/lookalikes/lookalike_url_navigation_throttle.h"
@@ -97,6 +98,7 @@
#include "chrome/browser/memory/chrome_browser_main_extra_parts_memory.h"
#include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h"
#include "chrome/browser/metrics/chrome_feature_list_creator.h"
#include "chrome/browser/model_execution/model_manager_impl.h"
#include "chrome/browser/navigation_predictor/anchor_element_preloader.h"
#include "chrome/browser/net/chrome_network_delegate.h"
#include "chrome/browser/net/profile_network_context_service.h"
@@ -160,6 +162,8 @@
#include "chrome/browser/ssl/security_state_tab_helper.h"
#include "chrome/browser/ssl/ssl_client_certificate_selector.h"
#include "chrome/browser/ssl/typed_navigation_upgrade_throttle.h"
#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/tracing/chrome_tracing_delegate.h"
#include "chrome/browser/translate/translate_service.h"
@@ -198,9 +202,9 @@
#include "chrome/common/env_vars.h"
#include "chrome/common/google_url_loader_throttle.h"
#include "chrome/common/logging_chrome.h"
#include "chrome/common/pdf_util.h"
#include "chrome/common/ppapi_utils.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/profiler/process_type.h"
#include "chrome/common/profiler/thread_profiler_configuration.h"
#include "chrome/common/renderer_configuration.mojom.h"
#include "chrome/common/secure_origin_allowlist.h"
@@ -236,6 +240,8 @@
#include "components/error_page/common/localized_error.h"
#include "components/error_page/content/browser/net_error_auto_reloader.h"
#include "components/google/core/common/google_switches.h"
#include "components/heap_profiling/in_process/heap_profiler_controller.h"
#include "components/history/content/browser/visited_link_navigation_throttle.h"
#include "components/keep_alive_registry/keep_alive_types.h"
#include "components/keep_alive_registry/scoped_keep_alive.h"
#include "components/language/core/browser/pref_names.h"
@@ -258,6 +264,7 @@
#include "components/payments/content/payment_credential_factory.h"
#include "components/payments/content/payment_handler_navigation_throttle.h"
#include "components/payments/content/payment_request_display_manager.h"
#include "components/pdf/common/pdf_util.h"
#include "components/performance_manager/embedder/performance_manager_registry.h"
#include "components/permissions/bluetooth_delegate_impl.h"
#include "components/permissions/permission_context_base.h"
@@ -280,22 +287,20 @@
#include "components/safe_browsing/content/browser/safe_browsing_navigation_throttle.h"
#include "components/safe_browsing/content/browser/ui_manager.h"
#include "components/safe_browsing/core/browser/hashprefix_realtime/hash_realtime_service.h"
#include "components/safe_browsing/core/browser/hashprefix_realtime/hash_realtime_utils.h"
#include "components/safe_browsing/core/browser/realtime/policy_engine.h"
#include "components/safe_browsing/core/browser/realtime/url_lookup_service.h"
#include "components/safe_browsing/core/browser/url_checker_delegate.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/hashprefix_realtime/hash_realtime_utils.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
#include "components/security_interstitials/content/insecure_form_navigation_throttle.h"
#include "components/security_interstitials/content/ssl_error_handler.h"
#include "components/security_interstitials/content/ssl_error_navigation_throttle.h"
#include "components/security_state/core/security_state.h"
#include "components/services/storage/public/cpp/storage_prefs.h"
#include "components/site_isolation/pref_names.h"
#include "components/site_isolation/preloaded_isolated_origins.h"
#include "components/site_isolation/site_isolation_policy.h"
#include "components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.h"
#include "components/supervised_user/core/common/buildflags.h"
#include "components/translate/core/common/translate_switches.h"
#include "components/user_prefs/user_prefs.h"
#include "components/variations/variations_associated_data.h"
@@ -315,6 +320,7 @@
#include "content/public/browser/child_process_data.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/client_certificate_delegate.h"
#include "content/public/browser/digital_identity_provider.h"
#include "content/public/browser/file_url_loader.h"
#include "content/public/browser/isolated_web_apps_policy.h"
#include "content/public/browser/legacy_tech_cookie_issue_details.h"
@@ -371,6 +377,7 @@
#include "services/network/public/cpp/web_sandbox_flags.h"
#include "services/network/public/mojom/network_service.mojom.h"
#include "services/network/public/mojom/web_transport.mojom.h"
#include "services/video_effects/public/mojom/video_effects_processor.mojom-forward.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/loader/url_loader_throttle.h"
#include "third_party/blink/public/common/navigation/navigation_policy.h"
@@ -440,7 +447,6 @@
#include "chrome/browser/ash/net/network_health/network_health_manager.h"
#include "chrome/browser/ash/net/system_proxy_manager.h"
#include "chrome/browser/ash/profiles/profile_helper.h"
#include "chrome/browser/ash/settings/cros_settings.h"
#include "chrome/browser/ash/smb_client/fileapi/smbfs_file_system_backend_delegate.h"
#include "chrome/browser/ash/system/input_device_settings.h"
#include "chrome/browser/ash/url_handler.h"
@@ -453,6 +459,7 @@
#include "chrome/browser/ui/webui/ash/kerberos/kerberos_in_browser_dialog.h"
#include "chrome/common/webui_url_constants.h"
#include "chromeos/ash/components/browser_context_helper/browser_context_types.h"
#include "chromeos/ash/components/settings/cros_settings.h"
#include "chromeos/ash/services/network_health/public/cpp/network_health_helper.h"
#include "components/user_manager/user.h"
#include "components/user_manager/user_manager.h"
@@ -479,6 +486,7 @@
#include "chrome/browser/download/android/intercept_oma_download_navigation_throttle.h"
#include "chrome/browser/flags/android/chrome_feature_list.h"
#include "chrome/browser/ui/android/tab_model/tab_model_list.h"
#include "chrome/browser/ui/webid/digital_identity_safety_interstitial_bridge_android.h"
#include "chrome/common/chrome_descriptors.h"
#include "components/browser_ui/accessibility/android/font_size_prefs_android.h"
#include "components/crash/content/browser/child_exit_observer_android.h"
@@ -669,18 +677,11 @@
#include "components/pdf/common/constants.h"
#endif // BUILDFLAG(ENABLE_PDF)
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
#include "chrome/browser/supervised_user/supervised_user_google_auth_navigation_throttle.h"
#endif
#if BUILDFLAG(ENABLE_MEDIA_REMOTING)
#include "chrome/browser/media/cast_remoting_connector.h"
#endif
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
#include "chrome/browser/supervised_user/supervised_user_navigation_throttle.h"
#endif
#if BUILDFLAG(SAFE_BROWSING_AVAILABLE)
#include "chrome/browser/safe_browsing/chrome_password_protection_service.h"
#endif
@@ -1179,6 +1180,17 @@ void LaunchURL(
url_state == policy::URLBlocklist::URLBlocklistState::URL_IN_ALLOWLIST;
}
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Never skip security checks for the intent:// scheme because
// `ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck` does not handle
// intent:// URLs correctly (or any URLs that should be opened in ARC).
// TODO(b/331400224): Fix `LaunchUrlWithoutSecurityCheck` to handle intent://
// URLs correctly and stop treating them in a special way here.
if (url.SchemeIs("intent")) {
is_allowlisted = false;
}
#endif
// If the URL is in allowlist, we launch it without asking the user and
// without any additional security checks. Since the URL is allowlisted,
// we assume it can be executed.
@@ -1411,6 +1423,33 @@ CreatePopupNavigationDelegate(NavigateParams params) {
return std::make_unique<ChromePopupNavigationDelegate>(std::move(params));
}
// NOTE: MaybeCreateVisitedLinkNavigationThrottleFor is defined here due to
// usage of Profile code which lives in chrome/. The rest of the
// VisitedLinkNavigationThrottle class lives in components/, which cannot access
// chrome/ code due to layering.
std::unique_ptr<VisitedLinkNavigationThrottle>
MaybeCreateVisitedLinkNavigationThrottleFor(
content::NavigationHandle* navigation_handle) {
if (!base::FeatureList::IsEnabled(
blink::features::kPartitionVisitedLinkDatabase)) {
return nullptr;
}
Profile* profile = Profile::FromBrowserContext(
navigation_handle->GetWebContents()->GetBrowserContext());
// Off-the-record profiles do not record history or visited links.
if (profile->IsOffTheRecord()) {
return nullptr;
}
history::HistoryService* history_service =
HistoryServiceFactory::GetForProfile(profile,
ServiceAccessType::IMPLICIT_ACCESS);
if (!history_service) {
return nullptr;
}
return std::make_unique<VisitedLinkNavigationThrottle>(
std::move(navigation_handle), history_service);
}
ChromeContentBrowserClient::PopupNavigationDelegateFactory
g_popup_navigation_delegate_factory = &CreatePopupNavigationDelegate;
@@ -1469,8 +1508,6 @@ void ChromeContentBrowserClient::RegisterLocalStatePrefs(
registry->RegisterBooleanPref(prefs::kSitePerProcess, false);
registry->RegisterBooleanPref(prefs::kTabFreezingEnabled, true);
registry->RegisterIntegerPref(prefs::kSCTAuditingHashdanceReportCount, 0);
registry->RegisterBooleanPref(prefs::kNewBaseUrlInheritanceBehaviorAllowed,
true);
#if BUILDFLAG(IS_CHROMEOS)
registry->RegisterBooleanPref(prefs::kNativeClientForceAllowed, false);
#endif // BUILDFLAG(IS_CHROMEOS)
@@ -1765,15 +1802,9 @@ ChromeContentBrowserClient::GetStoragePartitionConfigForSite(
std::unique_ptr<content::WebContentsViewDelegate>
ChromeContentBrowserClient::GetWebContentsViewDelegate(
content::WebContents* web_contents) {
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
// Do not track web contents performance for profiles that have Keyed Services
// disabled.
if (!AreKeyedServicesDisabledForProfileByDefault(profile)) {
if (auto* registry =
performance_manager::PerformanceManagerRegistry::GetInstance()) {
registry->MaybeCreatePageNodeForWebContents(web_contents);
}
if (auto* registry =
performance_manager::PerformanceManagerRegistry::GetInstance()) {
registry->MaybeCreatePageNodeForWebContents(web_contents);
}
return CreateWebContentsViewDelegate(web_contents);
}
@@ -2434,10 +2465,13 @@ bool ChromeContentBrowserClient::IsIsolatedContextAllowedForUrl(
#endif
}
bool ChromeContentBrowserClient::IsGetAllScreensMediaAllowed(
content::BrowserContext* context,
const url::Origin& origin) {
return capture_policy::IsGetAllScreensMediaAllowed(context, origin.GetURL());
void ChromeContentBrowserClient::CheckGetAllScreensMediaAllowed(
content::RenderFrameHost* render_frame_host,
base::OnceCallback<void(bool)> callback) {
capture_policy::CheckGetAllScreensMediaAllowed(
render_frame_host->GetBrowserContext(),
render_frame_host->GetMainFrame()->GetLastCommittedOrigin().GetURL(),
std::move(callback));
}
bool ChromeContentBrowserClient::IsFileAccessAllowed(
@@ -2613,12 +2647,6 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
if (prefs->GetBoolean(prefs::kPrintPreviewDisabled))
command_line->AppendSwitch(switches::kDisablePrintPreview);
// This passes the preference set by an enterprise policy on to a blink
// switch so that we know whether to force WebSQL to be enabled.
if (prefs->GetBoolean(storage::kWebSQLAccess)) {
command_line->AppendSwitch(blink::switches::kWebSQLAccess);
}
if (prefs->GetBoolean(prefs::kDataUrlInSvgUseEnabled)) {
command_line->AppendSwitch(blink::switches::kDataUrlInSvgUseEnabled);
}
@@ -2839,14 +2867,20 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
if (base::FeatureList::IsEnabled(features::kNoPreReadMainDll)) {
command_line->AppendSwitch(switches::kNoPreReadMainDll);
}
if (base::FeatureList::IsEnabled(features::kNoAppCompatClearInChildren)) {
command_line->AppendSwitch(switches::kNoAppCompatClear);
}
#endif
ThreadProfilerConfiguration::Get()->AppendCommandLineSwitchForChildProcess(
command_line);
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 BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_ASH)
// Opt into a hardened stack canary mitigation if it hasn't already been
// force-disabled.
@@ -3589,6 +3623,43 @@ bool ChromeContentBrowserClient::ShouldDenyRequestOnCertificateError(
namespace {
bool IsForcedColorsEnabledForWebContent(content::WebContents* contents,
const ui::NativeTheme* native_theme) {
if (!native_theme->InForcedColorsMode() || !contents) {
return false;
}
PrefService* prefs =
Profile::FromBrowserContext(contents->GetBrowserContext())->GetPrefs();
CHECK(prefs);
const base::Value::List& forced_colors_blocklist =
prefs->GetList(prefs::kPageColorsBlockList);
if (forced_colors_blocklist.empty()) {
return true;
}
GURL url = contents->GetLastCommittedURL();
// Forced Colors should be disabled for the current URL if it is in the block
// list.
for (auto const& value : forced_colors_blocklist) {
ContentSettingsPattern pattern =
ContentSettingsPattern::FromString(value.GetString());
if (pattern == ContentSettingsPattern::Wildcard() || !pattern.IsValid()) {
continue;
}
if (pattern.Matches(url)) {
return false;
}
}
return true;
}
#if !BUILDFLAG(IS_ANDROID)
blink::mojom::PreferredColorScheme ToBlinkPreferredColorScheme(
ui::NativeTheme::PreferredColorScheme native_theme_scheme) {
@@ -3622,11 +3693,20 @@ bool UpdatePreferredColorScheme(WebPreferences* web_prefs,
delegate->IsNightModeEnabled()
? blink::mojom::PreferredColorScheme::kDark
: blink::mojom::PreferredColorScheme::kLight;
web_prefs->browser_preferred_color_scheme =
web_prefs->preferred_color_scheme;
}
#else
// Update based on native theme scheme.
web_prefs->preferred_color_scheme =
ToBlinkPreferredColorScheme(native_theme->GetPreferredColorScheme());
// 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
? blink::mojom::PreferredColorScheme::kLight
: blink::mojom::PreferredColorScheme::kDark;
#endif // BUILDFLAG(IS_ANDROID)
// Reauth WebUI doesn't support dark mode yet because it shares the dialog
@@ -4213,7 +4293,8 @@ void ChromeContentBrowserClient::OverrideWebkitPrefs(
break;
}
web_prefs->in_forced_colors = GetWebTheme()->InForcedColorsMode();
web_prefs->in_forced_colors =
IsForcedColorsEnabledForWebContent(web_contents, GetWebTheme());
UpdatePreferredColorScheme(
web_prefs,
@@ -4242,14 +4323,12 @@ void ChromeContentBrowserClient::OverrideWebkitPrefs(
prefs->GetBoolean(prefs::kWebXRImmersiveArEnabled);
#endif
// Only set `databases_enabled` if disabled. Otherwise check blink::feature
// settings for Origin Trial and Chrome flag settings, or prefs setting
// for Enterprise Policy.
// Only set `databases_enabled` if disabled, otherwise check blink::feature
// settings.
web_prefs->databases_enabled =
!web_prefs->databases_enabled
? false
: (base::FeatureList::IsEnabled(blink::features::kWebSQLAccess) ||
prefs->GetBoolean(storage::kWebSQLAccess));
: base::FeatureList::IsEnabled(blink::features::kWebSQLAccess);
#if BUILDFLAG(IS_FUCHSIA)
// Disable WebSQL support since it is being removed from the web platform
@@ -4316,7 +4395,10 @@ bool ChromeContentBrowserClient::OverrideWebPreferencesAfterNavigation(
parts->OverrideWebPreferencesAfterNavigation(web_contents, web_prefs);
}
prefs_changed |= GetWebTheme()->InForcedColorsMode();
const bool in_forced_colors =
IsForcedColorsEnabledForWebContent(web_contents, GetWebTheme());
prefs_changed |= (web_prefs->in_forced_colors != in_forced_colors);
web_prefs->in_forced_colors = in_forced_colors;
prefs_changed |=
UpdatePreferredColorScheme(web_prefs, web_contents->GetLastCommittedURL(),
@@ -4961,12 +5043,6 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
page_load_metrics::MetricsNavigationThrottle::Create(handle));
}
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
MaybeAddThrottle(
SupervisedUserNavigationThrottle::MaybeCreateThrottleFor(handle),
&throttles);
#endif
#if BUILDFLAG(IS_ANDROID)
// TODO(davidben): This is insufficient to integrate with prerender properly.
// https://crbug.com/370595
@@ -5055,11 +5131,13 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
}
#endif
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
MaybeAddThrottle(
SupervisedUserGoogleAuthNavigationThrottle::MaybeCreate(handle),
&throttles);
#endif
MaybeAddThrottle(
SupervisedUserNavigationThrottle::MaybeCreateThrottleFor(handle),
&throttles);
if (auto* throttle_manager =
subresource_filter::ContentSubresourceFilterThrottleManager::
@@ -5292,6 +5370,9 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
&throttles);
#endif // !BUILDFLAG(IS_ANDROID)
MaybeAddThrottle(MaybeCreateVisitedLinkNavigationThrottleFor(handle),
&throttles);
return throttles;
}
@@ -5419,8 +5500,13 @@ ChromeContentBrowserClient::GetSpareRendererDelayForSiteURL(
return features::kSpareRendererWarmupDelay.Get();
}
content::TracingDelegate* ChromeContentBrowserClient::GetTracingDelegate() {
return new ChromeTracingDelegate();
std::unique_ptr<content::TracingDelegate>
ChromeContentBrowserClient::CreateTracingDelegate() {
return std::make_unique<ChromeTracingDelegate>();
}
bool ChromeContentBrowserClient::IsSystemWideTracingEnabled() {
return ChromeTracingDelegate::IsSystemWideTracingEnabled();
}
bool ChromeContentBrowserClient::IsPluginAllowedToCallRequestOSFileHandle(
@@ -5552,6 +5638,8 @@ 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,
@@ -5813,8 +5901,6 @@ ChromeContentBrowserClient::CreateNonNetworkNavigationURLLoaderFactory(
if (content::IsolatedWebAppsPolicy::AreIsolatedWebAppsEnabled(
browser_context) &&
!browser_context->ShutdownStarted()) {
// TODO(crbug.com/1365848): Only register the factory if we are already in
// an isolated storage partition.
return web_app::IsolatedWebAppURLLoaderFactory::Create(frame_tree_node_id,
browser_context);
}
@@ -6123,9 +6209,6 @@ void ChromeContentBrowserClient::
if (content::IsolatedWebAppsPolicy::AreIsolatedWebAppsEnabled(
browser_context) &&
!browser_context->ShutdownStarted()) {
// TODO(crbug.com/1365848): Only register the factory if we are already
// in an isolated storage partition.
if (frame_host != nullptr) {
factories->emplace(
chrome::kIsolatedAppScheme,
@@ -6188,6 +6271,7 @@ void ChromeContentBrowserClient::WillCreateURLLoaderFactory(
int render_process_id,
URLLoaderFactoryType type,
const url::Origin& request_initiator,
const net::IsolationInfo& isolation_info,
std::optional<int64_t> navigation_id,
ukm::SourceIdObj ukm_source_id,
network::URLLoaderFactoryBuilder& factory_builder,
@@ -6836,17 +6920,6 @@ bool ChromeContentBrowserClient::HandleWebUI(
}
#if !BUILDFLAG(IS_ANDROID)
// Redirect from the preloading sub-page to the performance page.
if (url->SchemeIs(content::kChromeUIScheme) &&
url->host() == chrome::kChromeUISettingsHost &&
url->path() == chrome::kPreloadingSubPagePath) {
GURL::Replacements replacements;
replacements.SetPathStr(chrome::kPerformanceSubPagePath);
*url = url->ReplaceComponents(replacements);
UMA_HISTOGRAM_BOOLEAN("Settings.Preloading.DeprecatedRedirect", true);
} else if (url->path() == chrome::kPerformanceSubPagePath) {
UMA_HISTOGRAM_BOOLEAN("Settings.Preloading.DeprecatedRedirect", false);
}
Profile* profile = Profile::FromBrowserContext(browser_context);
auto* tracking_protection_settings =
TrackingProtectionSettingsFactory::GetForProfile(profile);
@@ -7497,9 +7570,10 @@ void ChromeContentBrowserClient::IsClipboardCopyAllowedByPolicy(
if (service->IsUrlAllowedToCopy(*source.data_transfer_endpoint()->GetURL(),
metadata.size.value_or(0),
&replacement_data)) {
std::move(callback).Run(data, std::nullopt);
std::move(callback).Run(metadata.format_type, data, std::nullopt);
} else {
std::move(callback).Run(data, std::move(replacement_data));
std::move(callback).Run(metadata.format_type, data,
std::move(replacement_data));
}
#endif // BUILDFLAG(ENTERPRISE_DATA_CONTROLS)
}
@@ -7710,6 +7784,34 @@ ChromeContentBrowserClient::CreateIdentityRequestDialogController(
return std::make_unique<IdentityDialogController>(web_contents);
}
#if BUILDFLAG(IS_ANDROID)
namespace {
void RunDigitalIdentityCallback(
std::unique_ptr<DigitalIdentitySafetyInterstitialBridgeAndroid> bridge,
content::ContentBrowserClient::DigitalIdentityInterstitialCallback callback,
content::DigitalIdentityProvider::RequestStatusForMetrics
status_for_metrics) {
std::move(callback).Run(status_for_metrics);
}
} // anonymous namespace
void ChromeContentBrowserClient::ShowDigitalIdentityInterstitialIfNeeded(
content::WebContents& web_contents,
const url::Origin& origin,
DigitalIdentityInterstitialCallback callback) {
auto bridge =
std::make_unique<DigitalIdentitySafetyInterstitialBridgeAndroid>();
auto* bridge_ptr = bridge.get();
// Callback takes ownership of |bridge|.
bridge_ptr->ShowInterstitialIfNeeded(
web_contents, origin,
base::BindOnce(&RunDigitalIdentityCallback, std::move(bridge),
std::move(callback)));
}
#endif
bool ChromeContentBrowserClient::SuppressDifferentOriginSubframeJSDialogs(
content::BrowserContext* browser_context) {
Profile* profile = Profile::FromBrowserContext(browser_context);
@@ -7880,8 +7982,7 @@ ChromeContentBrowserClient::GetAlternativeErrorPageOverrideInfo(
auto alternative_error_page_override_info =
content::mojom::AlternativeErrorPageOverrideInfo::New();
bool is_portal_state = portal_state == PortalState::kPortal ||
portal_state == PortalState::kPortalSuspected ||
portal_state == PortalState::kProxyAuthRequired;
portal_state == PortalState::kPortalSuspected;
// Use the alternative error page dictionary to provide additional
// suggestions in the default error page.
alternative_error_page_override_info->alternative_error_page_params.Set(
@@ -8000,9 +8101,10 @@ bool ChromeContentBrowserClient::IsTransientActivationRequiredForHtmlFullscreen(
const HostContentSettingsMap* const content_settings =
HostContentSettingsMapFactory::GetForProfile(
render_frame_host->GetBrowserContext());
if (content_settings->GetContentSetting(
if (content_settings &&
content_settings->GetContentSetting(
url, url, ContentSettingsType::AUTOMATIC_FULLSCREEN) ==
CONTENT_SETTING_ALLOW) {
CONTENT_SETTING_ALLOW) {
return false;
}
}
@@ -8142,6 +8244,15 @@ void ChromeContentBrowserClient::BindVideoEffectsManager(
media_effects::BindVideoEffectsManager(device_id, browser_context,
std::move(video_effects_manager));
}
void ChromeContentBrowserClient::BindVideoEffectsProcessor(
const std::string& device_id,
content::BrowserContext* browser_context,
mojo::PendingReceiver<video_effects::mojom::VideoEffectsProcessor>
video_effects_processor) {
media_effects::BindVideoEffectsProcessor(device_id, browser_context,
std::move(video_effects_processor));
}
#endif // !BUILDFLAG(IS_ANDROID)
void ChromeContentBrowserClient::PreferenceRankAudioDeviceInfos(
@@ -8223,3 +8334,9 @@ bool ChromeContentBrowserClient::ShouldSuppressAXLoadComplete(
return url == GURL(chrome::kChromeUINewTabURL) ||
url == GURL(chrome::kChromeUINewTabPageURL);
}
void ChromeContentBrowserClient::BindModelManager(
content::RenderFrameHost* rfh,
mojo::PendingReceiver<blink::mojom::ModelManager> receiver) {
ModelManagerImpl::Create(rfh, std::move(receiver));
}
@@ -116,6 +116,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/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"
#include "components/image_fetcher/core/cache/image_cache.h"
@@ -163,21 +164,20 @@
#include "components/security_interstitials/content/stateful_ssl_host_state_delegate.h"
#include "components/segmentation_platform/embedder/default_model/device_switcher_result_dispatcher.h"
#include "components/segmentation_platform/public/segmentation_platform_service.h"
#include "components/services/storage/public/cpp/storage_prefs.h"
#include "components/sessions/core/session_id_generator.h"
#include "components/signin/public/base/signin_pref_names.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/site_engagement/content/site_engagement_service.h"
#include "components/subresource_filter/content/browser/ruleset_service.h"
#include "components/subresource_filter/content/shared/browser/ruleset_service.h"
#include "components/subresource_filter/core/browser/subresource_filter_constants.h"
#include "components/supervised_user/core/browser/supervised_user_preferences.h"
#include "components/supervised_user/core/common/buildflags.h"
#include "components/sync/base/pref_names.h"
#include "components/sync/service/glue/sync_transport_data_prefs.h"
#include "components/sync/service/sync_prefs.h"
#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/tracing/common/pref_names.h"
#include "components/translate/core/browser/translate_prefs.h"
#include "components/update_client/update_client.h"
@@ -238,11 +238,6 @@
#include "chrome/browser/screen_ai/pref_names.h"
#endif
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
#include "components/supervised_user/core/browser/child_account_service.h"
#include "components/supervised_user/core/browser/supervised_user_service.h"
#endif
#include "components/feed/buildflags.h"
#include "components/feed/core/common/pref_names.h"
#include "components/feed/core/shared_prefs/pref_names.h"
@@ -261,6 +256,7 @@
#include "chrome/browser/notifications/notification_channels_provider_android.h"
#include "chrome/browser/password_manager/android/password_manager_android_util.h"
#include "chrome/browser/readaloud/android/prefs.h"
#include "chrome/browser/safety_hub/android/prefs.h"
#include "chrome/browser/ssl/known_interception_disclosure_infobar_delegate.h"
#include "components/cdm/browser/media_drm_storage_impl.h" // nogncheck crbug.com/1125897
#include "components/ntp_snippets/register_prefs.h"
@@ -278,7 +274,7 @@
#include "chrome/browser/media/unified_autoplay_config.h"
#include "chrome/browser/metrics/tab_stats/tab_stats_tracker.h"
#include "chrome/browser/nearby_sharing/common/nearby_share_prefs.h"
#include "chrome/browser/new_tab_page/modules/drive/drive_service.h"
#include "chrome/browser/new_tab_page/modules/file_suggestion/drive_service.h"
#include "chrome/browser/new_tab_page/modules/photos/photos_service.h"
#include "chrome/browser/new_tab_page/modules/recipes/recipes_service.h"
#include "chrome/browser/new_tab_page/modules/safe_browsing/safe_browsing_handler.h"
@@ -293,6 +289,7 @@
#include "chrome/browser/ui/commerce/commerce_ui_tab_helper.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"
#include "chrome/browser/ui/webui/cr_components/theme_color_picker/theme_color_picker_handler.h"
#include "chrome/browser/ui/webui/history/foreign_session_handler.h"
#include "chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.h"
@@ -391,6 +388,7 @@
#include "chrome/browser/ash/login/screens/enable_adb_sideloading_screen.h"
#include "chrome/browser/ash/login/screens/reset_screen.h"
#include "chrome/browser/ash/login/security_token_session_controller.h"
#include "chrome/browser/ash/login/session/chrome_session_manager.h"
#include "chrome/browser/ash/login/session/user_session_manager.h"
#include "chrome/browser/ash/login/signin/signin_error_notifier.h"
#include "chrome/browser/ash/login/signin/token_handle_fetcher.h"
@@ -476,6 +474,7 @@
#include "chrome/browser/media/cdm_pref_service_helper.h"
#include "chrome/browser/media/media_foundation_service_monitor.h"
#include "chrome/browser/os_crypt/app_bound_encryption_metrics_win.h"
#include "chrome/browser/os_crypt/app_bound_encryption_provider_win.h"
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
#include "chrome/browser/win/conflicts/incompatible_applications_updater.h"
#include "chrome/browser/win/conflicts/module_database.h"
@@ -991,6 +990,9 @@ constexpr char kResetCheckDefaultBrowser[] =
// Deprecated 02/2024
constexpr char kOsCryptAppBoundFixedDataPrefName[] =
"os_crypt.app_bound_fixed_data";
// Deprecated 03/2024
constexpr char kOsCryptAppBoundFixedData2PrefName[] =
"os_crypt.app_bound_fixed_data2";
#endif // BUILDFLAG(IS_WIN)
// Deprecated 02/2024.
@@ -1007,16 +1009,35 @@ constexpr char kPrivacySandboxApisEnabled[] = "privacy_sandbox.apis_enabled";
constexpr char kOobeGuestAcceptedTos[] = "oobe.guest_accepted_tos";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 03/2024.
constexpr char kShowInternalAccessibilityTree[] =
"accessibility.show_internal_accessibility_tree";
// Deprecated 03/2024.
// A `kDefaultSearchProviderChoicePending` pref persists (migrated to a new
// pref name to reset the data), so the variable name has been changed here.
constexpr char kDefaultSearchProviderChoicePendingDeprecated[] =
"default_search_provider.choice_pending";
// Deprecated 03/2024.
constexpr char kTrackingProtectionSentimentSurveyGroup[] =
"tracking_protection.tracking_protection_sentiment_survey_group";
constexpr char kTrackingProtectionSentimentSurveyStartTime[] =
"tracking_protection.tracking_protection_sentiment_survey_start_time";
constexpr char kTrackingProtectionSentimentSurveyEndTime[] =
"tracking_protection.tracking_protection_sentiment_survey_end_time";
// Deprecated 03/2024
constexpr char kPreferencesMigratedToBasic[] =
"browser.clear_data.preferences_migrated_to_basic";
// Deprecated 04/2024.
inline constexpr char kOmniboxInstantKeywordUsed[] =
"omnibox.instant_keyword_used";
// Deprecated 04/2024.
inline constexpr char kDIPSTimerLastUpdate[] = "dips_timer_last_update";
// Register local state used only for migration (clearing or moving to a new
// key).
void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
@@ -1127,6 +1148,9 @@ void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
// Deprecated 02/2024.
registry->RegisterStringPref(kOsCryptAppBoundFixedDataPrefName,
std::string());
// Deprecated 03/2024.
registry->RegisterStringPref(kOsCryptAppBoundFixedData2PrefName,
std::string());
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
@@ -1431,12 +1455,28 @@ void RegisterProfilePrefsForMigration(
// Deprecated 03/2024.
registry->RegisterBooleanPref(kPrivacySandboxApisEnabled, true);
// Deprecated 03/2024.
registry->RegisterBooleanPref(kShowInternalAccessibilityTree, false);
// Deprecated 03/2024.
registry->RegisterBooleanPref(kDefaultSearchProviderChoicePendingDeprecated,
false);
// Deprecated 03/2024
registry->RegisterIntegerPref(kTrackingProtectionSentimentSurveyGroup, 0);
registry->RegisterTimePref(kTrackingProtectionSentimentSurveyStartTime,
base::Time());
registry->RegisterTimePref(kTrackingProtectionSentimentSurveyEndTime,
base::Time());
// Deprecated 03/2024.
registry->RegisterBooleanPref(kPreferencesMigratedToBasic, false);
// Deprecated 04/2024.
registry->RegisterBooleanPref(kOmniboxInstantKeywordUsed, false);
// Deprecated 04/2024.
registry->RegisterTimePref(kDIPSTimerLastUpdate, base::Time());
}
void ClearSyncRequestedPrefAndMaybeMigrate(PrefService* profile_prefs) {
@@ -1521,9 +1561,14 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
sessions::SessionIdGenerator::RegisterPrefs(registry);
SSLConfigServiceManager::RegisterPrefs(registry);
subresource_filter::IndexedRulesetVersion::RegisterPrefs(
registry, subresource_filter::kSafeBrowsingFilterTag);
registry, subresource_filter::kSafeBrowsingRulesetConfig.filter_tag);
subresource_filter::IndexedRulesetVersion::RegisterPrefs(
registry,
fingerprinting_protection_filter::kFingerprintingProtectionRulesetConfig
.filter_tag);
SystemNetworkContextManager::RegisterPrefs(registry);
tpcd::experiment::RegisterLocalStatePrefs(registry);
tpcd::metadata::RegisterLocalStatePrefs(registry);
tracing::RegisterPrefs(registry);
update_client::RegisterPrefs(registry);
variations::VariationsService::RegisterPrefs(registry);
@@ -1584,6 +1629,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
ash::cert_provisioning::RegisterLocalStatePrefs(registry);
ash::CellularESimProfileHandlerImpl::RegisterLocalStatePrefs(registry);
ash::ManagedCellularPrefHandler::RegisterLocalStatePrefs(registry);
ash::ChromeSessionManager::RegisterPrefs(registry);
ash::ChromeUserManagerImpl::RegisterPrefs(registry);
crosapi::browser_util::RegisterLocalStatePrefs(registry);
ash::CupsPrintersManager::RegisterLocalStatePrefs(registry);
@@ -1685,10 +1731,13 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(prefs::kRendererAppContainerEnabled, true);
registry->RegisterBooleanPref(prefs::kBlockBrowserLegacyExtensionPoints,
true);
registry->RegisterBooleanPref(prefs::kApplicationBoundEncryptionEnabled,
true);
registry->RegisterBooleanPref(
policy::policy_prefs::kNativeWindowOcclusionEnabled, true);
MediaFoundationServiceMonitor::RegisterPrefs(registry);
os_crypt::RegisterLocalStatePrefs(registry);
os_crypt_async::AppBoundEncryptionProviderWin::RegisterLocalPrefs(registry);
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
IncompatibleApplicationsUpdater::RegisterLocalStatePrefs(registry);
ModuleDatabase::RegisterLocalStatePrefs(registry);
@@ -1726,6 +1775,10 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(prefs::kChromeForTestingAllowed, true);
#endif
#if BUILDFLAG(IS_WIN)
registry->RegisterBooleanPref(prefs::kUiAutomationProviderEnabled, false);
#endif
// This is intentionally last.
RegisterLocalStatePrefsForMigration(registry);
}
@@ -1813,7 +1866,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
SessionStartupPref::RegisterProfilePrefs(registry);
SharingSyncPreference::RegisterProfilePrefs(registry);
site_engagement::SiteEngagementService::RegisterProfilePrefs(registry);
storage::RegisterProfilePrefs(registry);
supervised_user::RegisterProfilePrefs(registry);
sync_sessions::SessionSyncPrefs::RegisterProfilePrefs(registry);
syncer::DeviceInfoPrefs::RegisterProfilePrefs(registry);
syncer::SyncPrefs::RegisterProfilePrefs(registry);
@@ -1867,10 +1920,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
ChromeRLZTrackerDelegate::RegisterProfilePrefs(registry);
#endif
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
supervised_user::RegisterProfilePrefs(registry);
#endif
#if BUILDFLAG(ENABLE_FEED_V2)
feed::prefs::RegisterFeedSharedProfilePrefs(registry);
feed::RegisterProfilePrefs(registry);
@@ -1889,6 +1938,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
query_tiles::RegisterPrefs(registry);
readaloud::RegisterProfilePrefs(registry);
RecentTabsPagePrefs::RegisterProfilePrefs(registry);
safety_hub_prefs::RegisterSafetyHubAndroidProfilePrefs(registry);
usage_stats::UsageStatsBridge::RegisterProfilePrefs(registry);
variations::VariationsService::RegisterProfilePrefs(registry);
webapps::InstallPromptPrefs::RegisterProfilePrefs(registry);
@@ -1935,6 +1985,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
toolbar::RegisterProfilePrefs(registry);
UnifiedAutoplayConfig::RegisterProfilePrefs(registry);
user_notes::RegisterProfilePrefs(registry);
tab_groups::SavedTabGroupUtils::RegisterProfilePrefs(registry);
#if !BUILDFLAG(IS_CHROMEOS_LACROS)
captions::LiveCaptionController::RegisterProfilePrefs(registry);
@@ -2126,8 +2177,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
false);
#endif
registry->RegisterTimePref(prefs::kDIPSTimerLastUpdate, base::Time());
#if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
registry->RegisterBooleanPref(prefs::kAccessibilityPdfOcrAlwaysActive, true);
#endif // BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
@@ -2151,6 +2200,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
#if BUILDFLAG(ENABLE_COMPOSE)
registry->RegisterBooleanPref(prefs::kPrefHasCompletedComposeFRE, false);
registry->RegisterBooleanPref(prefs::kEnableProactiveNudge, true);
#endif
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA)
registry->RegisterIntegerPref(prefs::kChromeDataRegionSetting, 0);
#endif
}
@@ -2301,6 +2355,8 @@ void MigrateObsoleteLocalStatePrefs(PrefService* local_state) {
#if BUILDFLAG(IS_WIN)
// Deprecated 02/2024.
local_state->ClearPref(kOsCryptAppBoundFixedDataPrefName);
// Deprecated 03/2024.
local_state->ClearPref(kOsCryptAppBoundFixedData2PrefName);
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
@@ -2712,9 +2768,23 @@ void MigrateObsoleteProfilePrefs(PrefService* profile_prefs,
// TODO(crbug.com/40282890): Remove ~one year after full launch.
browser_sync::MaybeMigrateSyncingUserToSignedIn(profile_path, profile_prefs);
// Added 03/2024.
profile_prefs->ClearPref(kShowInternalAccessibilityTree);
// Added 03/2024.
profile_prefs->ClearPref(kTrackingProtectionSentimentSurveyGroup);
profile_prefs->ClearPref(kTrackingProtectionSentimentSurveyStartTime);
profile_prefs->ClearPref(kTrackingProtectionSentimentSurveyEndTime);
// Added 03/2024
profile_prefs->ClearPref(kPreferencesMigratedToBasic);
// Added 04/2024.
profile_prefs->ClearPref(kOmniboxInstantKeywordUsed);
// Added 04/2024.
profile_prefs->ClearPref(kDIPSTimerLastUpdate);
// Please don't delete the following line. It is used by PRESUBMIT.py.
// END_MIGRATE_OBSOLETE_PROFILE_PREFS
@@ -36,6 +36,7 @@
#include "chrome/browser/history/history_tab_helper.h"
#include "chrome/browser/history/top_sites_factory.h"
#include "chrome/browser/history_clusters/history_clusters_tab_helper.h"
#include "chrome/browser/history_embeddings/history_embeddings_tab_helper.h"
#include "chrome/browser/image_fetcher/image_fetcher_service_factory.h"
#include "chrome/browser/login_detection/login_detection_tab_helper.h"
#include "chrome/browser/lookalikes/safety_tip_web_contents_observer.h"
@@ -76,6 +77,7 @@
#include "chrome/browser/storage_access_api/storage_access_api_service_impl.h"
#include "chrome/browser/storage_access_api/storage_access_api_tab_helper.h"
#include "chrome/browser/subresource_filter/chrome_content_subresource_filter_web_contents_helper_factory.h"
#include "chrome/browser/supervised_user/supervised_user_navigation_observer.h"
#include "chrome/browser/sync/sessions/sync_sessions_router_tab_helper.h"
#include "chrome/browser/sync/sessions/sync_sessions_web_contents_router_factory.h"
#include "chrome/browser/tab_contents/navigation_metrics_recorder.h"
@@ -117,6 +119,7 @@
#include "components/blocked_content/popup_blocker_tab_helper.h"
#include "components/blocked_content/popup_opener_tab_helper.h"
#include "components/breadcrumbs/core/breadcrumbs_status.h"
#include "components/browsing_topics/browsing_topics_redirect_observer.h"
#include "components/captive_portal/core/buildflags.h"
#include "components/client_hints/browser/client_hints_web_contents_observer.h"
#include "components/commerce/content/browser/commerce_tab_helper.h"
@@ -147,10 +150,9 @@
#include "components/safe_browsing/content/browser/safe_browsing_tab_observer.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/search/ntp_features.h"
#include "components/search_engines/search_engine_choice_utils.h"
#include "components/search_engines/search_engine_choice/search_engine_choice_utils.h"
#include "components/site_engagement/content/site_engagement_helper.h"
#include "components/site_engagement/content/site_engagement_service.h"
#include "components/supervised_user/core/common/buildflags.h"
#include "components/tracing/common/tracing_switches.h"
#include "components/ukm/content/source_url_recorder.h"
#include "components/user_notes/user_notes_features.h"
@@ -227,6 +229,7 @@
#endif
#if BUILDFLAG(IS_CHROMEOS)
#include "chrome/browser/chromeos/container_app/container_app_tab_helper.h"
#include "chrome/browser/chromeos/cros_apps/cros_apps_tab_helper.h"
#include "chrome/browser/chromeos/mahi/mahi_tab_helper.h"
#include "chrome/browser/chromeos/policy/dlp/dlp_content_tab_helper.h"
@@ -278,9 +281,6 @@
#include "chrome/browser/printing/printing_init.h"
#endif
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
#include "chrome/browser/supervised_user/supervised_user_navigation_observer.h"
#endif
#if !BUILDFLAG(IS_ANDROID)
#include "chrome/browser/privacy_sandbox/tracking_protection_notice_service.h"
@@ -368,6 +368,8 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
if (breadcrumbs::IsEnabled(g_browser_process->local_state())) {
BreadcrumbManagerTabHelper::CreateForWebContents(web_contents);
}
browsing_topics::BrowsingTopicsRedirectObserver::MaybeCreateForWebContents(
web_contents);
chrome::ChainedBackNavigationTracker::CreateForWebContents(web_contents);
chrome_browser_net::NetErrorTabHelper::CreateForWebContents(web_contents);
if (!autofill_client_provider.uses_platform_autofill()) {
@@ -401,6 +403,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
web_contents, TopSitesFactory::GetForProfile(profile).get());
HistoryTabHelper::CreateForWebContents(web_contents);
HistoryClustersTabHelper::CreateForWebContents(web_contents);
HistoryEmbeddingsTabHelper::CreateForWebContents(web_contents);
HttpsOnlyModeTabHelper::CreateForWebContents(web_contents);
webapps::InstallableManager::CreateForWebContents(web_contents);
login_detection::LoginDetectionTabHelper::MaybeCreateForWebContents(
@@ -432,7 +435,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
#if BUILDFLAG(IS_ANDROID)
// If enabled, save sensitivity data for each non-incognito non-custom
// android tab
// TODO(crbug.com/1466970): Consider moving check conditions or the
// TODO(crbug.com/40276584): Consider moving check conditions or the
// registration logic to sensitivity_persisted_tab_data_android.*
if (!profile->IsOffTheRecord()) {
if (auto* tab = TabAndroid::FromWebContents(web_contents);
@@ -512,6 +515,10 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
StorageAccessAPITabHelper::CreateForWebContents(
web_contents, StorageAccessAPIServiceFactory::GetForBrowserContext(
web_contents->GetBrowserContext()));
// Do not create for Incognito mode.
if (!profile->IsOffTheRecord()) {
SupervisedUserNavigationObserver::CreateForWebContents(web_contents);
}
HttpErrorTabHelper::CreateForWebContents(web_contents);
sync_sessions::SyncSessionsRouterTabHelper::CreateForWebContents(
web_contents,
@@ -620,11 +627,11 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
if (commerce::isContextualConsentEnabled()) {
commerce_hint::CommerceHintTabHelper::CreateForWebContents(web_contents);
}
auto* service = UnusedSitePermissionsServiceFactory::GetForProfile(profile);
if (service) {
UnusedSitePermissionsService::TabHelper::CreateForWebContents(
web_contents, service);
}
auto* service = UnusedSitePermissionsServiceFactory::GetForProfile(profile);
if (service) {
UnusedSitePermissionsService::TabHelper::CreateForWebContents(web_contents,
service);
}
if (base::FeatureList::IsEnabled(ntp_features::kNtpHistoryClustersModule)) {
side_panel::HistoryClustersTabHelper::CreateForWebContents(web_contents);
}
@@ -661,6 +668,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
#endif
#if BUILDFLAG(IS_CHROMEOS)
ContainerAppTabHelper::MaybeCreateForWebContents(web_contents);
CrosAppsTabHelper::MaybeCreateForWebContents(web_contents);
mahi::MahiTabHelper::MaybeCreateForWebContents(web_contents);
policy::DlpContentTabHelper::MaybeCreateForWebContents(web_contents);
@@ -702,7 +710,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
}
if (!profile->IsIncognitoProfile()) {
// TODO(1360846): Consider using the in-memory cache instead.
// TODO(crbug.com/40863325): Consider using the in-memory cache instead.
commerce::CommerceUiTabHelper::CreateForWebContents(
web_contents,
commerce::ShoppingServiceFactory::GetForBrowserContext(profile),
@@ -777,13 +785,6 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
printing::InitializePrintingForWebContents(web_contents);
#endif
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
// Do not create for Incognito mode.
if (!profile->IsOffTheRecord()) {
SupervisedUserNavigationObserver::CreateForWebContents(web_contents);
}
#endif
// --- Section 4: The warning ---
// NONO NO NONONO !
@@ -119,6 +119,7 @@ namespace autofillPrivate {
SINGLE_USERNAME_FORGOT_PASSWORD,
ADDRESS_HOME_APT,
ADDRESS_HOME_APT_TYPE,
ADDRESS_HOME_HOUSE_NUMBER_AND_APT,
SINGLE_USERNAME_WITH_INTERMEDIATE_VALUES,
MAX_VALID_FIELD_TYPE
};
@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Use the <code>chrome.documentScan</code> API to discover and retrieve
// images from attached paper document scanners.
// images from attached document scanners.
[platforms=("chromeos", "lacros"),
implemented_in="chrome/browser/extensions/api/document_scan/document_scan_api.h"]
namespace documentScan {
@@ -11,28 +11,25 @@ namespace documentScan {
// The MIME types that are accepted by the caller.
DOMString[]? mimeTypes;
// The number of scanned images allowed (defaults to 1).
// The number of scanned images allowed. The default is 1.
long? maxImages;
};
dictionary ScanResults {
// The data image URLs in a form that can be passed as the "src" value to
// an image tag.
// An array of data image URLs in a form that can be passed as the "src"
// value to an image tag.
DOMString[] dataUrls;
// The MIME type of <code>dataUrls</code>.
// The MIME type of the <code>dataUrls</code>.
DOMString mimeType;
};
// OperationResult is an enum that indicates the result of each operation
// performed by the backend. It contains the same causes as SANE_Status plus
// additional statuses that come from the IPC layers and image conversion
// stages.
[nodoc] enum OperationResult {
// An enum that indicates the result of each operation.
enum OperationResult {
// An unknown or generic failure occurred.
UNKNOWN,
// Operation succeeded.
// The operation succeeded.
SUCCESS,
// The operation is not supported.
@@ -44,10 +41,10 @@ namespace documentScan {
// The device is busy.
DEVICE_BUSY,
// Data or argument is invalid.
// Either the data or an argument passed to the method is not valid.
INVALID,
// Value is the wrong type for the underlying option.
// The supplied value is the wrong data type for the underlying option.
WRONG_TYPE,
// No more data is available.
@@ -68,152 +65,163 @@ namespace documentScan {
// The device requires authentication.
ACCESS_DENIED,
// Not enough memory was available to complete the operation.
// Not enough memory is available on the Chromebook to complete the
// operation.
NO_MEMORY,
// The device was not reachable.
// The device is not reachable.
UNREACHABLE,
// The device was disconnected.
// The device is disconnected.
MISSING,
// An internal error occurred.
// An error has occurred somewhere other than the calling application.
INTERNAL_ERROR
};
// How the scanner is connected to the computer.
[nodoc] enum ConnectionType {
// Indicates how the scanner is connected to the computer.
enum ConnectionType {
UNSPECIFIED,
USB,
NETWORK
};
// ScannerInfo contains general information about a scanner device. It is
// intended for filtering and constructing user-facing information, not for
// configuring a scan.
[nodoc] dictionary ScannerInfo {
// For connecting with <code>openScanner</code>.
// Contains general information about a scanner. It is
// intended for filtering and constructing user-facing information. to
// configure a scan, use $(ref:StartScanOptions).
dictionary ScannerInfo {
// The ID of a specific scanner.
DOMString scannerId;
// Printable name for displaying in the UI.
// A human-readable name for the scanner to display in the UI.
DOMString name;
// Scanner manufacturer.
// The scanner manufacturer.
DOMString manufacturer;
// Scanner model if available, or a generic description.
// The scanner model if it is available, or a generic description.
DOMString model;
// For matching against other <code>ScannerInfo</code> entries that point
// to the same physical device.
DOMString deviceUuid;
// How the scanner is connected to the computer.
// Indicates how the scanner is connected to the computer.
ConnectionType connectionType;
// If true, the scanner connection's transport cannot be intercepted by a
// passive listener, such as TLS or USB.
boolean secure;
// MIME types that can be requested for returned scans.
// An array of MIME types that can be requested for returned scans.
DOMString[] imageFormats;
// A general human-readable description of the protocol/backend used to
// access the scanner, such as Mopria, WSD, or epsonds. This is primarily
// A human-readable description of the protocol or driver used to
// access the scanner, such as Mopria, WSD, or epsonds. This is primarily
// useful for allowing a user to choose between protocols if a device
// supports multiple protocols.
DOMString protocolType;
};
// The type of an option. This is the same set of types as SANE_Value_Type.
[nodoc] enum OptionType {
// Unknown option type. <code>value</code> will be unset.
// The data type of an option.
enum OptionType {
// The option's data type is unknown. The <code>value</code> property
// will be unset.
UNKNOWN,
// true/false only. <code>value</code> will be a boolean.
// The <code>value</code> property will be one of <code>true</code or
// <code>false</code>.
BOOL,
// Signed 32-bit integer. <code>value</code> will be long or long[],
// depending on whether the option takes more than one value.
// A signed 32-bit integer. The <code>value</code> property will be long or
// long[], depending on whether the option takes more than one value.
INT,
// Double in the range -32768-32767.9999 with a resolution of 1/65535.
// <code>value</code> will be double or double[] depending on whether the
// option takes more than one value.
// A double in the range -32768-32767.9999 with a resolution of 1/65535.
// The <code>value</code> property will be double or double[] depending
// on whether the option takes more than one value. Double values that
// can't be exactly represented will be rounded to the available range
// and precision.
FIXED,
// A sequence of any bytes except NUL ('\0'). <code>value</code> will be a
// DOMString.
// A sequence of any bytes except NUL ('\0'). The <code>value</code>
// property will be a DOMString.
STRING,
// Hardware button or toggle. No value.
// An option of this type has no value. Instead, setting an option of
// this type causes an option-specific side effect in the scanner
// driver. For example, a button-typed option could be used by a
// scanner driver to provide a means to select default values or to
// tell an automatic document feeder to advance to the next sheet of
// paper.
BUTTON,
// Grouping option. No value. This is included for compatibility, but
// will not normally be returned in <code>ScannerOption</code> values. Use
// Grouping option. No value. This is included for compatibility, but
// will not normally be returned in <code>ScannerOption</code> values. Use
// <code>getOptionGroups()</code> to retrieve the list of groups with their
// member options.
GROUP
};
// The unit of measurement for an option. This is the same set of units as
// SANE_Unit.
[nodoc] enum OptionUnit {
// Value is a unitless number, e.g. threshold.
// Indicates the data type for $(ref:ScannerOption.unit).
enum OptionUnit {
// The value is a unitless number. For example, it can be a threshold.
UNITLESS,
// Value is a number of pixels, e.g., scan dimensions.
// The value is a number of pixels, for example, scan dimensions.
PIXEL,
// Value is the number of bits, e.g., color depth.
// The value is the number of bits, for example, color depth.
BIT,
// Value is measured in millimeters, e.g., scan dimensions.
// The value is measured in millimeters, for example, scan dimensions.
MM,
// Value is measured in dots per inch, e.g., resolution.
// The value is measured in dots per inch, for example, resolution.
DPI,
// Value is a percent, e.g., brightness.
// The value is a percent, for example, brightness.
PERCENT,
// Value is measured in microseconds, e.g., exposure time.
// The value is measured in microseconds, for example, exposure time.
MICROSECOND
};
// The type of constraint represented by an OptionConstraint.
[nodoc] enum ConstraintType {
// Constraint represents a range of <code>OptionType.INT</code> values.
// <code>min</code>, <code>max</code>, and <code>quant</code> will be
// <code>long</code>, and <code>list</code> will be unset.
// The data type of constraint represented by an $(ref:OptionConstraint).
enum ConstraintType {
// The constraint on a range of <code>OptionType.INT</code> values.
// The <code>min</code>, <code>max</code>, and <code>quant</code> properties
// of <code>OptionConstraint</code> will be <code>long</code>, and its
// <code>list</code> propety will be unset.
INT_RANGE,
// Constraint represents a range of <code>OptionType.FIXED</code> values.
// <code>min</code>, <code>max</code>, and <code>quant</code> will be
// <code>double</code>, and <code>list</code> will be unset.
// The constraint on a range of <code>OptionType.FIXED</code> values.
// The <code>min</code>, <code>max</code>, and <code>quant</code> properties
// of <code>OptionConstraint</code> will be <code>double</code>, and its
// <code>list</code> property will be unset.
FIXED_RANGE,
// Constraint represents a specific list of <code>OptionType.INT</code>
// values. <code>list</code> will contain <code>long</code> values, and
// the other fields will be unset.
// The constraint on a specific list of <code>OptionType.INT</code>
// values. The <code>OptionConstraint.list</code> property will contain
// <code>long</code> values, and the other properties will be unset.
INT_LIST,
// Constraint represents a specific list of <code>OptionType.FIXED</code>
// values. <code>list</code> will contain <code>double</code> values, and
// the other fields will be unset.
// The constraint on a specific list of <code>OptionType.FIXED</code>
// values. The <code>OptionConstraint.list</code> property will contain
// <code>double</code> values, and the other properties will be unset.
FIXED_LIST,
// Constraint represents a specific list of <code>OptionType.STRING</code>
// values. <code>list</code> will contain <code>DOMString</code> values,
// and the other fields will be unset.
// The constraint on a specific list of <code>OptionType.STRING</code>
// values. The <code>OptionConstraint.list</code> property will contain
// <code>DOMString</code> values, and the other properties will be unset.
STRING_LIST
};
// <code>OptionConstraint</code> represents the same set of value constraints
// as SANE_Constraint_Type, with the exception that an unconstrained value is
// represented by a lack of constraint rather than a special
// SANE_CONSTRAINT_NONE value.
[nodoc] dictionary OptionConstraint {
// The specific values for the $(ref:ConstraintType) structure.
// An unconstrained value is represented by a lack of constraints;
// there is no separate <code>ConstraintType</code> value to indicate an
// unconstrained value.
dictionary OptionConstraint {
ConstraintType type;
(long or double)? min;
(long or double)? max;
@@ -222,70 +230,72 @@ namespace documentScan {
};
// How an option can be changed.
[nodoc] enum Configurability {
// Option is read-only and cannot be changed.
enum Configurability {
// The option is read-only.
NOT_CONFIGURABLE,
// Option can be set in software.
// The option can be set in software.
SOFTWARE_CONFIGURABLE,
// Option can be set by the user toggling/pushing a hardware button.
// The option can be set by the user toggling or pushing a button on
// the scanner.
HARDWARE_CONFIGURABLE
};
// A self-describing configurable scanner option and current value, in the
// same style as SANE's SANE_Option_Descriptor and sane_control_option().
[nodoc] dictionary ScannerOption {
// Option name using lowercase a-z, numbers, and dashes.
// A self-describing configurable scanner option and its current value.
dictionary ScannerOption {
// The option name using lowercase ASCII letters, numbers, and dashes.
// Diacritics are not allowed.
DOMString name;
// Printable one-line title.
// A printable one-line title.
DOMString title;
// Longer description of the option.
// A longer description of the option.
DOMString description;
// The type that <code>value</code> will contain and that is needed for
// setting this option.
// The data type contained in the <code>value</code> property, which
// is needed for setting this option.
OptionType type;
// Unit of measurement for this option.
// The unit of measurement for this option.
OptionUnit unit;
// Current value of the option if relevant. Note the type passed here must
// match the type specified in <code>type</code>.
// The current value of the option, if relevant. Note that the data
// type of this property must match the data type specified in
// <code>type</code>.
(boolean or double or double[] or long or long[] or DOMString)? value;
// Constraint on possible values.
// Defines $(ref:OptionConstraint) on the current scanner option.
OptionConstraint? constraint;
// Can be detected from software.
// Indicates that this option can be detected from software.
boolean isDetectable;
// Whether/how the option can be changed.
// Indicates whether and how the option can be changed.
Configurability configurability;
// Can be automatically set by the backend.
// Can be automatically set by the scanner driver.
boolean isAutoSettable;
// Emulated by the backend if true.
// Emulated by the scanner driver if true.
boolean isEmulated;
// Option is active and can be set/retrieved. If false, the
// <code>value</code> field will not be set.
// Indicates the option is active and can be set or retrieved. If false,
// the <code>value</code> property will not be set.
boolean isActive;
// UI should not display this option by default.
// Indicates that the UI should not display this option by default.
boolean isAdvanced;
// Option is used for internal configuration and should never be displayed
// in the UI.
// Indicates that the option is used for internal configuration and
// should never be displayed in the UI.
boolean isInternal;
};
// A set of criteria passed to <code>getScannerList()</code>. Only devices
// A set of criteria passed to <code>getScannerList()</code>. Only devices
// that match all of the criteria will be returned.
[nodoc] dictionary DeviceFilter {
dictionary DeviceFilter {
// Only return scanners that are directly attached to the computer.
boolean? local;
@@ -293,309 +303,352 @@ namespace documentScan {
boolean? secure;
};
// OptionGroup is a group containing a list of option names. The groups and
// their contents are determined by the backend and do not have any defined
// semantics or consistent membership. This structure is primarily intended
// for UI layout assistance; it does not affect the individual option
// Contains a list of option names. The groups and their contents are
// determined by the scanner driver and do not have any defined semantics
// or consistent membership. This structure is primarily intended
// for UI layout assistance; it does not affect individual option
// behaviors.
[nodoc] dictionary OptionGroup {
// Printable title, e.g. "Geometry options".
dictionary OptionGroup {
// Provides a printable title, for example "Geometry options".
DOMString title;
// Names of contained options, in backend-provided order.
// An array of option names in driver-provided order.
DOMString[] members;
};
// The response from <code>getScannerList()</code>.
[nodoc] dictionary GetScannerListResponse {
// The backend's enumeration result. Note that partial results could be
// The response from $(ref:getScannerList).
dictionary GetScannerListResponse {
// The enumeration result. Note that partial results could be
// returned even if this indicates an error.
OperationResult result;
// A possibly-empty list of scanners that match the provided
// <code>DeviceFilter</code>.
// $(ref:DeviceFilter).
ScannerInfo[] scanners;
};
// The response from <code>openScanner()</code>.
[nodoc] dictionary OpenScannerResponse {
// Same scanner ID passed to <code>openScanner()</code>.
// The response from $(ref:openScanner).
dictionary OpenScannerResponse {
// The scanner ID passed to <code>openScanner()</code>.
DOMString scannerId;
// Backend result of opening the scanner.
// The result of opening the scanner. If the value of this is
// <code>SUCCESS</code>, the <code>scannerHandle</code> and
// <code>options</code> properties will be populated.
OperationResult result;
// If <code>result</code> is <code>OperationResult.SUCCESS</code>, a handle
// to the scanner that can be used for further operations.
// If <code>result</code> is <code>SUCCESS</code>, a
// handle to the scanner that can be used for further operations.
DOMString? scannerHandle;
// If <code>result</code> is <code>OperationResult.SUCCESS</code>, a
// key-value mapping from option names to <code>ScannerOption</code>.
// If <code>result</code> is <code>SUCCESS</code>,
// provides a key-value mapping where the key is a device-specific
// option and the value is an instance of $(ref:ScannerOption).
object? options;
};
// The response from <code>getOptionGroups()</code>.
[nodoc] dictionary GetOptionGroupsResponse {
// Same scanner handle passed to <code>getOptionGroups()</code>.
// The response from $(ref:getOptionGroups).
dictionary GetOptionGroupsResponse {
// The same scanner handle as was passed to $(ref:getOptionGroups).
DOMString scannerHandle;
// The backend's result of getting the option groups.
// The result of getting the option groups. If the value of this is
// <code>SUCCESS</code>, the <code>groups</code> property will be
// populated.
OperationResult result;
// If <code>result</code> is <code>OperationResult.SUCCESS</code>, a list of
// option groups in the order supplied by the backend.
// If <code>result</code> is <code>SUCCESS</code>, provides a
// list of option groups in the order supplied by the scanner driver.
OptionGroup[]? groups;
};
// The response from <code>closeScanner()</code>.
[nodoc] dictionary CloseScannerResponse {
// Same scanner handle passed to <code>closeScanner()</code>.
dictionary CloseScannerResponse {
// The same scanner handle as was passed to $(ref:closeScanner).
DOMString scannerHandle;
// Backend result of closing the scanner. Even if this value is not
// <code>OperationResult.SUCCESS</code>, the handle will be invalid and
// The result of closing the scanner. Even if this value is not
// <code>SUCCESS</code>, the handle will be invalid and
// should not be used for any further operations.
OperationResult result;
};
// A subset of <code>ScannerOption</code> that contains enough information to
// set an option to a new value.
[nodoc] dictionary OptionSetting {
// Name of the option to set.
// Passed to $(ref:setOptions) to set an option to $(ref:ScannerOption) to
// a new value.
dictionary OptionSetting {
// Indicates the name of the option to set.
DOMString name;
// Type of the option. The requested type must match the real type of the
// underlying option.
// Indicates the data type of the option. The requested data type must
// match the real data type of the underlying option.
OptionType type;
// Value to set. Leave unset to request automatic setting for options that
// have <code>autoSettable</code> enabled. The type supplied for
// <code>value</code> must match <code>type</code>.
// Indicates the value to set. Leave unset to request automatic setting for
// options that have <code>autoSettable</code> enabled. The data type
// supplied for <code>value</code> must match <code>type</code>.
(boolean or double or double[] or long or long[] or DOMString)? value;
};
// The result of setting an individual option. Each individual option
// supplied to <code>setOptions()</code> produces a separate result on the
// backend due to things like rounding and constraints.
[nodoc] dictionary SetOptionResult {
// Name of the option that was set.
// supplied to <code>setOptions()</code> produces a separate result
// due to things like rounding and constraints.
dictionary SetOptionResult {
// Indicates the name of the option that was set.
DOMString name;
// Backend result of setting the option.
// Indicates the result of setting the option.
OperationResult result;
};
// The response from a call to <code>setOptions()</code>.
[nodoc] dictionary SetOptionsResponse {
// The same scanner handle passed to <code>setOptions()</code>.
// The response from a call to $(ref:setOptions).
dictionary SetOptionsResponse {
// Provides the scanner handle passed to <code>setOptions()</code>.
DOMString scannerHandle;
// One result per passed-in <code>OptionSetting</code>.
// An array of results, one each for every passed-in
// <code>OptionSetting</code>.
SetOptionResult[] results;
// Updated key-value mapping from option names to
// <code>ScannerOption</code> containing the new configuration after
// attempting to set all supplied options. This has the same structure as
// the <code>options</code> field in <code>OpenScannerResponse</code>.
// An updated key-value mapping from option names to
// $(ref:ScannerOption) values containing the new configuration after
// attempting to set all supplied options. This has the same structure as
// the <code>options</code> property in $(ref:OpenScannerResponse).
//
// This field will be set even if some options were not set successfully,
// but will be unset if retrieving the updated configuration fails (e.g.,
// if the scanner is disconnected in the middle).
// This property will be set even if some options were not set successfully,
// but will be unset if retrieving the updated configuration fails (for
// example, if the scanner is disconnected in the middle of scanning).
object? options;
};
// Used to specify options for <code>startScan()</code>.
[nodoc] dictionary StartScanOptions {
// MIME type to return scanned data in.
// Specifies options for $(ref:startScan).
dictionary StartScanOptions {
// Specifies the MIME type to return scanned data in.
DOMString format;
// If a non-zero value is specified, limits the maximum scanned bytes
// returned in a single $(ref:readScanData) response to that value. The
// smallest allowed value is 32768 (32 KB). If this property is not
// specified, the size of a returned chunk may be as large as the entire
// scanned image.
long? maxReadSize;
};
// The response from <code>startScan()</code>.
[nodoc] dictionary StartScanResponse {
// The same scanner handle that was passed to <code>startScan()</code>.
dictionary StartScanResponse {
// Provides the same scanner handle that was passed to
// <code>startScan()</code>.
DOMString scannerHandle;
// The backend's start scan result.
// The result of starting a scan. If the value of this is
// <code>SUCCESS</code>, the <code>job</code> property will be populated.
OperationResult result;
// If <code>result</code> is <code>OperationResult.SUCCESS</code>, a handle
// that can be used to read scan data or cancel the job.
// If <code>result</code> is <code>SUCCESS</code>, provides a
// handle that can be used to read scan data or cancel the job.
DOMString? job;
};
// The response from <code>cancelScan()</code>.
[nodoc] dictionary CancelScanResponse {
// The same job handle that was passed to <code>cancelScan()</code>.
dictionary CancelScanResponse {
// Provides the same job handle that was passed to
// <code>cancelScan()</code>.
DOMString job;
// The backend's cancel scan result.
// The backend's cancel scan result. If the result is
// <code>OperationResult.SUCCESS</code> or
// <code>OperationResult.CANCELLED</code>, the scan has been cancelled and
// the scanner is ready to start a new scan. If the result is
// <code>OperationResult.DEVICE_BUSY </code>, the scanner is still
// processing the requested cancellation; the caller should wait a short
// time and try the request again. Other result values indicate a permanent
// error that should not be retried.
OperationResult result;
};
// The response from <code>readScanData()</code>.
[nodoc] dictionary ReadScanDataResponse {
// Same job handle passed to <code>readScanData()</code>.
// The response from $(ref:readScanData).
dictionary ReadScanDataResponse {
// Provides the job handle passed to <code>readScanData()</code>.
DOMString job;
// The backend result of reading data. If this is
// <code>OperationResult.SUCCESS</code>, <code>data</code> will contain the
// next (possibly zero-length) chunk of image data that was ready for
// reading. If this is <code>OperationResult.EOF</code>, <code>data</code>
// will contain the final chunk of image data.
// The result of reading data. If its value is
// <code>SUCCESS</code>, then <code>data</code> contains the
// <em>next</em> (possibly zero-length) chunk of image data that is ready
// for reading. If its value is <code>EOF</code>, the <code>data</code>
// contains the <em>last</em> chunk of image data.
OperationResult result;
// If result is <code>OperationResult.SUCCESS</code>, the next chunk of
// If <code>result</code> is <code>SUCCESS</code>, contains
// the <em>next</em> chunk of scanned image data. If <code>result</code> is
// <code>EOF</code>, contains the <em>last</em> chunk of
// scanned image data.
ArrayBuffer? data;
// If result is <code>OperationResult.SUCCESS</code>, an estimate of how
// much of the total scan data has been delivered so far, in the range
// 0-100.
// If <code>result</code> is <code>SUCCESS</code>, an estimate of
// how much of the total scan data has been delivered so far, in the range
// 0 to 100.
long? estimatedCompletion;
};
// Callback from the <code>scan</code> method.
// |result| The results from the scan, if successful.
// Otherwise will return null and set runtime.lastError.
// Callback from the $(ref:scan) method.
// |result| Provides the results from the scan, if successful.
// Otherwise, this value will be null and $(ref:runtime.lastError)
// will be set.
callback ScanCallback = void (ScanResults result);
// Callback from the <code>getScannerList</code> method.
// Callback from the $(ref:getScannerList) method.
// |response| The response from enumeration, if the call was valid.
// Otherwise will return null and set runtime.lastError.
[nodoc] callback GetScannerListCallback = void (GetScannerListResponse response);
// Otherwise, this value will be null and $(ref:runtime.lastError)
// will be set.
callback GetScannerListCallback = void (GetScannerListResponse response);
// Callback from the <code>openScanner</code> method.
// Callback from the $(ref:openScanner) method.
// |response| The response from opening the scanner, if the call was valid.
// Otherwise will return null and set runtime.lastError.
[nodoc] callback OpenScannerCallback = void (OpenScannerResponse response);
// Otherwise, this value will be null and $(ref:runtime.lastError)
// will be set.
callback OpenScannerCallback = void (OpenScannerResponse response);
// Callback from the <code>getOptionGroups</code> method.
// Callback from the $(ref:getOptionGroups) method.
// |response| The response from getting the option groups, if the call was
// valid. Otherwise will return null and set runtime.lastError.
[nodoc] callback GetOptionGroupsCallback =
// valid. Otherwise, this value will be null and $(ref:runtime.lastError)
// will be set.
callback GetOptionGroupsCallback =
void (GetOptionGroupsResponse response);
// Callback from the <code>closeScanner</code> method.
// Callback from the $(ref:closeScanner) method.
// |response| The response from closing the scanner, if the call was valid.
// Otherwise will return null and set runtime.lastError.
[nodoc] callback CloseScannerCallback = void (CloseScannerResponse response);
// Otherwise, this value will be null and $(ref:runtime.lastError)
// will be set.
callback CloseScannerCallback = void (CloseScannerResponse response);
// Callback from the <code>setOptions</code> method.
// Callback from the $(ref:setOptions) method.
// |response| The response from setting the options, if the call was valid.
// Otherwise will return null and set runtime.lastError.
[nodoc] callback SetOptionsCallback = void (SetOptionsResponse response);
// Otherwise, this value will be null and $(ref:runtime.lastError)
// will be set.
callback SetOptionsCallback = void (SetOptionsResponse response);
// Callback from the <code>startScan</code> method.
// Callback from the $(ref:startScan) method.
// |response| The response from starting the scan, if the call was valid.
// Otherwise will return null and set runtime.lastError.
[nodoc] callback StartScanCallback = void (StartScanResponse response);
// Otherwise, this value will be null and $(ref:runtime.lastError)
// will be set.
callback StartScanCallback = void (StartScanResponse response);
// Callback from the <code>cancelScan</code> method.
// Callback from the $(ref:cancelScan) method.
// |response| The response from canceling the scan, if the call was valid.
// Otherwise will return null and set runtime.lastError.
[nodoc] callback CancelScanCallback = void (CancelScanResponse response);
// Otherwise, this value will be null and $(ref:runtime.lastError)
// will be set.
callback CancelScanCallback = void (CancelScanResponse response);
// Callback from the <code>readScanData</code> method.
// Callback from the $(ref:readScanData) method.
// |response| The response from reading the next chunk of scanned image data,
// if the call was valid. Otherwise will return null and set
// runtime.lastError.
[nodoc] callback ReadScanDataCallback = void (ReadScanDataResponse response);
// if the call was valid. Otherwise, this value will be null and
// $(ref:runtime.lastError) will be set.
callback ReadScanDataCallback = void (ReadScanDataResponse response);
interface Functions {
// Performs a document scan. On success, the PNG data will be
// sent to the callback.
// |options| : Object containing scan parameters.
// Performs a document scan and returns a Promise that resolves
// with a $(ref:ScanResults) object. If a callback is passed to
// this function, the returned data is passed to it instead.
// |options| : An object containing scan parameters.
// |callback| : Called with the result and data from the scan.
static void scan(
ScanOptions options,
ScanCallback callback);
// Gets the list of available scanners. On success, the list will be
// sent to the callback.
// |filter| : <code>DeviceFilter</code> indicating which types of scanners
// Gets the list of available scanners and returns a Promise that
// resolves with a $(ref:GetScannerListResponse) object. If a callback
// is passed to this function, returned data is passed to it instead.
// |filter| : A $(ref:DeviceFilter) indicating which types of scanners
// should be returned.
// |callback| : Called with the result and list of scanners.
[nodoc] static void getScannerList(
static void getScannerList(
DeviceFilter filter, GetScannerListCallback callback);
// Opens a scanner for exclusive access. On success, the response containing
// a scanner handle and configuration will be sent to the callback.
// |scannerId| : Scanner id previously returned from <code>getScannerList</code>
// indicating which scanner should be opened.
// Opens a scanner for exclusive access and returns a Promise that
// resolves with an $(ref:OpenScannerResponse) object. If a callback
// is passed to this function, returned data is passed to it instead.
// |scannerId| : The ID of a scanner to be opened. This value is one
// returned from a previous call to $(ref:getScannerList).
// |callback| : Called with the result.
[nodoc] static void openScanner(
static void openScanner(
DOMString scannerId, OpenScannerCallback callback);
// Gets the group names and member options from a scanner handle previously
// opened by <code>openScanner</code>.
// |scannerHandle| : Open scanner handle previously returned from
// <code>openScanner</code>.
// Gets the group names and member options from a scanner previously
// opened by $(ref:openScanner). This method returns a Promise that
// resolves with a $(ref:GetOptionGroupsResponse) object. If a callback
// is passed to this function, returned data is passed to it instead.
// |scannerHandle| : The handle of an open scanner returned from a call
// to $(ref:openScanner).
// |callback| : Called with the result.
[nodoc] static void getOptionGroups(
static void getOptionGroups(
DOMString scannerHandle, GetOptionGroupsCallback callback);
// Closes a previously opened scanner handle. A response indicating the
// outcome will be sent to the callback. Even if the response is not a
// success, the supplied handle will become invalid and should not be used
// for further operations.
// |scannerHandle| : Open scanner handle previously returned from
// <code>openScanner</code>.
// Closes the scanner with the passed in handle and returns a Promise
// that resolves with a $(ref:CloseScannerResponse) object. If a callback
// is used, the object is passed to it instead. Even if the response is
// not a success, the supplied handle becomes invalid and should not be
// used for further operations.
// |scannerHandle| : Specifies the handle of an open scanner that was
// previously returned from a call to $(ref:openScanner).
// |callback| : Called with the result.
[nodoc] static void closeScanner(
static void closeScanner(
DOMString scannerHandle, CloseScannerCallback callback);
// Sends the list of new option values in <code>options</code> as a bundle
// to be set on <code>scannerHandle</code>. Each option will be set by the
// backend the order specified. Returns a backend response indicating the
// result of each option setting and a new set of final option values after
// all options have been updated.
// |scannerHandle| : Open scanner handle previously returned from
// <code>openScanner</code>.
// |options| : A list of <code>OptionSetting</code>s that will be applied to
// <code>scannerHandle</code>.
// Sets options on the specified scanner and returns a Promise that
// resolves with a $(ref:SetOptionsResponse) object containing the
// result of trying to set every value in the order of the passed-in
// $(ref:OptionSetting) object. If a callback is used, the object is
// passed to it instead.
// |scannerHandle| : The handle of the scanner to set options on. This
// should be a value previously returned from a call to $(ref:openScanner).
// |options| : A list of <code>OptionSetting</code> objects to be applied to
// the scanner.
// |callback| : Called with the result.
[nodoc] static void setOptions(
static void setOptions(
DOMString scannerHandle, OptionSetting[] options,
SetOptionsCallback callback);
// Starts a scan using a previously opened scanner handle. A response
// indicating the outcome will be sent to the callback. If successful, the
// response will include a job handle that can be used in subsequent calls
// Starts a scan on the specified scanner and returns a Promise that
// resolves with a $(ref:StartScanResponse). If a callback is used,
// the object is passed to it instead. If the call was successful, the
// response includes a job handle that can be used in subsequent calls
// to read scan data or cancel a scan.
// |scannerHandle| : Open scanner handle previously returned from
// <code>openScanner</code>.
// |options| : <code>StartScanOptions</code> indicating what options are to
// be used for the scan. <code>StartScanOptions.format</code> must match
// one of the entries returned in the scanner's <code>ScannerInfo</code>.
// |scannerHandle| : The handle of an open scanner. This should be a value
// previously returned from a call to $(ref:openScanner).
// |options| : A $(ref:StartScanOptions) object indicating the options to
// be used for the scan. The <code>StartScanOptions.format</code> property
// must match one of the entries returned in the scanner's
// <code>ScannerInfo</code>.
// |callback| : Called with the result.
[nodoc] static void startScan(
static void startScan(
DOMString scannerHandle, StartScanOptions options,
StartScanCallback callback);
// Cancels a scan that was previously started using <code>startScan</code>.
// The response is sent to the callback.
// |job| : An active scan job previously returned from
// <code>startScan</code>.
// Cancels a started scan and returns a Promise that resolves with a
// $(ref:CancelScanResponse) object. If a callback is used, the object
// is passed to it instead.
// |job| : The handle of an active scan job previously returned from a
// call to $(ref:startScan).
// |callback| : Called with the result.
[nodoc] static void cancelScan(
static void cancelScan(
DOMString job, CancelScanCallback callback);
// Reads the next chunk of available image data from an active job handle.
// A response indicating the outcome will be sent to the callback.
// Reads the next chunk of available image data from an active job handle,
// and returns a Promise that resolves with a $(ref:ReadScanDataResponse)
// object. If a callback is used, the object is passed to it instead.
//
// It is valid for a response to have result
// <code>OperationResult.SUCCESS</code> with a zero-length
// <code>data</code> member. This means the scanner is still working but
// does not yet have additional data ready. The caller should wait a short
// time and try again.
// <aside class="note"><b>Note:</b>It is valid for a response result to be
// <code>SUCCESS</code> with a zero-length <code>data</code>
// member. This means the scanner is still working but does not yet have
// additional data ready. The caller should wait a short time and try again.
//
// When the scan job completes, the response will have the result value of
// <code>EOF</code>. This response may contain a final
// non-zero <code>data</code> member.</aside>
//
// When the scan job completes, the response will have the result
// <code>OperationResult.EOF</code>. This response may contain a final
// non-zero <code>data</code> member.
// |job| : Active job handle previously returned from
// <code>startScan</code>.
// $(ref:startScan).
// |callback| : Called with the result.
[nodoc] static void readScanData(
static void readScanData(
DOMString job, ReadScanDataCallback callback);
};
};
@@ -137,7 +137,6 @@ namespace downloads {
blockedTooLarge,
sensitiveContentWarning,
sensitiveContentBlock,
unsupportedFileType,
deepScannedFailed,
deepScannedSafe,
deepScannedOpenedDangerous,
@@ -4,8 +4,8 @@
// Use the <code>chrome.enterprise.kioskInput</code> API to change input
// settings for Kiosk sessions.
// Note: This API is only available extensions and Chrome apps installed
// by enterprise policy in ChromeOS Kiosk sessions.
// Note: This API is only available to extensions installed by enterprise
// policy in ChromeOS Kiosk sessions.
[platforms = ("chromeos"),
implemented_in = "chrome/browser/extensions/api/enterprise_kiosk_input/enterprise_kiosk_input_api.h"]
namespace enterprise.kioskInput {
@@ -416,6 +416,17 @@ enum BulkPinStage {
cannot_enable_docs_offline
};
// The default location/volume that the user should use.
// It's usually MyFiles. When SkyVault is enabled the admin might
// choose between Google Drive and OneDrive.
// NOTE: This is independent of the Downloads folder which is mostly used
// in the browser (lacros or ash).
enum DefaultLocation {
my_files,
google_drive,
onedrive
};
// These three fields together uniquely identify a task.
dictionary FileTaskDescriptor {
DOMString appId;
@@ -853,6 +864,7 @@ dictionary Preferences {
boolean driveFsBulkPinningAvailable;
boolean driveFsBulkPinningEnabled;
boolean localUserFilesAllowed;
DefaultLocation defaultLocation;
};
dictionary PreferencesChange {
@@ -1335,6 +1347,39 @@ dictionary BulkPinProgress {
boolean emptiedQueue;
};
// Represents a custom view of files to be displayed.
dictionary MaterializedView {
// Unique indentifier for the view.
long viewId;
// Name of the view displayed to the user.
DOMString name;
};
// Used by EntryData to store the file system of the entry.
dictionary FileSystemData {
// Name of the file system. Will be unique.
DOMString name;
// File system URL of the root entry of the file system.
DOMString rootUrl;
};
// Representation of an entry as a replacement for File/Directory Entries.
dictionary EntryData {
// File system URL of the entry.
DOMString entryUrl;
// If false, the entry is a file.
boolean isDirectory;
// Localized name of the entry for display.
DOMString name;
// Information about the filesystem the entry is located in.
FileSystemData filesystem;
};
// Callback that does not take arguments.
callback SimpleCallback = void();
@@ -1482,6 +1527,10 @@ callback ParseTrashInfoFilesCallback = void(ParsedTrashInfoFile[] files);
callback GetBulkPinProgressCallback = void(BulkPinProgress progress);
callback GetMaterializedViewsCallback = void(MaterializedView[] views);
callback ReadMaterializedViewCallback = void(EntryData[] files);
interface Functions {
// Cancels file selection.
static void cancelDialog();
@@ -2026,6 +2075,13 @@ interface Functions {
// drive.
[doesNotSupportPromises]
static void calculateBulkPinRequiredSpace(SimpleCallback callback);
// Returns a list of views that can be displayed to the user.
static void getMaterializedViews(GetMaterializedViewsCallback callback);
// Returns the list of entries contained in the view identified by `viewId`.
static void readMaterializedView(long viewId,
ReadMaterializedViewCallback callback);
};
// Events supported by fileManagerPrivate API. These events are broadcasted.
@@ -61,6 +61,12 @@ namespace fileSystemProvider {
DOMString id;
};
// Information relating to files that are served by a cloud file system.
dictionary CloudFileInfo {
// A tag that represents the version of the file.
DOMString? versionTag;
};
// Represents metadata of a file or a directory.
dictionary EntryMetadata {
// True if it is a directory. Must be provided if requested in
@@ -93,6 +99,11 @@ namespace fileSystemProvider {
// local files not backed by cloud storage, it should be undefined when
// requested.
CloudIdentifier? cloudIdentifier;
// Information that identifies a specific file in the underlying cloud file
// system. Must be provided if requested in <code>options</code> and the
// file is backed by cloud storage.
CloudFileInfo? cloudFileInfo;
};
// Represents a watcher.
@@ -221,6 +232,10 @@ namespace fileSystemProvider {
// Set to <code>true</code> if <code>cloudIdentifier</code> value is
// requested.
boolean cloudIdentifier;
// Set to <code>true</code> if <code>cloudFileInfo</code> value is
// requested.
boolean cloudFileInfo;
};
// Options for the $(ref:onGetActionsRequested) event.
@@ -493,6 +508,9 @@ namespace fileSystemProvider {
// The type of the change which happened to the entry.
ChangeType changeType;
// Information relating to the file if backed by a cloud file system.
CloudFileInfo? cloudFileInfo;
};
// Options for the $(ref:notify) method.
@@ -564,6 +582,10 @@ namespace fileSystemProvider {
[nocompile] callback FileDataCallback = void(
ArrayBuffer data, boolean hasMore);
// Success callback for the $(ref:onOpenFileRequested) event.
[nocompile] callback OpenFileSuccessCallback = void(
optional EntryMetadata metadata);
// A generic result callback to indicate success or failure.
callback ResultCallback = void();
@@ -683,7 +705,7 @@ namespace fileSystemProvider {
// files opened at once can be specified with <code>MountOptions</code>.
[maxListeners=1] static void onOpenFileRequested(
OpenFileRequestedOptions options,
ProviderSuccessCallback successCallback,
OpenFileSuccessCallback successCallback,
ProviderErrorCallback errorCallback);
// Raised when opening a file previously opened with
@@ -55,6 +55,14 @@ namespace fileSystemProviderInternal {
boolean hasMore,
long executionTime);
// Internal. Success callback of the <code>onOpenFileRequested</code>
// event.
static void openFileRequestedSuccess(
DOMString fileSystemId,
long requestId,
long executionTime,
optional fileSystemProvider.EntryMetadata metadata);
// Internal. Success callback of all of the operation requests, which do not
// return any value. Must be called in case of a success.
static void operationRequestedSuccess(
@@ -356,6 +356,7 @@ namespace passwordsPrivate {
callback GetUrlCollectionCallback = void(UrlCollection urlCollection);
callback CredentialsWithReusedPasswordCallback =
void(PasswordUiEntryList[] entries);
callback PasswordManagerPinAvailableCallback = void(boolean available);
interface Functions {
// Function that logs that the Passwords page was accessed from the Chrome
@@ -549,6 +550,13 @@ namespace passwordsPrivate {
// Opens a file with exported passwords in the OS shell.
static void showExportedFileInShell(DOMString file_path);
// Shows a dialog for changing the Password Manager PIN.
static void changePasswordManagerPin();
// Checks whether changing Password Manager PIN is possible.
static void isPasswordManagerPinAvailable(
PasswordManagerPinAvailableCallback callback);
};
interface Events {
@@ -35,7 +35,6 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/crash_keys.h"
#include "chrome/common/pdf_util.h"
#include "chrome/common/pepper_permission_util.h"
#include "chrome/common/ppapi_utils.h"
#include "chrome/common/profiler/thread_profiler.h"
@@ -61,6 +60,7 @@
#include "chrome/renderer/net_benchmarking_extension.h"
#include "chrome/renderer/plugins/non_loadable_plugin_placeholder.h"
#include "chrome/renderer/plugins/pdf_plugin_placeholder.h"
#include "chrome/renderer/supervised_user/supervised_user_error_page_controller_delegate_impl.h"
#include "chrome/renderer/trusted_vault_encryption_keys_extension.h"
#include "chrome/renderer/url_loader_throttle_provider_impl.h"
#include "chrome/renderer/v8_unwinder.h"
@@ -78,6 +78,7 @@
#include "components/content_capture/renderer/content_capture_sender.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/continuous_search/renderer/search_result_extractor_impl.h"
#include "components/country_codes/country_codes.h"
#include "components/dom_distiller/content/renderer/distillability_agent.h"
#include "components/dom_distiller/content/renderer/distiller_js_render_frame_observer.h"
#include "components/dom_distiller/core/dom_distiller_features.h"
@@ -86,6 +87,7 @@
#include "components/error_page/common/error.h"
#include "components/error_page/common/localized_error.h"
#include "components/feed/buildflags.h"
#include "components/feed/feed_feature_list.h"
#include "components/grit/components_scaled_resources.h"
#include "components/heap_profiling/in_process/heap_profiler_controller.h"
#include "components/history_clusters/core/config.h"
@@ -101,6 +103,7 @@
#include "components/paint_preview/buildflags/buildflags.h"
#include "components/password_manager/core/common/password_manager_features.h"
#include "components/pdf/common/constants.h"
#include "components/pdf/common/pdf_util.h"
#include "components/permissions/features.h"
#include "components/safe_browsing/buildflags.h"
#include "components/safe_browsing/content/renderer/threat_dom_details.h"
@@ -108,7 +111,6 @@
#include "components/subresource_filter/content/renderer/subresource_filter_agent.h"
#include "components/subresource_filter/content/renderer/unverified_ruleset_dealer.h"
#include "components/subresource_filter/core/common/common_features.h"
#include "components/supervised_user/core/common/buildflags.h"
#include "components/variations/net/variations_http_headers.h"
#include "components/variations/variations_switches.h"
#include "components/version_info/version_info.h"
@@ -251,10 +253,6 @@
#endif // BUILDFLAG(HAS_SPELLCHECK_PANEL)
#endif // BUILDFLAG(ENABLE_SPELLCHECK)
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
#include "chrome/renderer/supervised_user/supervised_user_error_page_controller_delegate_impl.h"
#endif
#if BUILDFLAG(ENABLE_LIBRARY_CDMS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID)
#include "chrome/renderer/media/chrome_key_systems.h"
#endif
@@ -656,16 +654,14 @@ void ChromeContentRendererClient::RenderFrameCreated(
const bool search_result_extractor_enabled =
render_frame->IsMainFrame() &&
page_content_annotations::features::IsPageContentAnnotationEnabled();
page_content_annotations::features::ShouldExtractRelatedSearches();
if (search_result_extractor_enabled) {
continuous_search::SearchResultExtractorImpl::Create(render_frame);
}
new NetErrorHelper(render_frame);
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
new SupervisedUserErrorPageControllerDelegateImpl(render_frame);
#endif
if (!render_frame->IsMainFrame()) {
auto* main_frame_no_state_prefetch_helper =
@@ -774,7 +770,7 @@ void ChromeContentRendererClient::RenderFrameCreated(
#endif
#if BUILDFLAG(ENABLE_FEED_V2)
if (render_frame->IsMainFrame() &&
base::FeatureList::IsEnabled(feed::kWebFeed)) {
feed::IsWebFeedEnabledForLocale(country_codes::GetCurrentCountryCode())) {
new feed::RssLinkReader(render_frame, registry);
}
#endif
@@ -1357,10 +1353,8 @@ void ChromeContentRendererClient::PrepareErrorPage(
http_method == "POST", std::move(alternative_error_page_info),
error_html);
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
SupervisedUserErrorPageControllerDelegateImpl::Get(render_frame)
->PrepareForErrorPage();
#endif
}
void ChromeContentRendererClient::PrepareErrorPageForHttpStatusError(
@@ -1589,11 +1583,12 @@ ChromeContentRendererClient::CreateWebSocketHandshakeThrottleProvider() {
browser_interface_broker_.get());
}
std::unique_ptr<media::KeySystemSupportObserver>
std::unique_ptr<media::KeySystemSupportRegistration>
ChromeContentRendererClient::GetSupportedKeySystems(
content::RenderFrame* render_frame,
media::GetSupportedKeySystemsCB cb) {
#if BUILDFLAG(ENABLE_LIBRARY_CDMS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID)
return GetChromeKeySystems(std::move(cb));
return GetChromeKeySystems(render_frame, std::move(cb));
#else
std::move(cb).Run({});
return nullptr;
@@ -11,6 +11,7 @@
#include <optional>
#include <set>
#include <string>
#include <string_view>
#include <tuple>
#include <utility>
#include <vector>
@@ -37,7 +38,6 @@
#include "base/observer_list.h"
#include "base/process/process.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -179,6 +179,7 @@
#include "third_party/blink/public/mojom/input/input_handler.mojom-shared.h"
#include "third_party/blink/public/mojom/mediastream/media_stream.mojom-shared.h"
#include "third_party/blink/public/mojom/mediastream/media_stream.mojom.h"
#include "third_party/blink/public/mojom/page/draggable_region.mojom.h"
#include "third_party/blink/public/mojom/window_features/window_features.mojom.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/accessibility/ax_tree_combiner.h"
@@ -272,8 +273,8 @@ BASE_FEATURE(kCrashOnDanglingBrowserContext,
using LifecycleState = RenderFrameHost::LifecycleState;
using LifecycleStateImpl = RenderFrameHostImpl::LifecycleStateImpl;
using AttributionReportingOsReportType =
ContentBrowserClient::AttributionReportingOsReportType;
using AttributionReportingOsRegistrar =
ContentBrowserClient::AttributionReportingOsRegistrar;
base::LazyInstance<base::RepeatingCallbackList<void(WebContents*)>>::
DestructorAtExit g_created_callbacks = LAZY_INSTANCE_INITIALIZER;
@@ -452,40 +453,47 @@ float GetDeviceScaleAdjustment(int min_width) {
}
#endif
// Used to attach the "set of fullscreen contents" to a browser context. Storing
// sets of WebContents on their browser context is done for two reasons. One,
// Store a set of fullscreen WebContents and metadata for the browser context.
// Storing this information on the browser context is done for two reasons. One,
// related WebContentses must necessarily share a browser context, so this saves
// lookup time by restricting to one specific browser context. Two, separating
// by browser context is preemptive paranoia about keeping things separate.
class FullscreenContentsHolder : public base::SupportsUserData::Data {
class FullscreenUserData : public base::SupportsUserData::Data {
public:
FullscreenContentsHolder() = default;
~FullscreenContentsHolder() override = default;
FullscreenUserData() = default;
~FullscreenUserData() override = default;
FullscreenContentsHolder(const FullscreenContentsHolder&) = delete;
FullscreenContentsHolder& operator=(const FullscreenContentsHolder&) = delete;
FullscreenUserData(const FullscreenUserData&) = delete;
FullscreenUserData& operator=(const FullscreenUserData&) = delete;
base::flat_set<raw_ptr<WebContentsImpl, CtnExperimental>>* set() {
return &set_;
}
std::map<url::Origin, base::TimeTicks>* last_exits() { return &last_exits_; }
private:
base::flat_set<raw_ptr<WebContentsImpl, CtnExperimental>> set_;
// Track latest exits by origin to briefly block re-entry without a gesture.
std::map<url::Origin, base::TimeTicks> last_exits_;
};
const char kFullscreenContentsSet[] = "fullscreen-contents";
const char kFullscreenUserData[] = "fullscreen-user-data";
FullscreenUserData* GetFullscreenUserData(BrowserContext* browser_context) {
auto* set_holder = static_cast<FullscreenUserData*>(
browser_context->GetUserData(kFullscreenUserData));
if (!set_holder) {
auto new_holder = std::make_unique<FullscreenUserData>();
set_holder = new_holder.get();
browser_context->SetUserData(kFullscreenUserData, std::move(new_holder));
}
return set_holder;
}
base::flat_set<raw_ptr<WebContentsImpl, CtnExperimental>>*
FullscreenContentsSet(BrowserContext* browser_context) {
auto* set_holder = static_cast<FullscreenContentsHolder*>(
browser_context->GetUserData(kFullscreenContentsSet));
if (!set_holder) {
auto new_holder = std::make_unique<FullscreenContentsHolder>();
set_holder = new_holder.get();
browser_context->SetUserData(kFullscreenContentsSet, std::move(new_holder));
}
return set_holder->set();
return GetFullscreenUserData(browser_context)->set();
}
// Returns true if `host` has the Window Management permission granted.
@@ -564,7 +572,7 @@ class DefaultColorProviderSource : public ui::ColorProviderSource,
GetColorProviderKey());
}
const ui::RendererColorMap GetRendererColorMap(
ui::RendererColorMap GetRendererColorMap(
ui::ColorProviderKey::ColorMode color_mode,
ui::ColorProviderKey::ForcedColors forced_colors) const override {
auto key = GetColorProviderKey();
@@ -747,6 +755,18 @@ WebContentsImpl* WebContentsImpl::FromRenderWidgetHostImpl(
return static_cast<WebContentsImpl*>(rwh->delegate());
}
std::optional<double> WebContentsImpl::AdjustedChildZoom(
const RenderWidgetHostViewChildFrame* render_widget) {
// <webview> permits zoom level to be set programmatically by script:
// https://developer.chrome.com/docs/apps/reference/webviewTag#method-setZoom
if (IsGuest() && GetRenderWidgetHostView() == render_widget) {
return GetPendingPageZoomLevel();
}
// Signals zoom level should be inherited from the parent
return std::nullopt;
}
void WebContents::SetScreenOrientationDelegate(
ScreenOrientationDelegate* delegate) {
ScreenOrientationProvider::SetDelegate(delegate);
@@ -1922,6 +1942,12 @@ void WebContentsImpl::SetAccessibilityMode(ui::AXMode mode) {
});
}
void WebContentsImpl::DidCapturedSurfaceControl() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
observers_.NotifyObservers(&WebContentsObserver::OnCapturedSurfaceControl);
}
void WebContentsImpl::ResetAccessibility() {
// In contrast to the above, do not bother with frames in the back-forward
// cache since the reset is intended to generate new trees for observers of
@@ -2267,6 +2293,10 @@ bool WebContentsImpl::IsWaitingForResponse() {
return ongoing_navigation_request != nullptr;
}
bool WebContentsImpl::HasUncommittedNavigationInPrimaryMainFrame() {
return primary_frame_tree_.root()->HasNavigation();
}
const net::LoadStateWithParam& WebContentsImpl::GetLoadState() {
return load_state_;
}
@@ -3958,8 +3988,10 @@ void WebContentsImpl::ExitFullscreenMode(bool will_cause_resize) {
static_cast<RenderWidgetHostViewBase*>(view)->ExitFullscreenMode();
}
// Block automatic fullscreen temporarily, e.g. match kActivationLifespan.
block_automatic_fullscreen_until_ = base::TimeTicks::Now() + base::Seconds(5);
GetFullscreenUserData(GetBrowserContext())
->last_exits()
->insert_or_assign(GetPrimaryMainFrame()->GetLastCommittedOrigin(),
base::TimeTicks::Now());
if (delegate_) {
// This may spin the message loop and destroy this object crbug.com/1506535
@@ -4085,7 +4117,8 @@ ui::WindowShowState WebContentsImpl::GetWindowShowState() {
: ui::SHOW_STATE_DEFAULT;
}
DevicePostureProviderImpl* WebContentsImpl::GetDevicePostureProvider() {
blink::mojom::DevicePostureProvider*
WebContentsImpl::GetDevicePostureProvider() {
return DevicePostureProviderImpl::GetOrCreate(this);
}
@@ -4388,6 +4421,7 @@ bool WebContentsImpl::RequestKeyboardLock(
// KeyboardLock is only supported when called by the top-level browsing
// context and is not supported in embedded content scenarios.
if (GetOuterWebContents()) {
render_widget_host->GotResponseToKeyboardLockRequest(false);
return false;
}
@@ -5379,7 +5413,10 @@ void WebContentsImpl::ResizeDueToAutoResize(
}
}
WebContents* WebContentsImpl::OpenURL(const OpenURLParams& params) {
WebContents* WebContentsImpl::OpenURL(
const OpenURLParams& params,
base::OnceCallback<void(content::NavigationHandle&)>
navigation_handle_callback) {
TRACE_EVENT1("content", "WebContentsImpl::OpenURL", "url", params.url);
#if DCHECK_IS_ON()
DCHECK(params.Valid());
@@ -5391,6 +5428,7 @@ WebContents* WebContentsImpl::OpenURL(const OpenURLParams& params) {
// time, navigations, including the initial one, that goes through OpenURL
// should be delayed until embedder is ready to resume loading.
delayed_open_url_params_ = std::make_unique<OpenURLParams>(params);
delayed_navigation_handle_callback_ = std::move(navigation_handle_callback);
// If there was a navigation deferred when creating the window through
// CreateNewWindow, drop it in favor of this navigation.
@@ -5443,7 +5481,8 @@ WebContents* WebContentsImpl::OpenURL(const OpenURLParams& params) {
}
}
WebContents* new_contents = delegate_->OpenURLFromTab(this, params);
WebContents* new_contents = delegate_->OpenURLFromTab(
this, params, std::move(navigation_handle_callback));
if (source_render_frame_host && params.source_site_instance) {
CHECK_EQ(source_render_frame_host->GetSiteInstance(),
@@ -6063,23 +6102,20 @@ bool WebContentsImpl::GotResponseToKeyboardLockRequest(bool allowed) {
OPTIONAL_TRACE_EVENT1("content",
"WebContentsImpl::GotResponseToKeyboardLockRequest",
"allowed", allowed);
if (!keyboard_lock_widget_) {
return false;
}
if (WebContentsImpl::FromRenderWidgetHostImpl(keyboard_lock_widget_) !=
this) {
NOTREACHED();
return false;
}
// KeyboardLock is only supported when called by the top-level browsing
// context and is not supported in embedded content scenarios.
if (GetOuterWebContents()) {
keyboard_lock_widget_->GotResponseToKeyboardLockRequest(false);
return false;
}
keyboard_lock_widget_->GotResponseToKeyboardLockRequest(allowed);
return true;
}
@@ -6279,13 +6315,21 @@ void WebContentsImpl::ResumeLoadingCreatedWebContents() {
"WebContentsImpl::ResumeLoadingCreatedWebContents");
if (delayed_load_url_params_.get()) {
DCHECK(!delayed_open_url_params_);
GetController().LoadURLWithParams(*delayed_load_url_params_.get());
base::WeakPtr<NavigationHandle> navigation =
GetController().LoadURLWithParams(*delayed_load_url_params_.get());
if (delayed_navigation_handle_callback_ && navigation) {
std::move(delayed_navigation_handle_callback_).Run(*navigation);
}
delayed_navigation_handle_callback_.Reset();
delayed_load_url_params_.reset(nullptr);
return;
}
CHECK(!delayed_navigation_handle_callback_);
if (delayed_open_url_params_.get()) {
OpenURL(*delayed_open_url_params_.get());
OpenURL(*delayed_open_url_params_.get(),
std::move(delayed_navigation_handle_callback_));
delayed_open_url_params_.reset(nullptr);
return;
}
@@ -6552,6 +6596,14 @@ void WebContentsImpl::DidFailLoadWithError(
render_frame_host, url, error_code);
}
void WebContentsImpl::DraggableRegionsChanged(
const std::vector<blink::mojom::DraggableRegionPtr>& regions) {
if (!GetDelegate()) {
return;
}
GetDelegate()->DraggableRegionsChanged(regions, this);
}
void WebContentsImpl::NotifyChangedNavigationState(
InvalidateTypes changed_flags) {
NotifyNavigationStateChanged(changed_flags);
@@ -7020,14 +7072,28 @@ std::optional<SkColor> WebContentsImpl::GetBaseBackgroundColor() {
blink::ColorProviderColorMaps WebContentsImpl::GetColorProviderColorMaps()
const {
const auto* source = GetColorProviderSource();
const auto* color_mode_source = GetColorProviderSource();
// Unlike preferred color scheme, ForcedColors should always use the
// default color provider source, which reflects the NativeTheme web instance.
// This is because the Page colors feature only modifies the Forced colors
// mode for web without affecting the UI.
const auto* forced_colors_source = DefaultColorProviderSource::GetInstance();
ui::ColorProviderKey::ForcedColors forced_colors =
forced_colors_source->GetForcedColors();
if (forced_colors == ui::ColorProviderKey::ForcedColors::kNone) {
forced_colors = ui::ColorProviderKey::ForcedColors::kActive;
}
return blink::ColorProviderColorMaps{
source->GetRendererColorMap(ui::ColorProviderKey::ColorMode::kLight,
ui::ColorProviderKey::ForcedColors::kNone),
source->GetRendererColorMap(ui::ColorProviderKey::ColorMode::kDark,
ui::ColorProviderKey::ForcedColors::kNone),
source->GetRendererColorMap(source->GetColorMode(),
ui::ColorProviderKey::ForcedColors::kActive)};
color_mode_source->GetRendererColorMap(
ui::ColorProviderKey::ColorMode::kLight,
ui::ColorProviderKey::ForcedColors::kNone),
color_mode_source->GetRendererColorMap(
ui::ColorProviderKey::ColorMode::kDark,
ui::ColorProviderKey::ForcedColors::kNone),
forced_colors_source->GetRendererColorMap(
forced_colors_source->GetColorMode(), forced_colors)};
}
void WebContentsImpl::PrintCrossProcessSubframe(
@@ -7713,7 +7779,7 @@ std::u16string NormalizeLineBreaks(const std::u16string& source) {
static const base::NoDestructor<std::u16string> kReturn(u"\r");
static const base::NoDestructor<std::u16string> kNewline(u"\n");
std::vector<base::StringPiece16> pieces;
std::vector<std::u16string_view> pieces;
for (const auto& rn_line : base::SplitStringPieceUsingSubstr(
source, *kReturnNewline, base::KEEP_WHITESPACE,
@@ -8512,6 +8578,14 @@ void WebContentsImpl::RegisterExistingOriginAsHavingDefaultIsolation(
}
}
bool WebContentsImpl::MaybeCopyContentAreaAsBitmap(
base::OnceCallback<void(const SkBitmap&)> callback) {
if (!GetDelegate()) {
return false;
}
return GetDelegate()->MaybeCopyContentAreaAsBitmap(std::move(callback));
}
void WebContentsImpl::DidChangeName(RenderFrameHostImpl* render_frame_host,
const std::string& name) {
OPTIONAL_TRACE_EVENT2("content", "WebContentsImpl::DidChangeName",
@@ -8998,6 +9072,18 @@ void WebContentsImpl::RendererUnresponsive(
return;
}
if (base::FeatureList::IsEnabled(features::kCrashReporting) &&
base::FeatureList::IsEnabled(
blink::features::kDocumentPolicyIncludeJSCallStacksInCrashReports) &&
this->GetLastCommittedURL().SchemeIsHTTPOrHTTPS()) {
RenderProcessHost* rph = render_widget_host->GetProcess();
if (rph) {
RenderProcessHostImpl* process_host =
static_cast<RenderProcessHostImpl*>(rph);
process_host->InterruptJavaScriptIsolateAndCollectCallStack();
}
}
observers_.NotifyObservers(&WebContentsObserver::OnRendererUnresponsive,
render_widget_host->GetProcess());
if (delegate_) {
@@ -10080,12 +10166,13 @@ bool WebContentsImpl::IsTransientActivationRequiredForHtmlFullscreen() {
return false;
}
// Require transient activation shortly after any related WebContents exited.
for (auto* rfhi : GetActiveTopLevelDocumentsInBrowsingContextGroup(host)) {
auto* related = WebContentsImpl::FromRenderFrameHostImpl(rfhi);
if (base::TimeTicks::Now() < related->block_automatic_fullscreen_until_) {
return true;
}
// Require transient activation shortly after a same-origin WebContents exit.
auto* last_exits = GetFullscreenUserData(GetBrowserContext())->last_exits();
auto last_exit = last_exits->find(host->GetLastCommittedOrigin());
constexpr base::TimeDelta kCooldown = base::Seconds(5);
if (last_exit != last_exits->end() &&
base::TimeTicks::Now() < last_exit->second + kCooldown) {
return true;
}
return GetContentClient()
@@ -10222,7 +10309,7 @@ WebContentsImpl::ParseDownloadHeaders(const std::string& headers) {
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::ParseDownloadHeaders",
"headers", headers);
download::DownloadUrlParameters::RequestHeadersType request_headers;
for (const base::StringPiece& key_value : base::SplitStringPiece(
for (const 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);
@@ -10742,14 +10829,14 @@ void WebContentsImpl::SetOverscrollNavigationEnabled(bool enabled) {
}
network::mojom::AttributionSupport WebContentsImpl::GetAttributionSupport() {
ContentBrowserClient::AttributionReportingOsReportTypes reportTypes =
AttributionOsLevelManager::GetAttributionReportingOsReportTypes(this);
ContentBrowserClient::AttributionReportingOsRegistrars reportTypes =
AttributionOsLevelManager::GetAttributionReportingOsRegistrars(this);
return AttributionManager::GetAttributionSupport(
reportTypes.source_report_type ==
AttributionReportingOsReportType::kDisabled &&
reportTypes.trigger_report_type ==
AttributionReportingOsReportType::kDisabled);
reportTypes.source_registrar ==
AttributionReportingOsRegistrar::kDisabled &&
reportTypes.trigger_registrar ==
AttributionReportingOsRegistrar::kDisabled);
}
void WebContentsImpl::UpdateAttributionSupportRenderer() {
@@ -36,6 +36,7 @@
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/buildflags.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/features_generated.h"
#include "third_party/blink/public/common/loader/referrer_utils.h"
#include "third_party/blink/public/common/switches.h"
#include "third_party/blink/public/platform/web_runtime_features.h"
@@ -185,8 +186,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
blinkFeatureToBaseFeatureMapping[] = {
{wf::EnableAccessibilityAriaVirtualContent,
raw_ref(features::kEnableAccessibilityAriaVirtualContent)},
{wf::EnableAccessibilityExposeHTMLElement,
raw_ref(features::kEnableAccessibilityExposeHTMLElement)},
#if BUILDFLAG(IS_ANDROID)
{wf::EnableAccessibilityPageZoom,
raw_ref(features::kAccessibilityPageZoom)},
@@ -210,7 +209,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
raw_ref(features::kConsolidatedMovementXY)},
{wf::EnableCooperativeScheduling,
raw_ref(features::kCooperativeScheduling)},
{wf::EnableDevicePosture, raw_ref(features::kDevicePosture)},
{wf::EnableDigitalGoods, raw_ref(features::kDigitalGoodsApi),
kSetOnlyIfOverridden},
{wf::EnableDocumentPolicyNegotiation,
@@ -218,15 +216,9 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
{wf::EnableEyeDropperAPI, raw_ref(features::kEyeDropper),
kSetOnlyIfOverridden},
{wf::EnableFedCm, raw_ref(features::kFedCm), kSetOnlyIfOverridden},
{wf::EnableFedCmAutoSelectedFlag,
raw_ref(features::kFedCmAutoSelectedFlag), kSetOnlyIfOverridden},
{wf::EnableFedCmButtonMode, raw_ref(features::kFedCmButtonMode),
kSetOnlyIfOverridden},
{wf::EnableFedCmAuthz, raw_ref(features::kFedCmAuthz), kDefault},
{wf::EnableFedCmError, raw_ref(features::kFedCmError),
kSetOnlyIfOverridden},
{wf::EnableFedCmDomainHint, raw_ref(features::kFedCmDomainHint),
kSetOnlyIfOverridden},
{wf::EnableFedCmIdPRegistration,
raw_ref(features::kFedCmIdPRegistration), kDefault},
{wf::EnableFedCmIdpSigninStatus,
@@ -242,12 +234,10 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
kSetOnlyIfOverridden},
{wf::EnableSharedStorageAPIM118,
raw_ref(blink::features::kSharedStorageAPIM118), kDefault},
{wf::EnableSharedStorageAPIM124,
raw_ref(blink::features::kSharedStorageAPIM124), kDefault},
{wf::EnableSharedStorageAPIM125,
raw_ref(blink::features::kSharedStorageAPIM125), kDefault},
{wf::EnableFedCmMultipleIdentityProviders,
raw_ref(features::kFedCmMultipleIdentityProviders), kDefault},
{wf::EnableFedCmDisconnect, raw_ref(features::kFedCmDisconnect),
kSetOnlyIfOverridden},
{wf::EnableFedCmSelectiveDisclosure,
raw_ref(features::kFedCmSelectiveDisclosure), kDefault},
{wf::EnableFencedFrames,
@@ -308,7 +298,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
raw_ref(features::kUserActivationSameOriginVisibility)},
{wf::EnableVideoPlaybackQuality,
raw_ref(features::kVideoPlaybackQuality)},
{wf::EnableViewportSegments, raw_ref(features::kViewportSegments)},
{wf::EnableWebBluetooth, raw_ref(features::kWebBluetooth),
kSetOnlyIfOverridden},
{wf::EnableWebBluetoothGetDevices,
@@ -351,8 +340,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
#endif
{wf::EnableRemoveMobileViewportDoubleTap,
raw_ref(features::kRemoveMobileViewportDoubleTap)},
{wf::EnableServiceWorkerBypassFetchHandler,
raw_ref(features::kServiceWorkerBypassFetchHandler)},
{wf::EnableServiceWorkerStaticRouter,
raw_ref(features::kServiceWorkerStaticRouter)},
};
@@ -399,6 +386,9 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
raw_ref(features::kCookieDeprecationFacilitatedTesting)},
{"Database", raw_ref(blink::features::kWebSQLAccess),
kSetOnlyIfOverridden},
{"DocumentPolicyIncludeJSCallStacksInCrashReports",
raw_ref(blink::features::
kDocumentPolicyIncludeJSCallStacksInCrashReports)},
{"FencedFramesLocalUnpartitionedDataAccess",
raw_ref(blink::features::kFencedFramesLocalUnpartitionedDataAccess)},
{"Fledge", raw_ref(blink::features::kFledge), kSetOnlyIfOverridden},
@@ -610,21 +600,6 @@ void SetCustomizedRuntimeFeaturesFromCombinedArgs(
break;
}
}
if (base::FeatureList::IsEnabled(blink::features::kPendingBeaconAPI)) {
// The Chromium flag `kPendingBeaconAPI` is true, which enables the
// parts of the API's implementation in Chromium.
if (blink::features::kPendingBeaconAPIRequiresOriginTrial.Get()) {
// `kPendingBeaconAPIRequiresOriginTrial`=true specifies that
// execution context needs to have an origin trial token in order to use
// the PendingBeacon web API.
// So disable the RuntimeEnabledFeature flag PendingBeaconAPI here and let
// the existence of OT token to decide whether the web API is enabled.
WebRuntimeFeatures::EnablePendingBeaconAPI(false);
} else {
WebRuntimeFeatures::EnablePendingBeaconAPI(true);
}
}
}
// Ensures that the various ways of enabling/disabling features do not produce
@@ -700,15 +675,15 @@ void ResolveInvalidConfigurations() {
WebRuntimeFeatures::EnableSharedStorageAPIM118(false);
}
if (!base::FeatureList::IsEnabled(blink::features::kSharedStorageAPIM124) ||
if (!base::FeatureList::IsEnabled(blink::features::kSharedStorageAPIM125) ||
!base::FeatureList::IsEnabled(blink::features::kSharedStorageAPI)) {
LOG_IF(WARNING, WebRuntimeFeatures::IsSharedStorageAPIM124Enabled())
<< "SharedStorage for M124+ cannot be enabled in this "
LOG_IF(WARNING, WebRuntimeFeatures::IsSharedStorageAPIM125Enabled())
<< "SharedStorage for M125+ cannot be enabled in this "
"configuration. Use --"
<< switches::kEnableFeatures << "="
<< blink::features::kSharedStorageAPI.name << ","
<< blink::features::kSharedStorageAPIM124.name << " in addition.";
WebRuntimeFeatures::EnableSharedStorageAPIM124(false);
<< blink::features::kSharedStorageAPIM125.name << " in addition.";
WebRuntimeFeatures::EnableSharedStorageAPIM125(false);
}
if (!base::FeatureList::IsEnabled(
@@ -5,6 +5,7 @@
#include "content/public/browser/content_browser_client.h"
#include <optional>
#include <string_view>
#include <utility>
#include "base/check.h"
@@ -13,13 +14,13 @@
#include "base/functional/callback_helpers.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/strings/string_piece.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/values.h"
#include "build/build_config.h"
#include "build/buildflag.h"
#include "build/chromeos_buildflags.h"
#include "content/browser/model_execution/mock_model_manager.h"
#include "content/public/browser/anchor_element_preconnect_delegate.h"
#include "content/public/browser/authenticator_request_client_delegate.h"
#include "content/public/browser/browser_context.h"
@@ -43,6 +44,7 @@
#include "content/public/browser/responsiveness_calculator_delegate.h"
#include "content/public/browser/sms_fetcher.h"
#include "content/public/browser/speculation_host_delegate.h"
#include "content/public/browser/tracing_delegate.h"
#include "content/public/browser/url_loader_request_interceptor.h"
#include "content/public/browser/vpn_service_proxy.h"
#include "content/public/browser/web_contents.h"
@@ -54,6 +56,7 @@
#include "media/capture/content/screen_enumerator.h"
#include "media/mojo/mojom/media_service.mojom.h"
#include "mojo/public/cpp/bindings/message.h"
#include "net/base/isolation_info.h"
#include "net/cookies/site_for_cookies.h"
#include "net/ssl/client_cert_identity.h"
#include "net/ssl/client_cert_store.h"
@@ -85,10 +88,12 @@
#if BUILDFLAG(IS_ANDROID)
#include "content/public/browser/tts_environment_android.h"
#else
#include "services/video_effects/public/mojom/video_effects_processor.mojom-forward.h"
#endif
using AttributionReportType =
content::ContentBrowserClient::AttributionReportingOsReportType;
content::ContentBrowserClient::AttributionReportingOsRegistrar;
namespace content {
@@ -183,13 +188,13 @@ bool ContentBrowserClient::DoesWebUIUrlRequireProcessLock(const GURL& url) {
}
bool ContentBrowserClient::ShouldTreatURLSchemeAsFirstPartyWhenTopLevel(
base::StringPiece scheme,
std::string_view scheme,
bool is_embedded_origin_secure) {
return false;
}
bool ContentBrowserClient::ShouldIgnoreSameSiteCookieRestrictionsWhenTopLevel(
base::StringPiece scheme,
std::string_view scheme,
bool is_embedded_origin_secure) {
return false;
}
@@ -346,10 +351,10 @@ bool ContentBrowserClient::IsIsolatedContextAllowedForUrl(
return false;
}
bool ContentBrowserClient::IsGetAllScreensMediaAllowed(
content::BrowserContext* context,
const url::Origin& origin) {
return false;
void ContentBrowserClient::CheckGetAllScreensMediaAllowed(
content::RenderFrameHost* render_frame_host,
base::OnceCallback<void(bool)> callback) {
std::move(callback).Run(false);
}
size_t ContentBrowserClient::GetMaxRendererProcessCountOverride() {
@@ -559,8 +564,8 @@ bool ContentBrowserClient::IsAttributionReportingOperationAllowed(
return true;
}
ContentBrowserClient::AttributionReportingOsReportTypes
ContentBrowserClient::GetAttributionReportingOsReportTypes(
ContentBrowserClient::AttributionReportingOsRegistrars
ContentBrowserClient::GetAttributionReportingOsRegistrars(
WebContents* web_contents) {
return {AttributionReportType::kWeb, AttributionReportType::kWeb};
}
@@ -826,10 +831,14 @@ ContentBrowserClient::GetDevToolsBackgroundServiceExpirations(
return {};
}
TracingDelegate* ContentBrowserClient::GetTracingDelegate() {
std::unique_ptr<TracingDelegate> ContentBrowserClient::CreateTracingDelegate() {
return nullptr;
}
bool ContentBrowserClient::IsSystemWideTracingEnabled() {
return false;
}
bool ContentBrowserClient::IsPluginAllowedToCallRequestOSFileHandle(
BrowserContext* browser_context,
const GURL& url) {
@@ -1006,6 +1015,7 @@ void ContentBrowserClient::WillCreateURLLoaderFactory(
int render_process_id,
URLLoaderFactoryType type,
const url::Origin& request_initiator,
const net::IsolationInfo& isolation_info,
std::optional<int64_t> navigation_id,
ukm::SourceIdObj ukm_source_id,
network::URLLoaderFactoryBuilder& factory_builder,
@@ -1182,7 +1192,7 @@ bool ContentBrowserClient::ShowPaymentHandlerWindow(
return false;
}
bool ContentBrowserClient::CreateThreadPool(base::StringPiece name) {
bool ContentBrowserClient::CreateThreadPool(std::string_view name) {
base::ThreadPoolInstance::Create(name);
return true;
}
@@ -1430,7 +1440,7 @@ void ContentBrowserClient::IsClipboardCopyAllowedByPolicy(
const ClipboardMetadata& metadata,
const ClipboardPasteData& data,
IsClipboardCopyAllowedCallback callback) {
std::move(callback).Run(data, std::nullopt);
std::move(callback).Run(metadata.format_type, data, std::nullopt);
}
#if BUILDFLAG(ENABLE_VR)
@@ -1498,6 +1508,14 @@ ContentBrowserClient::CreateIdentityRequestDialogController(
return std::make_unique<IdentityRequestDialogController>();
}
void ContentBrowserClient::ShowDigitalIdentityInterstitialIfNeeded(
WebContents& web_contents,
const url::Origin& origin,
DigitalIdentityInterstitialCallback callback) {
std::move(callback).Run(
DigitalIdentityProvider::RequestStatusForMetrics::kErrorOther);
}
std::unique_ptr<DigitalIdentityProvider>
ContentBrowserClient::CreateDigitalIdentityProvider() {
return nullptr;
@@ -1662,9 +1680,15 @@ bool ContentBrowserClient::UseOutermostMainFrameOrEmbedderForSubCaptureTargets()
#if !BUILDFLAG(IS_ANDROID)
void ContentBrowserClient::BindVideoEffectsManager(
const std::string& device_id,
content::BrowserContext* browser_context,
BrowserContext* browser_context,
mojo::PendingReceiver<media::mojom::VideoEffectsManager>
video_effects_manager) {}
void ContentBrowserClient::BindVideoEffectsProcessor(
const std::string& device_id,
BrowserContext* browser_context,
mojo::PendingReceiver<video_effects::mojom::VideoEffectsProcessor>
video_effects_manager) {}
#endif // !BUILDFLAG(IS_ANDROID)
void ContentBrowserClient::PreferenceRankAudioDeviceInfos(
@@ -1696,4 +1720,10 @@ bool ContentBrowserClient::ShouldSuppressAXLoadComplete(RenderFrameHost* rfh) {
return false;
}
void ContentBrowserClient::BindModelManager(
RenderFrameHost* rfh,
mojo::PendingReceiver<blink::mojom::ModelManager> receiver) {
MockModelManager::Create(rfh, std::move(receiver));
}
} // namespace content
@@ -583,6 +583,7 @@ enum IntentInputEventType {
insertTranspose,
insertReplacementText,
insertCompositionText,
insertLink,
// Deletion.
deleteWordBackward,
deleteWordForward,
@@ -58,7 +58,8 @@ namespace bluetoothPrivate {
alreadyExists,
notConnected,
doesNotExist,
invalidArgs
invalidArgs,
nonAuthTimeout
};
// Valid pairing responses.
@@ -731,6 +731,8 @@ namespace networking.onc {
// 'None' conflicts with extension code generation so we must use a string
// for 'Source' instead of a SourceType enum.
DOMString? Source;
// When traffic counters were last reset.
double? TrafficCounterResetTime;
// The network type.
NetworkType Type;
// For VPN networks, the network VPN properties.
@@ -777,6 +779,8 @@ namespace networking.onc {
IPConfigProperties? SavedIPConfig;
// See $(ref:NetworkProperties.Source).
DOMString? Source;
// See $(ref:NetworkProperties.TrafficCounterResetTime).
double? TrafficCounterResetTime;
// See $(ref:NetworkProperties.Type).
NetworkType Type;
// See $(ref:NetworkProperties.VPN).
@@ -730,6 +730,7 @@ namespace networkingPrivate {
// for 'Source' instead of a SourceType enum.
DOMString? Source;
TetherProperties? Tether;
double? TrafficCounterResetTime;
NetworkType Type;
VPNProperties? VPN;
WiFiProperties? WiFi;
@@ -756,6 +757,7 @@ namespace networkingPrivate {
// See $(ref:NetworkProperties.Source).
DOMString? Source;
TetherProperties? Tether;
double? TrafficCounterResetTime;
NetworkType Type;
ManagedVPNProperties? VPN;
ManagedWiFiProperties? WiFi;
@@ -65,5 +65,8 @@ namespace scriptsInternal {
Source source;
// The JavaScript "world" to run the script in.
extensionTypes.ExecutionWorld world;
// The ID of the world into which to inject. If omitted, uses the default
// world.
DOMString? worldId;
};
};
@@ -65,6 +65,13 @@ namespace userScripts {
// The JavaScript execution environment to run the script in. The default is
// <code>`USER_SCRIPT`</code>.
ExecutionWorld? world;
// If specified, specifies a specific user script world ID to execute in.
// Only valid if `world` is omitted or is `USER_SCRIPT`. If omitted, the
// script will execute in the default user script world.
// Values with leading underscores (`_`) are reserved.
// TODO(https://crbug.com/331680187): Remove nodoc.
[nodoc] DOMString? worldId;
};
// An object used to filter user scripts for ${ref:getScripts}.
@@ -75,12 +82,19 @@ namespace userScripts {
};
// An object used to update the <code>`USER_SCRIPT`</code> world
// configuration. If a propertie is not specified, it will reset it to its
// configuration. If a property is not specified, it will reset it to its
// default value.
dictionary WorldProperties{
// Specifies the ID of the specific user script world to update.
// If not provided, updates the properties of the default user script world.
// Values with leading underscores (`_`) are reserved.
// TODO(https://crbug.com/331680187): Remove nodoc.
[nodoc] DOMString? worldId;
// Specifies the world csp. The default is the <code>`ISOLATED`</code>
// world csp.
DOMString? csp;
// Specifies whether messaging APIs are exposed. The default is
// <code>false</code>.
boolean? messaging;
+12 -11
View File
@@ -11,6 +11,7 @@
#include <memory>
#include <optional>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
@@ -31,7 +32,6 @@
#include "base/notreached.h"
#include "base/path_service.h"
#include "base/rand_util.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/system/sys_info.h"
@@ -276,6 +276,9 @@ void SetFlags(IsolateHolder::ScriptMode mode,
SetV8FlagsIfOverridden(features::kV8MegaDomIC, "--mega-dom-ic",
"--no-mega-dom-ic");
SetV8FlagsIfOverridden(features::kV8Maglev, "--maglev", "--no-maglev");
SetV8FlagsIfOverridden(features::kV8ConcurrentMaglevHighPriorityThreads,
"--concurrent-maglev-high-priority-threads",
"--no-concurrent-maglev-high-priority-threads");
if (base::FeatureList::IsEnabled(features::kV8MemoryReducer)) {
SetV8FlagsFormatted("--memory-reducer-gc-count=%i",
features::kV8MemoryReducerGCCount.Get());
@@ -294,6 +297,9 @@ void SetFlags(IsolateHolder::ScriptMode mode,
SetV8FlagsIfOverridden(features::kV8SparkplugNeedsShortBuiltinCalls,
"--sparkplug-needs-short-builtins",
"--no-sparkplug-needs-short-builtins");
SetV8FlagsIfOverridden(features::kV8BaselineBatchCompilation,
"--baseline-batch-compilation",
"--no-baseline-batch-compilation");
SetV8FlagsIfOverridden(features::kV8ShortBuiltinCalls,
"--short-builtin-calls", "--no-short-builtin-calls");
SetV8FlagsIfOverridden(features::kV8CodeMemoryWriteProtection,
@@ -380,20 +386,11 @@ void SetFlags(IsolateHolder::ScriptMode mode,
"--no-intel-jcc-erratum-mitigation");
// JavaScript language features.
SetV8FlagsIfOverridden(features::kJavaScriptSymbolAsWeakMapKey,
"--harmony-symbol-as-weakmap-key",
"--no-harmony-symbol-as-weakmap-key");
if (base::FeatureList::IsEnabled(features::kJavaScriptRabGsab)) {
SetV8Flags("--harmony-rab-gsab");
} else {
SetV8Flags("--no-harmony-rab-gsab");
}
SetV8FlagsIfOverridden(features::kJavaScriptRegExpUnicodeSets,
"--harmony-regexp-unicode-sets",
"--no-harmony-regexp-unicode-sets");
SetV8FlagsIfOverridden(features::kJavaScriptJsonParseWithSource,
"--harmony-json-parse-with-source",
"--no-harmony-json-parse-with-source");
SetV8FlagsIfOverridden(features::kJavaScriptArrayBufferTransfer,
"--harmony-rab-gsab-transfer",
"--no-harmony-rab-gsab-transfer");
@@ -425,6 +422,10 @@ void SetFlags(IsolateHolder::ScriptMode mode,
"--use-libm-trig-functions",
"--no-use-libm-trig-functions");
SetV8FlagsIfOverridden(features::kV8UseOriginalMessageForStackTrace,
"--use-original-message-for-stack-trace",
"--no-use-original-message-for-stack-trace");
SetV8FlagsIfOverridden(features::kJavaScriptCompileHintsMagic,
"--compile-hints-magic", "--no-compile-hints-magic");
@@ -452,7 +453,7 @@ void SetFlags(IsolateHolder::ScriptMode mode,
return;
// Allow the --js-flags switch to override existing flags:
std::vector<base::StringPiece> flag_list =
std::vector<std::string_view> flag_list =
base::SplitStringPiece(js_command_line_flags, ",", base::TRIM_WHITESPACE,
base::SPLIT_WANT_NONEMPTY);
for (const auto& flag : flag_list) {
@@ -29,6 +29,7 @@
#include "base/ranges/algorithm.h"
#include "base/sequence_checker.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/current_thread.h"
#include "base/task/sequenced_task_runner.h"
@@ -189,6 +190,10 @@
#include "base/android/application_status_listener.h"
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(ENABLE_DEVICE_BOUND_SESSIONS)
#include "net/device_bound_sessions/device_bound_session_service.h"
#endif // BUILDFLAG(ENABLE_DEVICE_BOUND_SESSIONS)
namespace network {
namespace {
@@ -440,13 +445,12 @@ void TestVerifyCertCallback(
}
std::string HashesToBase64String(const net::HashValueVector& hashes) {
std::string str;
for (size_t i = 0; i != hashes.size(); ++i) {
if (i != 0)
str += ",";
str += hashes[i].ToString();
std::vector<std::string> strings;
strings.reserve(hashes.size());
for (const auto& hash : hashes) {
strings.push_back(hash.ToString());
}
return str;
return base::JoinString(strings, ",");
}
#if BUILDFLAG(IS_CT_SUPPORTED)
@@ -639,13 +643,15 @@ NetworkContext::NetworkContext(
url_request_context_owner_ = MakeURLRequestContext(
std::move(url_loader_factory_for_cert_net_fetcher),
session_cleanup_cookie_store,
std::move(on_url_request_context_builder_configured));
std::move(on_url_request_context_builder_configured),
params_->bound_network);
url_request_context_ = url_request_context_owner_.url_request_context.get();
cookie_manager_ = std::make_unique<CookieManager>(
url_request_context_, &first_party_sets_access_delegate_,
std::move(session_cleanup_cookie_store),
std::move(params_->cookie_manager_params));
std::move(params_->cookie_manager_params),
network_service_->tpcd_metadata_manager());
cookie_manager_->AddSettingsWillChangeCallback(
base::BindRepeating(&NetworkContext::OnCookieManagerSettingsChanged,
@@ -734,7 +740,8 @@ NetworkContext::NetworkContext(
url_request_context,
nullptr,
/*first_party_sets_access_delegate=*/nullptr,
nullptr)),
/*params=*/nullptr,
/*tpcd_metadata_manager=*/nullptr)),
socket_factory_(
std::make_unique<SocketFactory>(url_request_context_->net_log(),
url_request_context)),
@@ -2303,11 +2310,17 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
url_loader_factory_for_cert_net_fetcher,
scoped_refptr<SessionCleanupCookieStore> session_cleanup_cookie_store,
OnURLRequestContextBuilderConfiguredCallback
on_url_request_context_builder_configured) {
on_url_request_context_builder_configured,
net::handles::NetworkHandle bound_network) {
URLRequestContextBuilderMojo builder;
const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
bool is_network_bound = bound_network != net::handles::kInvalidNetworkHandle;
if (is_network_bound) {
builder.BindToNetwork(bound_network);
}
std::unique_ptr<net::CertVerifier> cert_verifier;
if (g_cert_verifier_for_testing) {
cert_verifier = std::make_unique<WrappedTestingCertVerifier>();
@@ -2396,10 +2409,15 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
if (network_service_) {
net_log = network_service_->net_log();
builder.set_net_log(net_log);
builder.set_host_resolver_manager(
network_service_->host_resolver_manager());
builder.set_host_resolver_factory(
network_service_->host_resolver_factory());
if (!is_network_bound) {
// Network bound URLRequestContexts build and configure their own special
// HostResolverManager and HostResolver. So, don't inject the
// NetworkService one even if NetworkService is enabled.
builder.set_host_resolver_manager(
network_service_->host_resolver_manager());
builder.set_host_resolver_factory(
network_service_->host_resolver_factory());
}
builder.SetHttpAuthHandlerFactory(
network_service_->CreateHttpAuthHandlerFactory(this));
builder.set_network_quality_estimator(
@@ -2481,6 +2499,8 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
cache_params.type =
net::URLRequestContextBuilder::HttpCacheParams::IN_MEMORY;
} else {
// Network-bound NetworkContexts should not persist state on disk.
CHECK(!is_network_bound);
cache_params.path = params_->file_paths->http_cache_directory->path();
cache_params.type = network_session_configurator::ChooseCacheType();
if (params_->http_cache_file_operations_factory) {
@@ -2526,6 +2546,8 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
&network::mojom::NetworkContextFilePaths::
http_server_properties_file_name,
http_server_properties_file_name)) {
// Network-bound NetworkContexts should not persist state on disk.
CHECK(!is_network_bound);
scoped_refptr<JsonPrefStore> json_pref_store(new JsonPrefStore(
http_server_properties_file_name, nullptr,
base::ThreadPool::CreateSequencedTaskRunner(
@@ -2553,6 +2575,8 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
&network::mojom::NetworkContextFilePaths::
transport_security_persister_file_name,
transport_security_persister_file_name)) {
// Network-bound NetworkContexts should not persist state on disk.
CHECK(!is_network_bound);
builder.set_transport_security_persister_file_path(
transport_security_persister_file_name);
}
@@ -2583,6 +2607,8 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
reporting_and_nel_store_database_name,
reporting_and_nel_store_database_name) &&
(reporting_enabled || nel_enabled)) {
// Network-bound NetworkContexts should not persist state on disk.
CHECK(!is_network_bound);
scoped_refptr<base::SequencedTaskRunner> client_task_runner =
base::SingleThreadTaskRunner::GetCurrentDefault();
scoped_refptr<base::SequencedTaskRunner> background_task_runner =
@@ -2681,6 +2707,13 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
builder.set_cookie_deprecation_label(*params_->cookie_deprecation_label);
}
#if BUILDFLAG(ENABLE_DEVICE_BOUND_SESSIONS)
if (params_->device_bound_sessions_enabled) {
builder.set_device_bound_session_service(
net::DeviceBoundSessionService::Create());
}
#endif
if (on_url_request_context_builder_configured) {
std::move(on_url_request_context_builder_configured).Run(&builder);
}
@@ -3021,17 +3054,40 @@ void NetworkContext::FlushCachedClientCertIfNeeded(
}
}
void NetworkContext::FlushMatchingCachedClientCert(
const scoped_refptr<net::X509Certificate>& certificate) {
net::HttpNetworkSession* http_session =
url_request_context_->http_transaction_factory()->GetSession();
DCHECK(http_session);
if (http_session->ssl_client_context()) {
http_session->ssl_client_context()->ClearMatchingClientCertificate(
certificate);
}
}
void NetworkContext::SetCookieDeprecationLabel(
const std::optional<std::string>& label) {
CHECK(url_request_context_);
url_request_context_->set_cookie_deprecation_label(label);
}
void NetworkContext::RevokeNetworkForNonce(
const base::UnguessableToken& nonce,
RevokeNetworkForNonceCallback callback) {
network_revocation_nonces_.insert(nonce);
// TODO(crbug.com/41488151): Cancel requests in progress.
void NetworkContext::RevokeNetworkForNonces(
const std::vector<base::UnguessableToken>& nonces,
RevokeNetworkForNoncesCallback callback) {
for (const auto& nonce : nonces) {
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);
}
}
#if BUILDFLAG(ENABLE_WEBSOCKETS)
if (websocket_factory_) {
websocket_factory_->RemoveIfNonceMatches(nonce);
}
#endif // BUILDFLAG(ENABLE_WEBSOCKETS)
}
std::move(callback).Run();
}
@@ -3040,12 +3096,7 @@ void NetworkContext::ExemptUrlFromNetworkRevocationForNonce(
const base::UnguessableToken& nonce,
ExemptUrlFromNetworkRevocationForNonceCallback callback) {
GURL url_without_filename = exempted_url.GetWithoutFilename();
if (network_revocation_exemptions_.contains(nonce)) {
network_revocation_exemptions_.find(nonce)->second.insert(
url_without_filename);
} else {
network_revocation_exemptions_.insert({nonce, {url_without_filename}});
}
network_revocation_exemptions_[nonce].insert(url_without_filename);
std::move(callback).Run();
}
File diff suppressed because it is too large Load Diff
@@ -3600,16 +3600,16 @@ enum WebFeature {
kViewTimelineConstructor = 4271,
kH1UserAgentFontSizeInSectionApplied = 4272,
kOBSOLETE_kV8PendingBeacon_Constructor = 4273,
kV8PendingBeacon_Url_AttributeGetter = 4274,
kOBSOLETE_kV8PendingBeacon_Url_AttributeGetter = 4274,
kOBSOLETE_kV8PendingBeacon_Url_AttributeSetter = 4275,
kV8PendingBeacon_Method_AttributeGetter = 4276,
kOBSOLETE_kV8PendingBeacon_Method_AttributeGetter = 4276,
kOBSOLETE_kV8PendingBeacon_Method_AttributeSetter = 4277,
kOBSOLETE_kV8PendingBeacon_PageHideTimeout_AttributeGetter = 4278,
kOBSOLETE_kV8PendingBeacon_PageHideTimeout_AttributeSetter = 4279,
kOBSOLETE_kV8PendingBeacon_State_AttributeGetter = 4280,
kV8PendingBeacon_Deactivate_Method = 4281,
kOBSOLETE_kV8PendingBeacon_Deactivate_Method = 4281,
kOBSOLETE_kV8PendingBeacon_SetData_Method = 4282,
kV8PendingBeacon_SendNow_Method = 4283,
kOBSOLETE_kV8PendingBeacon_SendNow_Method = 4283,
// The items above roughly this point are available in the M104 branch.
kTabSharingBarSwitchToCapturer = 4284,
@@ -3647,15 +3647,15 @@ enum WebFeature {
kCrossOriginScrollIntoView = 4316,
kLinkRelCanonical = 4317,
kCredentialManagerIsConditionalMediationAvailable = 4318,
kV8PendingBeacon_Pending_AttributeGetter = 4319,
kV8PendingBeacon_BackgroundTimeout_AttributeGetter = 4320,
kV8PendingBeacon_BackgroundTimeout_AttributeSetter = 4321,
kV8PendingBeacon_Timeout_AttributeGetter = 4322,
kV8PendingBeacon_Timeout_AttributeSetter = 4323,
kV8PendingGetBeacon_Constructor = 4324,
kV8PendingGetBeacon_SetURL_Method = 4325,
kV8PendingPostBeacon_Constructor = 4326,
kV8PendingPostBeacon_SetData_Method = 4327,
kOBSOLETE_kV8PendingBeacon_Pending_AttributeGetter = 4319,
kOBSOLETE_kV8PendingBeacon_BackgroundTimeout_AttributeGetter = 4320,
kOBSOLETE_kV8PendingBeacon_BackgroundTimeout_AttributeSetter = 4321,
kOBSOLETE_kV8PendingBeacon_Timeout_AttributeGetter = 4322,
kOBSOLETE_kV8PendingBeacon_Timeout_AttributeSetter = 4323,
kOBSOLETE_kV8PendingGetBeacon_Constructor = 4324,
kOBSOLETE_kV8PendingGetBeacon_SetURL_Method = 4325,
kOBSOLETE_kV8PendingPostBeacon_Constructor = 4326,
kOBSOLETE_kV8PendingPostBeacon_SetData_Method = 4327,
kContentVisibilityAutoStateChangeHandlerRegistered = 4328,
kReplacedElementPaintedWithLargeOverflow = 4329,
// The items above roughly this point are available in the M105 branch.
@@ -3748,7 +3748,7 @@ enum WebFeature {
kCSSAtRuleSwash = 4407 ,
kCSSAtRuleOrnaments = 4408,
kCSSAtRuleAnnotation = 4409,
kServiceWorkerBypassFetchHandlerForMainResource = 4410,
kOBSOLETE_ServiceWorkerBypassFetchHandlerForMainResource = 4410,
kV8Document_HasPrivateToken_Method = 4411,
kServiceWorkerSkippedForEmptyFetchHandler = 4412,
kImageSet = 4413,
@@ -3799,7 +3799,7 @@ enum WebFeature {
kOptionLabelInQuirksMode = 4454,
kParseFromStringIncludeShadows = 4455,
kWebAppManifestScopeExtensions = 4456,
kServiceWorkerBypassFetchHandlerForMainResourceByOriginTrial = 4457,
kOBSOLETE_ServiceWorkerBypassFetchHandlerForMainResourceByOriginTrial = 4457,
kOBSOLETE_V8RegExpUnicodeSetIncompatibilitiesWithUnicodeMode = 4458,
kFedCmAutoReauthn = 4459,
kTopicsAPIFetch = 4460,
@@ -3814,9 +3814,9 @@ enum WebFeature {
kServiceWorkerEventHandlerModifiedAfterInitialization = 4469,
kAuthorizationCrossOrigin = 4470,
kCSSColorMixFunction = 4471,
kCSSColorColorSpecifiedSpace = 4472,
kCSSColorLabOklab = 4473,
kCSSColorLchOklch = 4474,
kOBSOLETE_CSSColorColorSpecifiedSpace = 4472,
kOBSOLETE_CSSColorLabOklab = 4473,
kOBSOLETE_CSSColorLchOklch = 4474,
kOBSOLETE_CreateNSResolverWithNonElements2 = 4475,
kGetDisplayMediaWithPreferCurrentTabTrue = 4476,
kFencedFrameConfigAttribute = 4477,
@@ -3829,7 +3829,7 @@ enum WebFeature {
kRTCPeerConnectionLegacyGetStatsTrial = 4482,
kExecutedEmptyJavaScriptURLFromFrame = 4483,
kExecutedJavaScriptURLFromFrame = 4484,
kServiceWorkerBypassFetchHandlerForSubResource = 4485,
kOBSOLETE_ServiceWorkerBypassFetchHandlerForSubResource = 4485,
kCSSAtRuleStartingStyle = 4486,
kPrivateAggregationApiFledgeExtensions = 4487,
kDeprecatedInterestGroupDailyUpdateUrl = 4488,
@@ -3894,7 +3894,7 @@ enum WebFeature {
kOBSOLETE_TextWrapBalanceFail = 4545,
kAttributionReportingCrossAppWeb = 4546,
kSecurePaymentConfirmationActivationlessShow = 4547,
kServiceWorkerBypassFetchHandlerForAllWithRaceNetworkRequest = 4548,
kOBSOLETE_ServiceWorkerBypassFetchHandlerForAllWithRaceNetworkRequest = 4548,
// The items above roughly this point are available in the M114 branch.
kFlexIntrinsicSizesCacheMiss = 4549,
@@ -3907,7 +3907,7 @@ enum WebFeature {
kCSSValueAppearanceSliderVertical = 4556,
kCSSValueAppearanceSliderthumbHorizontal = 4557,
kCSSValueAppearanceSliderthumbVertical = 4558,
kServiceWorkerBypassFetchHandlerForAllWithRaceNetworkRequestByOriginTrial = 4559,
kOBSOLETE_ServiceWorkerBypassFetchHandlerForAllWithRaceNetworkRequestByOriginTrial = 4559,
kOBSOLETE_EventTimingPaintedPresentationPromiseResolvedWithEarlierPromiseUnresolved = 4560,
kLinkRelPreloadAsFont = 4561,
kCrossWindowAccessToBrowserGeneratedDocument = 4562,
@@ -3939,7 +3939,7 @@ enum WebFeature {
kWebGPUQueueSubmit = 4586,
kWebGPUCanvasContextGetCurrentTexture = 4587,
kEditContext = 4588,
kServiceWorkerStaticRouter_RegisterRouter = 4589,
kOBSOLETE_kServiceWorkerStaticRouter_RegisterRouter = 4589,
kServiceWorkerStaticRouter_Evaluate = 4590,
kClientHintsUAFormFactors = 4591,
kURLSearchParamsHasFnBehaviourDiverged = 4592,
@@ -4032,7 +4032,7 @@ enum WebFeature {
kTextWrapPretty = 4674,
// The items above roughly this point are available in the M119 branch.
kV8PointerEvent_DeviceId_AttributeGetter = 4675,
kOBSOLETE_V8PointerEvent_DeviceId_AttributeGetter = 4675,
kSourceMappingUrlMagicCommentAtSign = 4676,
kHTMLDetailsElementNameAttribute = 4677,
kHTMLDetailsElementNameAttributeClosesSelf = 4678,
@@ -4267,11 +4267,11 @@ enum WebFeature {
kTCPSocketConstructor = 4899,
kTCPSocketOpenedAttribute = 4900,
kTCPSocketClosedAttribute = 4901,
kTCPSocketCloseFunction= 4902,
kTCPSocketCloseFunction = 4902,
kUDPSocketConstructor = 4903,
kUDPSocketOpenedAttribute = 4904,
kUDPSocketClosedAttribute = 4905,
kUDPSocketCloseFunction= 4906,
kUDPSocketCloseFunction = 4906,
kTCPServerSocketConstructor = 4907,
kTCPServerSocketOpenedAttribute = 4908,
kTCPServerSocketClosedAttribute = 4909,
@@ -4289,8 +4289,43 @@ enum WebFeature {
kFledgeAuctionReportBuyerDebugModeConfig = 4919,
kFedCmButtonMode = 4920,
kHTMLPermissionElement = 4921,
kSimplifyLoadingTransparentPlaceholderImage = 4921,
// Model Execution API:
kV8ModelGenericSession_Execute_Method = 4922,
kV8ModelGenericSession_ExecuteStreaming_Method = 4923,
kV8ModelManager_CanCreateGenericSession_Method = 4924,
kV8ModelManager_CreateGenericSession_Method = 4925,
kV8Animation_Progress_AttributeGetter = 4926,
kV8ModelManager_DefaultGenericSessionOptions_Method = 4927,
kQuirksModeCursorHandApplied = 4928,
kSkippedPreloadScanning = 4929,
kCSSColor_SpaceRGB = 4930,
kCSSColor_SpaceRGB_outOfRec2020= 4931,
kCSSColor_SpaceOkLxx = 4932,
kCSSColor_SpaceOkLxx_outOfRec2020 = 4933,
// Uses of base URL in sandboxed srcdoc frames:
kSandboxedSrcdocFrameResolvesRelativeURL = 4934,
kV8Ink_RequestPresenter_Method = 4935,
kEventTimingOrphanPointerup = 4936,
kNavigatorCookieEnabledThirdParty = 4937,
kFoldableAPIs = 4938,
// https://drafts.csswg.org/css-scroll-snap-2/#snap-events
kSnapEvent = 4939,
kStaticPropertyInAnimation = 4940,
kSimplifyLoadingTransparentPlaceholderImage = 4941,
kIdentityDigitalCredentialsSuccess = 4942,
kV8DeviceProperties_UniqueId_AttributeGetter = 4943,
// Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots.
@@ -419,6 +419,11 @@ 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 for the web content. The scheme is used to
// evaluate the prefers-color-scheme media query and resolve UA color scheme
// to be used based on the supported-color-schemes META tag and CSS property.
@@ -43,6 +43,7 @@ enum ReplaceState { "active", "removed", "persisted" };
attribute AnimationTimeline? timeline;
[Measure, RaisesException=Setter] attribute CSSNumberish? startTime;
[Measure, RaisesException=Setter] attribute CSSNumberish? currentTime;
[RuntimeEnabled=AnimationProgressAPI, Measure] readonly attribute double? progress;
[Measure, RaisesException=Setter] attribute double playbackRate;
[RuntimeEnabled=ScrollTimeline, Measure, RaisesException=Setter] attribute (TimelineRangeOffset or DOMString) rangeStart;
[RuntimeEnabled=ScrollTimeline, Measure, RaisesException=Setter] attribute (TimelineRangeOffset or DOMString) rangeEnd;
@@ -0,0 +1,79 @@
// 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://drafts.csswg.org/css-anchor-position-1/#om-position-try
[Exposed=Window, RuntimeEnabled=CSSAnchorPositioning]
interface CSSPositionTryDescriptors : CSSStyleDeclaration {
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString margin;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString marginTop;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString marginRight;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString marginBottom;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString marginLeft;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString marginBlock;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString marginBlockStart;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString marginBlockEnd;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString marginInline;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString marginInlineStart;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString marginInlineEnd;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=marginTop] attribute CSSOMString margin-top;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=marginRight] attribute CSSOMString margin-right;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=marginBottom] attribute CSSOMString margin-bottom;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=marginLeft] attribute CSSOMString margin-left;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=marginBlock] attribute CSSOMString margin-block;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=marginBlockStart] attribute CSSOMString margin-block-start;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=marginBlockEnd] attribute CSSOMString margin-block-end;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=marginInline] attribute CSSOMString margin-inline;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=marginInlineStart] attribute CSSOMString margin-inline-start;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=marginInlineEnd] attribute CSSOMString margin-inline-end;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString inset;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString insetBlock;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString insetBlockStart;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString insetBlockEnd;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString insetInline;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString insetInlineStart;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString insetInlineEnd;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString top;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString left;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString right;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString bottom;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=insetBlock] attribute CSSOMString inset-block;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=insetBlockStart] attribute CSSOMString inset-block-start;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=insetBlockEnd] attribute CSSOMString inset-block-end;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=insetInline] attribute CSSOMString inset-inline;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=insetInlineStart] attribute CSSOMString inset-inline-start;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=insetInlineEnd] attribute CSSOMString inset-inline-end;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString width;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString minWidth;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString maxWidth;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString height;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString minHeight;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString maxHeight;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString blockSize;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString minBlockSize;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString maxBlockSize;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString inlineSize;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString minInlineSize;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString maxInlineSize;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=minWidth] attribute CSSOMString min-width;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=maxWidth] attribute CSSOMString max-width;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=minHeight] attribute CSSOMString min-height;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=maxHeight] attribute CSSOMString max-height;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=blockSize] attribute CSSOMString block-size;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=minBlockSize] attribute CSSOMString min-block-size;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=maxBlockSize] attribute CSSOMString max-block-size;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=inlineSize] attribute CSSOMString inline-size;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=minInlineSize] attribute CSSOMString min-inline-size;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=maxInlineSize] attribute CSSOMString max-inline-size;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString placeSelf;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString alignSelf;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString justifySelf;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=placeSelf] attribute CSSOMString place-self;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=alignSelf] attribute CSSOMString align-self;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=justifySelf] attribute CSSOMString justify-self;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString positionAnchor;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=positionAnchor] attribute CSSOMString position-anchor;
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString insetArea;
[SetterCallWith=ExecutionContext, RaisesException=Setter, ImplementedAs=insetArea] attribute CSSOMString inset-area;
};
@@ -6,6 +6,6 @@
Exposed=Window,
RuntimeEnabled=ViewTransitionOnNavigation
] interface CSSViewTransitionRule : CSSRule {
[SetterCallWith=ExecutionContext] attribute CSSOMString navigation;
[SetterCallWith=ExecutionContext] readonly attribute CSSOMString navigation;
[RuntimeEnabled=ViewTransitionTypes, SameObject, SaveSameObject] readonly attribute FrozenArray<CSSOMString> types;
};
@@ -11,6 +11,7 @@
#include "third_party/blink/renderer/core/css/properties/css_parsing_utils.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/execution_context/security_context.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/html/parser/html_parser_idioms.h"
#include "third_party/blink/renderer/core/media_type_names.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
@@ -90,12 +91,14 @@ class MediaQueryFeatureSet : public MediaQueryParser::FeatureSet {
execution_context)) ||
(feature ==
media_feature_names::kHorizontalViewportSegmentsMediaFeature &&
RuntimeEnabledFeatures::ViewportSegmentsEnabled()) ||
RuntimeEnabledFeatures::ViewportSegmentsEnabled(
execution_context)) ||
(feature ==
media_feature_names::kVerticalViewportSegmentsMediaFeature &&
RuntimeEnabledFeatures::ViewportSegmentsEnabled()) ||
RuntimeEnabledFeatures::ViewportSegmentsEnabled(
execution_context)) ||
(feature == media_feature_names::kDevicePostureMediaFeature &&
RuntimeEnabledFeatures::DevicePostureEnabled()) ||
RuntimeEnabledFeatures::DevicePostureEnabled(execution_context)) ||
(feature == media_feature_names::kOverflowInlineMediaFeature &&
RuntimeEnabledFeatures::CSSOverflowMediaFeaturesEnabled()) ||
(feature == media_feature_names::kOverflowBlockMediaFeature &&
@@ -165,7 +168,10 @@ MediaQueryParser::MediaQueryParser(ParserType parser_type,
syntax_level_(syntax_level),
fake_context_(*MakeGarbageCollected<CSSParserContext>(
kHTMLStandardMode,
SecureContextMode::kInsecureContext)) {}
SecureContextMode::kInsecureContext,
DynamicTo<LocalDOMWindow>(execution_context)
? DynamicTo<LocalDOMWindow>(execution_context)->document()
: nullptr)) {}
MediaQueryParser::~MediaQueryParser() = default;
@@ -106,10 +106,10 @@ dictionary CheckVisibilityOptions {
// Declarative Shadow DOM getInnerHTML() function. This version should be
// considered deprecated, as we work to standardize the version below,
// getHTML().
[Affects=Nothing, MeasureAs=ElementGetInnerHTML, RuntimeEnabled=ElementGetInnerHTML] HTMLString getInnerHTML(optional GetInnerHTMLOptions options = {});
[Affects=Nothing, MeasureAs=ElementGetInnerHTML, RuntimeEnabled=ElementGetInnerHTML] DOMString getInnerHTML(optional GetInnerHTMLOptions options = {});
// Declarative Shadow DOM getHTML() function.
[Affects=Nothing, MeasureAs=ElementGetHTML, RaisesException, RuntimeEnabled=ElementGetHTML] HTMLString getHTML(optional GetHTMLOptions options = {});
[Affects=Nothing, MeasureAs=ElementGetHTML, RaisesException, RuntimeEnabled=ElementGetHTML] DOMString getHTML(optional GetHTMLOptions options = {});
// Pointer Lock
// https://w3c.github.io/pointerlock/#extensions-to-the-element-interface
@@ -143,7 +143,7 @@ dictionary CheckVisibilityOptions {
readonly attribute long clientHeight;
// Used by both Anchor Positioning and Popover
[CEReactions,RuntimeEnabled=CSSAnchorPositioning] attribute Element? anchorElement;
[CEReactions,RuntimeEnabled=HTMLAnchorAttribute] attribute Element? anchorElement;
// Non-standard API
[MeasureAs=ElementScrollIntoViewIfNeeded] void scrollIntoViewIfNeeded(optional boolean centerIfNeeded);
@@ -75,6 +75,7 @@
boolean isDefaultNamespace(DOMString? namespaceURI);
[CEReactions, PerWorldBindings, RaisesException] Node insertBefore(Node node, Node? child);
[CEReactions, PerWorldBindings, RaisesException, RuntimeEnabled=AtomicMoveAPI] Node moveBefore(Node node, Node? child);
[CEReactions, PerWorldBindings, RaisesException, RuntimeCallStatsCounter=NodeAppendChild] Node appendChild(Node node);
[CEReactions, PerWorldBindings, RaisesException] Node replaceChild(Node node, Node child);
[CEReactions, RaisesException, RuntimeCallStatsCounter=NodeRemoveChild] Node removeChild(Node child);
@@ -45,10 +45,14 @@ interface Observable {
[CallWith=ScriptState] Observable filter(Predicate predicate);
[CallWith=ScriptState] Observable take(unsigned long long number_to_take);
[CallWith=ScriptState] Observable drop(unsigned long long number_to_drop);
[CallWith=ScriptState, RaisesException] Observable flatMap(Mapper mapper);
[CallWith=ScriptState, RaisesException] Observable switchMap(Mapper mapper);
// Promise-returning operators.
// See https://wicg.github.io/observable/#promise-returning-operators.
[CallWith=ScriptState] Promise<sequence<any>> toArray(optional SubscribeOptions options = {});
[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 = {});
};
@@ -49,7 +49,7 @@ interface ShadowRoot : DocumentFragment {
[Affects=Nothing, MeasureAs=ElementGetHTML, RaisesException, RuntimeEnabled=ElementGetHTML] HTMLString getHTML(optional GetHTMLOptions options = {});
// The serializable attribute controls whether the shadow root will be
// serialized by getHTML({includeShadowRoots:true}).
// serialized by getHTML({serializableShadowRoots:true}).
[RuntimeEnabled=ElementGetHTML] attribute boolean serializable;
// The clonable attribute controls whether the shadow root will be
@@ -10,8 +10,7 @@
// Spec draft:
// https://w3c.github.io/edit-context/#characterboundsupdateevent
[
Exposed=Window,
RuntimeEnabled=EditContext
Exposed=Window
] interface CharacterBoundsUpdateEvent : Event {
constructor(DOMString type, optional CharacterBoundsUpdateEventInit options = {});
readonly attribute unsigned long rangeStart;
@@ -11,8 +11,7 @@
[
Exposed=Window,
ActiveScriptWrappable,
RuntimeEnabled=EditContext
ActiveScriptWrappable
] interface EditContext : EventTarget {
[CallWith=ScriptState] constructor(optional EditContextInit options = {});
[RaisesException] void updateSelection(unsigned long start, unsigned long end);
@@ -11,8 +11,7 @@ enum UnderlineStyle { "none", "solid", "dotted", "dashed", "wavy" };
enum UnderlineThickness { "none", "thin", "thick" };
[
Exposed=Window,
RuntimeEnabled=EditContext
Exposed=Window
] interface TextFormat {
constructor(optional TextFormatInit options = {});
@@ -10,8 +10,7 @@
// Spec draft:
// https://w3c.github.io/edit-context/#textformatupdateevent
[
Exposed=Window,
RuntimeEnabled=EditContext
Exposed=Window
] interface TextFormatUpdateEvent : Event {
constructor(DOMString type, optional TextFormatUpdateEventInit options = {});
@@ -12,8 +12,7 @@
// https://w3c.github.io/edit-context/#textupdateevent
[
Exposed=Window,
RuntimeEnabled=EditContext
Exposed=Window
] interface TextUpdateEvent : Event {
constructor(DOMString type, optional TextUpdateEventInit options = {});
readonly attribute unsigned long updateRangeStart;
@@ -167,6 +167,7 @@
"input",
"inputreport",
"inputsourceschange",
"interest",
"invoke",
"install",
"interfacerequest",
@@ -187,6 +188,7 @@
"loadingdone",
"loadingerror",
"loadstart",
"loseinterest",
"lostpointercapture",
"managedconfigurationchange",
"mark",
@@ -0,0 +1,17 @@
// 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.
[
RuntimeEnabled=HTMLInterestTargetAttribute,
Exposed=Window
] interface InterestEvent : Event {
constructor(DOMString type, optional InterestEventInit eventInitDict = {});
readonly attribute Element? invoker;
readonly attribute DOMString action;
};
dictionary InterestEventInit : EventInit {
Element? invoker = null;
DOMString action = "";
};
@@ -20,7 +20,7 @@
[MeasureAs=PointerEventAttributeCount] readonly attribute long twist;
[MeasureAs=PointerEventAttributeCount] readonly attribute DOMString pointerType;
[MeasureAs=PointerEventAttributeCount] readonly attribute boolean isPrimary;
[Measure, RuntimeEnabled=PointerEventDeviceId] readonly attribute long deviceId;
[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;
long deviceId = -1;
DeviceProperties deviceProperties;
// https://w3c.github.io/pointerevents/extension.html#extensions-to-the-pointerevent-interface
sequence<PointerEvent> coalescedEvents = [];
@@ -56,10 +56,10 @@
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
#include "third_party/blink/public/mojom/frame/frame_replication_state.mojom-blink.h"
#include "third_party/blink/public/mojom/input/focus_type.mojom-blink.h"
#include "third_party/blink/public/mojom/page/draggable_region.mojom-blink.h"
#include "third_party/blink/public/mojom/window_features/window_features.mojom-blink.h"
#include "third_party/blink/public/platform/interface_registry.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/scheduler/web_thread_scheduler.h"
#include "third_party/blink/public/platform/web_media_player.h"
#include "third_party/blink/public/platform/web_network_state_notifier.h"
#include "third_party/blink/public/platform/web_runtime_features.h"
@@ -1792,6 +1792,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->SetPreferredColorScheme(prefs.preferred_color_scheme);
settings->SetPreferredContrast(prefs.preferred_contrast);
@@ -4016,25 +4018,47 @@ bool WebViewImpl::IsFencedFrameRoot() const {
return GetPage()->IsMainFrameFencedFrameRoot();
}
void WebViewImpl::SetSupportsAppRegion(bool supports_app_region) {
supports_app_region_ = supports_app_region;
void WebViewImpl::SetSupportsDraggableRegions(bool supports_draggable_regions) {
supports_draggable_regions_ = supports_draggable_regions;
if (!MainFrameImpl() || !MainFrameImpl()->GetFrame()) {
return;
}
LocalFrame* local_frame = MainFrameImpl()->GetFrame();
if (supports_app_region_) {
local_frame->View()->UpdateDocumentAnnotatedRegions();
if (supports_draggable_regions_) {
local_frame->View()->UpdateDocumentDraggableRegions();
} else {
local_frame->GetDocument()->SetAnnotatedRegions(
Vector<AnnotatedRegionValue>());
local_frame->Client()->AnnotatedRegionsChanged();
local_frame->GetDocument()->SetDraggableRegions(
Vector<DraggableRegionValue>());
chrome_client_->DraggableRegionsChanged();
}
}
bool WebViewImpl::SupportsAppRegion() {
return supports_app_region_;
bool WebViewImpl::SupportsDraggableRegions() {
return supports_draggable_regions_;
}
void WebViewImpl::DraggableRegionsChanged() {
WebVector<WebDraggableRegion> web_regions =
MainFrameImpl()->GetDocument().DraggableRegions();
// If |supports_draggable_regions_| is false, the web view should only send
// empty regions to reset a previously set draggable regions.
DCHECK(supports_draggable_regions_ || web_regions.empty());
auto regions = Vector<mojom::blink::DraggableRegionPtr>();
for (WebDraggableRegion& web_region : web_regions) {
auto converted_bounds =
MainFrame()->ToWebLocalFrame()->FrameWidget()->BlinkSpaceToEnclosedDIPs(
web_region.bounds);
auto region = mojom::blink::DraggableRegion::New(converted_bounds,
web_region.draggable);
regions.emplace_back(std::move(region));
}
local_main_frame_host_remote_->DraggableRegionsChanged(std::move(regions));
}
void WebViewImpl::MojoDisconnected() {
@@ -1,53 +0,0 @@
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://github.com/WICG/pending-beacon/blob/main/README.md
enum BeaconMethod { "POST", "GET" };
dictionary PendingBeaconOptions {
long backgroundTimeout = -1;
long timeout = -1;
};
// Interface for the PendingBeacon API.
[
RuntimeEnabled = PendingBeaconAPI,
Exposed = Window,
SecureContext
] interface PendingBeacon {
[Measure] readonly attribute USVString url;
[Measure] readonly attribute BeaconMethod method;
[Measure] attribute long backgroundTimeout;
[Measure] attribute long timeout;
[Measure] readonly attribute boolean pending;
[Measure] void deactivate();
[Measure] void sendNow();
};
// Interface for the PendingGetBeacon API.
[
RuntimeEnabled = PendingBeaconAPI,
Exposed = Window,
SecureContext
] interface PendingGetBeacon : PendingBeacon {
[Measure, RaisesException, CallWith = ExecutionContext] constructor(
USVString? url, optional PendingBeaconOptions options);
[Measure, RaisesException] void setURL(USVString? url);
};
// Interface for the PendingPostBeacon API.
[
RuntimeEnabled = PendingBeaconAPI,
Exposed = Window,
SecureContext
] interface PendingPostBeacon : PendingBeacon {
[Measure, RaisesException, CallWith = ExecutionContext] constructor(
USVString? url, optional PendingBeaconOptions options);
[Measure, RaisesException] void setData(
(ReadableStream or XMLHttpRequestBodyInit) data);
};
@@ -1092,6 +1092,19 @@
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.
{
name: "browserPreferredColorScheme",
initial: "mojom::blink::PreferredColorScheme::kLight",
invalidate: ["ColorScheme"],
type: "mojom::blink::PreferredColorScheme",
include_paths: [
"third_party/blink/public/mojom/css/preferred_color_scheme.mojom-shared.h"
],
},
// Preferred color scheme from the OS/application passed to the renderer for
// evaluating the prefers-color-scheme media query.
{
@@ -51,4 +51,5 @@
attribute EventHandler onresize;
attribute EventHandler onscroll;
[RuntimeEnabled=VisualViewportOnScrollEnd] attribute EventHandler onscrollend;
};
@@ -19,18 +19,19 @@ dictionary FenceEvent {
DOMString eventData;
sequence<FenceReportingDestination> destination;
// Determines if this data can be sent in a reportEvent() beacon or automatic
// beacon that originates from a document that is cross-origin to the mapped
// URL of the fenced frame config that loaded this frame tree.
// Note that automatic beacon data can only be set from documents that are
// same-origin to the fenced frame config's mapped URL, so this effectively
// opts in the data to being used in a cross-origin subframe.
boolean crossOriginExposed = false;
// When setting event data to be used later in an automatic beacon, the
// following properties are used:
// Determines if the beacon data will be used for only the next automatic
// beacon event, or if it will be reused for all subsequent automatic beacons.
boolean once = false;
// Determines if this data can be used for an automatic beacon that originates
// from a document that is cross-origin to the mapped URL of the fenced frame
// config that loaded this frame tree. Note that automatic beacon data can
// only be set from documents that are same-origin to the fenced frame
// config's mapped URL, so this effectively opts in the data to being used
// cross-origin.
boolean crossOriginExposed = false;
// When reporting to a custom destination URL (with substitution of macros
// defined by the buyer), the following property is used:
@@ -39,3 +39,4 @@
};
HTMLAreaElement includes HTMLHyperlinkElementUtils;
HTMLAreaElement includes InterestInvokerElement;
@@ -43,7 +43,7 @@
// EditContext
// https://w3c.github.io/edit-context/
[RuntimeEnabled=EditContext, RaisesException=Setter] attribute EditContext? editContext;
[RaisesException=Setter] attribute EditContext? editContext;
// HTMLElement includes ElementContentEditable
// https://html.spec.whatwg.org/C/#contenteditable
@@ -35,15 +35,6 @@
] interface HTMLTemplateElement : HTMLElement {
readonly attribute DocumentFragment content;
// This is the deprecated and removed IDL for `shadowRoot`, which was used
// by the old declarative shadow DOM proposal. Note that it was only used
// for feature detection - this override of `shadowRoot` returns the same
// thing as HTMLElement's `shadowRoot` attribute. For safety, it is here,
// guarded by a runtime flag, in case of compat problems.
// TODO(crbug.com/1396384) Eventually remove this.
[ImplementedAs=OpenShadowRoot, RuntimeEnabled=DeprecatedTemplateShadowRoot]
readonly attribute ShadowRoot? shadowRoot;
// These are the declarative Shadow DOM IDL attributes, which reflect the
// equivalent content attributes. Note that these are just the reflections
// of HTMLTemplateElement's attribute, which isn't a common use case: in
@@ -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.
[
Exposed=Window,
RuntimeEnabled=PointerEventDeviceId
] interface DeviceProperties {
constructor(optional DevicePropertiesInit devicePropertiesInitDict = {});
[Measure] readonly attribute long uniqueId;
};
@@ -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://w3c.github.io/pointerevents/#pointerevent-interface
dictionary DevicePropertiesInit {
long uniqueId = -1;
};
@@ -13,6 +13,7 @@
#include "services/network/public/cpp/attribution_reporting_runtime_features.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/features_generated.h"
#include "third_party/blink/public/common/origin_trials/origin_trials.h"
#include "third_party/blink/public/common/origin_trials/trial_token.h"
#include "third_party/blink/public/common/origin_trials/trial_token_result.h"
@@ -534,10 +535,6 @@ bool OriginTrialContext::CanEnableTrialFromName(const StringView& trial_name) {
features::kSpeculationRulesPrefetchFuture);
}
if (trial_name == "PendingBeaconAPI") {
return base::FeatureList::IsEnabled(features::kPendingBeaconAPI);
}
if (trial_name == "BackForwardCacheSendNotRestoredReasons") {
return base::FeatureList::IsEnabled(
features::kBackForwardCacheSendNotRestoredReasons);
@@ -555,14 +552,15 @@ bool OriginTrialContext::CanEnableTrialFromName(const StringView& trial_name) {
network::features::kAttributionReportingCrossAppWeb);
}
if (trial_name == "ComputePressure_v2") {
return base::FeatureList::IsEnabled(features::kComputePressure);
}
if (trial_name == "SoftNavigationHeuristics") {
return base::FeatureList::IsEnabled(features::kSoftNavigationDetection);
}
if (trial_name == "FoldableAPIs") {
return base::FeatureList::IsEnabled(features::kViewportSegments) &&
base::FeatureList::IsEnabled(features::kDevicePosture);
}
return true;
}
@@ -215,7 +215,6 @@ interface Internals {
sequence<DOMString> shortcutIconURLs(Document document);
sequence<DOMString> allIconURLs(Document document);
[RaisesException] long numberOfPages(optional double pageWidthInPixels = 800, optional double pageHeightInPixels = 600);
[RaisesException] DOMString pageProperty(DOMString propertyName, unsigned long pageNumber);
[RaisesException] float pageScaleFactor();
[RaisesException] void setPageScaleFactor(float scaleFactor);
[RaisesException] void setPageScaleFactorLimits(float minScaleFactor, float maxScaleFactor);
@@ -264,7 +263,7 @@ interface Internals {
// Overrides default behavior to support the app-region CSS property.
// Setting to true enables collection of draggable/non-draggable
// app regions.
void SetSupportsAppRegion(boolean supports_app_regions);
void SetSupportsDraggableRegions(boolean supports_draggable_regionss);
// Returns a string with information about the mouse cursor used at the specified client location.
DOMString getCurrentCursorInfo();
@@ -28,4 +28,9 @@
// transition (where this object is provided via an event), this Promise is
// resolved on creation.
[CallWith=ScriptState] readonly attribute Promise<undefined> updateCallbackDone;
// This will return a ViewTransitionTypeSet that represents the active list of types
// for this transition. These types are selectable using the
// :active-view-transition-type pseudo-class.
[RuntimeEnabled=ViewTransitionTypes] readonly attribute ViewTransitionTypeSet types;
};
@@ -3,5 +3,5 @@
// found in the LICENSE file.
dictionary ViewTransitionOptions {
ViewTransitionCallback? update = null;
sequence<DOMString>? type = null;
sequence<DOMString>? types = null;
};
@@ -0,0 +1,8 @@
// 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.
[Exposed=Window, RuntimeEnabled=ViewTransitionTypes]
interface ViewTransitionTypeSet {
setlike<DOMString>;
[RaisesException] void add(DOMString key);
};
@@ -20,5 +20,5 @@ dictionary GetMediaIntegrityTokenProviderParams {
// time to resolve (> 1s).
//
// The promise may reject as a MediaIntegrityError.
[NewObject, CallWith=ScriptState, HighEntropy, RaisesException, RuntimeEnabled=BlinkExtensionWebViewMediaIntegrity] Promise<MediaIntegrityTokenProvider> getExperimentalMediaIntegrityTokenProvider(GetMediaIntegrityTokenProviderParams params);
[NewObject, CallWith=ScriptState, HighEntropy, RaisesException, RuntimeEnabled=BlinkExtensionWebViewMediaIntegrity, SecureContext] Promise<MediaIntegrityTokenProvider> getExperimentalMediaIntegrityTokenProvider(GetMediaIntegrityTokenProviderParams params);
};
@@ -5,10 +5,16 @@
// Information about a Bidding and Auction server style auction.
// https://github.com/WICG/turtledove/blob/main/FLEDGE_browser_bidding_and_auction_API.md
dictionary AdAuctionDataBuyerConfig {
unsigned long targetSize;
};
dictionary AdAuctionDataConfig {
required USVString seller;
// TODO(1473331): Make `coordinator` required.
// TODO(crbug.com/40278958): Make `coordinator` required.
USVString coordinatorOrigin;
unsigned long requestSize;
record<USVString, AdAuctionDataBuyerConfig> perBuyerConfig;
};
dictionary AdAuctionData {
@@ -9,5 +9,5 @@
[CallWith=ExecutionContext] constructor(DOMString type, optional BeforeInstallPromptEventInit eventInitDict = {});
[HighEntropy=Direct, Measure] readonly attribute FrozenArray<DOMString> platforms;
[CallWith=ScriptState, RaisesException] readonly attribute Promise<AppBannerPromptResult> userChoice;
[CallWith=ScriptState, RaisesException] Promise<void> prompt();
[CallWith=ScriptState, RaisesException] Promise<AppBannerPromptResult> prompt();
};
@@ -8,8 +8,8 @@
ImplementedAs=NavigatorBadge
] partial interface Navigator {
[CallWith=ScriptState, MeasureAs=BadgeSet, RaisesException]
Promise<void> setAppBadge(optional [EnforceRange] unsigned long long contents);
Promise<undefined> setAppBadge(optional [EnforceRange] unsigned long long contents);
[CallWith=ScriptState, MeasureAs=BadgeClear, RaisesException]
Promise<void> clearAppBadge();
Promise<undefined> clearAppBadge();
};
@@ -8,8 +8,8 @@
ImplementedAs=NavigatorBadge
] partial interface WorkerNavigator {
[Exposed=ServiceWorker, CallWith=ScriptState, MeasureAs=BadgeSet, RaisesException]
Promise<void> setAppBadge(optional [EnforceRange] unsigned long long contents);
Promise<undefined> setAppBadge(optional [EnforceRange] unsigned long long contents);
[Exposed=ServiceWorker, CallWith=ScriptState, MeasureAs=BadgeClear, RaisesException]
Promise<void> clearAppBadge();
Promise<undefined> clearAppBadge();
};
@@ -18,7 +18,6 @@ dictionary ClipboardUnsanitizedFormats {
] Promise<sequence<ClipboardItem>> read();
[MeasureAs=AsyncClipboardAPIUnsanitizedRead,
RuntimeEnabled=ClipboardUnsanitizedContent,
CallWith=ScriptState,
RaisesException
] Promise<sequence<ClipboardItem>> read(ClipboardUnsanitizedFormats formats);
@@ -14,16 +14,15 @@ enum PressureSource {
SecureContext
] interface PressureObserver {
[
MeasureAs=PressureObserver_Constructor,
RaisesException
] constructor(PressureUpdateCallback callback,
optional PressureObserverOptions options = {});
MeasureAs=PressureObserver_Constructor
] constructor(PressureUpdateCallback callback);
[
CallWith=ScriptState,
MeasureAs=PressureObserver_Observe,
RaisesException
] Promise<undefined> observe(PressureSource source);
] Promise<undefined> observe(PressureSource source,
optional PressureObserverOptions options = {});
[
MeasureAs=PressureObserver_Unobserve
@@ -34,7 +33,7 @@ enum PressureSource {
[
SameObject,
SaveSameObject
] static readonly attribute FrozenArray<PressureSource> supportedSources;
] static readonly attribute FrozenArray<PressureSource> knownSources;
[
MeasureAs=PressureObserver_TakeRecords
@@ -4,5 +4,5 @@
// https://w3c.github.io/compute-pressure/#the-pressureobserveroptions-dictionary
dictionary PressureObserverOptions {
double sampleRate = 1.0;
[EnforceRange] unsigned long sampleInterval = 0;
};
@@ -4,5 +4,11 @@
// https://wicg.github.io/digital-identities/#the-digitalcredentialrequestoptions-dictionary
dictionary DigitalCredentialRequestOptions {
required sequence<DigitalCredentialProvider> providers;
required sequence<IdentityRequestProvider> providers;
};
// https://wicg.github.io/digital-identities/#dom-identityrequestprovider
dictionary IdentityRequestProvider {
required DOMString protocol;
required DOMString request;
};
@@ -9,6 +9,10 @@ dictionary IdentityUserInfo {
USVString picture;
};
dictionary IdentityResolveOptions {
USVString accountId;
};
// https://fedidcg.github.io/FedCM/#identityprovider
[
Exposed=Window,
@@ -23,12 +27,12 @@ dictionary IdentityUserInfo {
static void close();
[RuntimeEnabled=FedCmIdPRegistration, CallWith=ScriptState, ImplementedAs=registerIdentityProvider]
static Promise<undefined> register(USVString configURL);
static Promise<boolean> register(USVString configURL);
[RuntimeEnabled=FedCmIdPRegistration, CallWith=ScriptState, ImplementedAs=unregisterIdentityProvider]
static Promise<undefined> unregister(USVString configURL);
// Allows an IdP to return a token to the RP from the content area, as opposed to
// over HTTP with the id_assertion_endpoint.
[RuntimeEnabled=FedCmAuthz, CallWith=ScriptState]
static Promise<undefined> resolve(USVString token);
static Promise<undefined> resolve(USVString token, optional IdentityResolveOptions options = {});
};
@@ -35,12 +35,6 @@ dictionary DigitalCredentialProvider {
// An opaque map of parameters sent to wallets upon selection.
record<USVString, USVString> params;
// Alternatively, a provider can also be specified by a protocol and a
// request.
DOMString protocol;
DOMString request;
DOMString publicKey;
};
dictionary DigitalCredentialSelector {
@@ -24,5 +24,5 @@ partial interface Navigator {
]
interface NavigatorLogin {
[CallWith=ScriptState, MeasureAs=FedCmIdpSigninStatusJsApi]
Promise<void> setStatus(LoginStatus status);
Promise<undefined> setStatus(LoginStatus status);
};
@@ -7,5 +7,5 @@
[
Exposed=Window
] interface Ink {
[CallWith=ScriptState, RaisesException] Promise<DelegatedInkTrailPresenter> requestPresenter(optional InkPresenterParam param = {});
[CallWith=ScriptState, Measure, RaisesException] Promise<DelegatedInkTrailPresenter> requestPresenter(optional InkPresenterParam param = {});
};
@@ -44,16 +44,16 @@
CallWith=ScriptState,
RaisesException,
MeasureAs=FileSystemAccessMoveRename
] Promise<void> move(USVString new_entry_name);
] Promise<undefined> move(USVString new_entry_name);
[
CallWith=ScriptState,
RaisesException,
MeasureAs=FileSystemAccessMoveReparent
] Promise<void> move(FileSystemDirectoryHandle destination_directory);
] Promise<undefined> move(FileSystemDirectoryHandle destination_directory);
[
CallWith=ScriptState,
RaisesException,
MeasureAs=FileSystemAccessMoveReparentAndRename
] Promise<void> move(FileSystemDirectoryHandle destination_directory,
] Promise<undefined> move(FileSystemDirectoryHandle destination_directory,
USVString new_entry_name);
};
@@ -13,15 +13,15 @@
[
CallWith=ScriptState,
RaisesException
] Promise<void> write((BufferSource or Blob or USVString or WriteParams) data);
] Promise<undefined> write((BufferSource or Blob or USVString or WriteParams) data);
[
CallWith=ScriptState,
RaisesException
] Promise<void> truncate(unsigned long long size);
] Promise<undefined> truncate(unsigned long long size);
[
CallWith=ScriptState,
RaisesException
] Promise<void> seek(unsigned long long offset);
] Promise<undefined> seek(unsigned long long offset);
};
@@ -16,8 +16,8 @@
Promise<any> getData(DOMString key);
[CallWith=ScriptState]
Promise<void> setData(DOMString key, DOMString data);
Promise<undefined> setData(DOMString key, DOMString data);
[CallWith=ScriptState]
Promise<void> deleteData(DOMString key);
Promise<undefined> deleteData(DOMString key);
};
@@ -4,8 +4,11 @@
// https://wicg.github.io/mediasession/#dictdef-chapterinformation
dictionary ChapterInformation {
DOMString title = "";
double startTime = 0;
sequence<MediaImage> artwork;
[
Exposed=Window,
RuntimeEnabled=MediaSessionChapterInformation
] interface ChapterInformation {
readonly attribute DOMString title;
readonly attribute double startTime;
[SameObject] readonly attribute FrozenArray<MediaImage> artwork;
};
@@ -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.
// https://wicg.github.io/mediasession/#dictdef-chapterinformation
dictionary ChapterInformationInit {
DOMString title = "";
double startTime = 0;
sequence<MediaImage> artwork = [];
};
@@ -13,5 +13,5 @@
attribute DOMString artist;
attribute DOMString album;
[CallWith=ScriptState, RaisesException=Setter] attribute FrozenArray<MediaImage> artwork;
[RuntimeEnabled=MediaSessionChapterInformation, CallWith=ScriptState, RaisesException=Setter] attribute FrozenArray<ChapterInformation> chapterInfo;
[RuntimeEnabled=MediaSessionChapterInformation, CallWith=ScriptState, RaisesException=Setter, SameObject] readonly attribute FrozenArray<ChapterInformation> chapterInfo;
};
@@ -9,5 +9,5 @@ dictionary MediaMetadataInit {
DOMString artist = "";
DOMString album = "";
sequence<MediaImage> artwork = [];
sequence<ChapterInformation> chapterInfo = [];
sequence<ChapterInformationInit> chapterInfo = [];
};
@@ -55,7 +55,7 @@ enum MediaStreamTrackState {
MediaTrackConstraints getConstraints();
MediaTrackSettings getSettings();
// https://w3c.github.io/mediacapture-extensions/#mediastreamtrack-statistics
[SameObject, Measure] readonly attribute MediaStreamTrackVideoStats? stats;
[SameObject, Measure] readonly attribute (MediaStreamTrackVideoStats or MediaStreamTrackAudioStats)? stats;
// https://w3c.github.io/mediacapture-handle/identity/
[RuntimeEnabled=CaptureHandle, MeasureAs=CaptureHandle] CaptureHandle? getCaptureHandle();
@@ -0,0 +1,18 @@
// 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.
[
Exposed=Window
] interface MediaStreamTrackAudioStats {
[CallWith=ScriptState] readonly attribute unsigned long long deliveredFrames;
[CallWith=ScriptState] readonly attribute DOMHighResTimeStamp deliveredFramesDuration;
[CallWith=ScriptState] readonly attribute unsigned long long totalFrames;
[CallWith=ScriptState] readonly attribute DOMHighResTimeStamp totalFramesDuration;
[CallWith=ScriptState] readonly attribute DOMHighResTimeStamp latency;
[CallWith=ScriptState] readonly attribute DOMHighResTimeStamp averageLatency;
[CallWith=ScriptState] readonly attribute DOMHighResTimeStamp minimumLatency;
[CallWith=ScriptState] readonly attribute DOMHighResTimeStamp maximumLatency;
[CallWith=ScriptState] void resetLatency();
[CallWith=ScriptState] object toJSON();
};
@@ -5,7 +5,7 @@
[
ImplementedAs=InternalsMediaStream
] partial interface Internals {
[CallWith=ScriptState] Promise<void> addFakeDevice(
[CallWith=ScriptState] Promise<undefined> addFakeDevice(
MediaDeviceInfo deviceInfo,
MediaTrackConstraints capabilities,
MediaStreamTrack? dataSource);
@@ -36,4 +36,36 @@ dictionary MLComputeResult {
CallWith=ScriptState,
RaisesException
] MLBuffer createBuffer(MLBufferDescriptor descriptor);
// TODO(crbug.com/328105506): enable partial MLBuffer reads/writes.
// TODO(crbug.com/40278771): consider moving arguments into a dictonary
// per W3C recommendations:
// https://w3ctag.github.io/design-principles/#prefer-dictionaries
[
RuntimeEnabled=MachineLearningNeuralNetwork,
CallWith=ScriptState,
RaisesException
] void writeBuffer(
MLBuffer dstBuffer,
[AllowShared] ArrayBufferView srcData,
optional MLSize64 srcElementOffset = 0,
optional MLSize64 srcElementSize);
[
RuntimeEnabled=MachineLearningNeuralNetwork,
CallWith=ScriptState,
RaisesException
] void writeBuffer(
MLBuffer dstBuffer,
ArrayBuffer srcData,
optional MLSize64 srcByteOffset = 0,
optional MLSize64 srcByteSize);
// TODO(crbug.com/328102504): enable transferable view to avoid copy.
[
RuntimeEnabled=MachineLearningNeuralNetwork,
CallWith=ScriptState,
RaisesException
] Promise<ArrayBuffer> readBuffer(
MLBuffer srcBuffer);
};
@@ -22,7 +22,8 @@ enum MLDevicePreference {
// https://www.w3.org/TR/webnn/#enumdef-mldevicetype
enum MLDeviceType {
"cpu",
"gpu"
"gpu",
"npu"
};
enum MLPowerPreference {
@@ -83,6 +83,14 @@ dictionary MLGruOptions {
sequence<MLActivation> activations;
};
dictionary MLGruCellOptions {
MLOperand bias;
MLOperand recurrentBias;
boolean resetAfter = true;
MLGruWeightLayout layout = "zrn";
sequence<MLActivation> activations;
};
dictionary MLHardSigmoidOptions {
float alpha = 0.2;
float beta = 0.5;
@@ -116,6 +124,14 @@ dictionary MLLstmOptions {
sequence<MLActivation> activations;
};
dictionary MLLstmCellOptions {
MLOperand bias;
MLOperand recurrentBias;
MLOperand peepholeWeight;
MLLstmWeightLayout layout = "iofg";
sequence<MLActivation> activations;
};
enum MLPaddingMode {
"constant",
"edge",
@@ -258,6 +274,9 @@ dictionary MLTriangularOptions {
[EnforceRange] unsigned long steps, [EnforceRange] unsigned long hiddenSize,
optional MLGruOptions options = {});
[RaisesException] MLOperand gruCell(MLOperand input, MLOperand weight, MLOperand recurrentWeight, MLOperand hiddenState,
[EnforceRange] unsigned long hiddenSize, optional MLGruCellOptions options = {});
[RaisesException] MLOperand hardSigmoid(MLOperand x, optional MLHardSigmoidOptions options = {});
[RaisesException] MLActivation hardSigmoid(optional MLHardSigmoidOptions options = {});
@@ -280,6 +299,10 @@ dictionary MLTriangularOptions {
[EnforceRange] unsigned long steps, [EnforceRange] unsigned long hiddenSize,
optional MLLstmOptions options = {});
[RaisesException] sequence<MLOperand> lstmCell(MLOperand input, MLOperand weight, MLOperand recurrentWeight,
MLOperand hiddenState, MLOperand cellState, [EnforceRange] unsigned long hiddenSize,
optional MLLstmCellOptions options = {});
[RaisesException] MLOperand pad(MLOperand input, sequence<[EnforceRange] unsigned long> beginningPadding,
sequence<[EnforceRange] unsigned long> endingPadding, optional MLPadOptions options = {});
@@ -7,6 +7,6 @@
Exposed=Window
]
interface ModelGenericSession {
[CallWith=ScriptState, RaisesException] Promise<DOMString> execute(DOMString input);
[CallWith=ScriptState, RaisesException] ReadableStream executeStreaming(DOMString input);
[Measure, CallWith=ScriptState, RaisesException] Promise<DOMString> execute(DOMString input);
[Measure, CallWith=ScriptState, RaisesException] ReadableStream executeStreaming(DOMString input);
};
@@ -9,8 +9,9 @@ enum GenericModelAvailability { "readily", "after-download", "no" };
Exposed=Window
]
interface ModelManager {
[CallWith=ScriptState, RaisesException] Promise<GenericModelAvailability> canCreateGenericSession();
[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();
};
@@ -18,5 +18,5 @@ enum PaymentDelegation {
] interface PaymentManager {
[SameObject, DeprecateAs=PaymentInstruments, RuntimeEnabled=PaymentInstruments] readonly attribute PaymentInstruments instruments;
attribute DOMString userHint;
[CallWith=ScriptState, RaisesException] Promise<void> enableDelegations(sequence<PaymentDelegation> delegations);
[CallWith=ScriptState, RaisesException] Promise<undefined> enableDelegations(sequence<PaymentDelegation> delegations);
};
@@ -14,8 +14,6 @@
attribute ArrayBuffer data;
RTCEncodedAudioFrameMetadata getMetadata();
stringifier;
[RuntimeEnabled=RTCEncodedFrameSetMetadata, Measure, RaisesException] void
setTimestamp(unsigned long timestamp);
[RuntimeEnabled=RTCEncodedFrameSetMetadata, Measure, RaisesException]
void setMetadata(RTCEncodedAudioFrameMetadata metadata);
};
@@ -22,7 +22,5 @@ enum RTCEncodedVideoFrameType {
RTCEncodedVideoFrameMetadata getMetadata();
[RuntimeEnabled=RTCEncodedFrameSetMetadata, Measure, RaisesException]
void setMetadata(RTCEncodedVideoFrameMetadata metadata);
[RuntimeEnabled=RTCEncodedFrameSetMetadata, Measure, RaisesException] void
setTimestamp(unsigned long timestamp);
stringifier;
};
@@ -20,6 +20,5 @@ enum AncestorStatus {
] interface Scheduler {
[CallWith=ScriptState, MeasureAs=SchedulerPostTask, RaisesException] Promise<any> postTask(SchedulerPostTaskCallback callback, optional SchedulerPostTaskOptions options = {});
[RuntimeEnabled=SchedulerYield, MeasureAs=SchedulerYield, CallWith=ScriptState, RaisesException] Promise<undefined> yield(optional SchedulerYieldOptions options = {});
[RuntimeEnabled=UnexposedTaskIds, CallWith=ScriptState, Exposed=Window] readonly attribute unsigned long taskId;
[RuntimeEnabled=UnexposedTaskIds, CallWith=ScriptState, Exposed=Window] AncestorStatus isAncestor(unsigned long parentId);
[RuntimeEnabled=UnexposedTaskIds, CallWith=ScriptState, Exposed=Window] attribute unsigned long taskId;
};
@@ -7,7 +7,7 @@
Exposed=ServiceWorker,
ImplementedAs=ServiceWorkerClients
] interface Clients {
[CallWith=ScriptState] Promise<any> get(DOMString id);
[CallWith=ScriptState] Promise<Client> get(DOMString id);
[CallWith=ScriptState] Promise<sequence<Client>> matchAll(optional ClientQueryOptions options = {});
[CallWith=ScriptState] Promise<WindowClient?> openWindow(USVString url);
[CallWith=ScriptState] Promise<undefined> claim();
@@ -10,10 +10,4 @@
constructor(DOMString type, optional ExtendableEventInit eventInitDict = {});
// https://w3c.github.io/ServiceWorker/#ref-for-dom-installevent-addroutes
[RuntimeEnabled=ServiceWorkerStaticRouter, CallWith=ScriptState, RaisesException, MeasureAs=ServiceWorkerStaticRouter_AddRoutes] Promise<undefined> addRoutes((RouterRule or sequence<RouterRule>) rules);
// Deprecated.
// See:
// https://github.com/WICG/service-worker-static-routing-api/blob/main/README.md#how-chrome-implements-this
// TODO(crbug.com/329285464): remove this method.
[RuntimeEnabled=ServiceWorkerStaticRouter, CallWith=ScriptState, RaisesException, MeasureAs=ServiceWorkerStaticRouter_RegisterRouter] Promise<undefined> registerRouter((RouterRule or sequence<RouterRule>) rules);
};
@@ -23,4 +23,10 @@ dictionary RouterCondition {
// `ImplementedAs` is necessary to avoid conflicts with C++ keyword `or`.
// Chrome WebIDL compiler emits error without the leading underscore.
[ImplementedAs=orConditions] sequence<RouterCondition> _or;
// Experimental.
// For the `not` condition.
// `ImplementedAs` is necessary to avoid conflicts with C++ keyword `not`.
// Chrome WebIDL compiler emits error without the leading underscore.
[ImplementedAs=notCondition] RouterCondition _not;
};
@@ -10,5 +10,5 @@ dictionary DetectedBarcode {
required DOMString format;
// 4 corner points in clockwise direction starting with top-left. Due to
// possible perspective distortions, this is not necessarily a rectangle.
required FrozenArray<Point2D> cornerPoints;
required sequence<Point2D> cornerPoints;
};
@@ -7,5 +7,5 @@
dictionary DetectedFace {
// TODO(xianglu): Implement any other fields. https://crbug.com/646083
required DOMRectReadOnly boundingBox;
required FrozenArray<Landmark> landmarks;
required sequence<Landmark> landmarks;
};

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