[AUTO][FILECONTROL] - version 134.0.6998.39 (#1865)

[AUTO][FILECONTROL] - version 134.0.6998.39
This commit is contained in:
uazo
2025-03-05 02:41:10 -05:00
committed by GitHub
176 changed files with 4223 additions and 2762 deletions
+1 -1
View File
@@ -1 +1 @@
133.0.6943.127
134.0.6998.39
@@ -188,10 +188,6 @@ class XrwNavigationThrottle : public content::NavigationThrottle {
base::WeakPtr<AsyncCheckTracker> GetAsyncCheckTracker(
const base::RepeatingCallback<content::WebContents*()>& wc_getter,
content::FrameTreeNodeId 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.
@@ -582,8 +578,9 @@ void AwContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
}
}
void AwContentBrowserClient::OverrideWebkitPrefs(
void AwContentBrowserClient::OverrideWebPreferences(
content::WebContents* web_contents,
content::SiteInstance& main_frame_site,
blink::web_pref::WebPreferences* web_prefs) {
AwSettings* aw_settings = AwSettings::FromWebContents(web_contents);
if (aw_settings) {
@@ -1017,6 +1014,14 @@ bool AwContentBrowserClient::ShouldDisableSiteIsolation(
return true;
}
bool AwContentBrowserClient::ShouldDisableOriginIsolation() {
// Since AW does not yet support OOPIFs, we must return true here to disable
// features that may trigger OOPIFs, such as origin isolation.
//
// Adding OOPIF support for AW is tracked by https://crbug.com/806404.
return true;
}
bool AwContentBrowserClient::ShouldLockProcessToSite(
content::BrowserContext* browser_context,
const GURL& effective_url) {
@@ -1266,8 +1271,7 @@ bool AwContentBrowserClient::HasErrorPage(int http_status_code) {
bool AwContentBrowserClient::SuppressDifferentOriginSubframeJSDialogs(
content::BrowserContext* browser_context) {
return base::FeatureList::IsEnabled(
features::kWebViewSuppressDifferentOriginSubframeJSDialogs);
return false;
}
bool AwContentBrowserClient::ShouldPreconnectNavigation(
@@ -28,6 +28,7 @@
#include "third_party/blink/public/common/features_generated.h"
#include "ui/android/ui_android_features.h"
#include "ui/gl/gl_features.h"
#include "ui/gl/gl_switches.h"
namespace internal {
@@ -101,9 +102,11 @@ void AwFieldTrials::RegisterFeatureOverrides(base::FeatureList* feature_list) {
aw_feature_overrides.DisableFeature(
net::features::kThirdPartyStoragePartitioning);
#if BUILDFLAG(ENABLE_VALIDATING_COMMAND_DECODER)
// Disable the passthrough on WebView.
aw_feature_overrides.DisableFeature(
::features::kDefaultPassthroughCommandDecoder);
#endif
// HDR does not support webview yet. See crbug.com/1493153 for an explanation.
aw_feature_overrides.DisableFeature(ui::kAndroidHDR);
@@ -239,6 +242,10 @@ void AwFieldTrials::RegisterFeatureOverrides(base::FeatureList* feature_list) {
aw_feature_overrides.DisableFeature(
::features::kFocusRenderWidgetHostViewAndroidOnActionDown);
// Disabling the permission element as it needs embedder support in order to
// function and the webview permission manager cannot support it.
aw_feature_overrides.DisableFeature(blink::features::kPermissionElement);
if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kDebugBsa)) {
// Feature parameters can only be set via a field trial.
const char kTrialName[] = "StudyDebugBsa";
@@ -259,7 +266,7 @@ void AwFieldTrials::RegisterFeatureOverrides(base::FeatureList* feature_list) {
// Feature parameters can only be set via a field trial.
// Note: Performing a field trial here means we cannot include
// |kDIPSTtl| in the testing config json.
// |kBtmTtl| in the testing config json.
{
const char kDipsWebViewExperiment[] = "DipsWebViewExperiment";
const char kDipsWebViewGroup[] = "DipsWebViewGroup";
@@ -268,18 +275,18 @@ void AwFieldTrials::RegisterFeatureOverrides(base::FeatureList* feature_list) {
CHECK(dips_field_trial) << "Unexpected name conflict.";
base::FieldTrialParams params;
const std::string ttl_time_delta_30_days = "30d";
params.emplace(features::kDIPSInteractionTtl.name, ttl_time_delta_30_days);
params.emplace(features::kBtmInteractionTtl.name, ttl_time_delta_30_days);
base::AssociateFieldTrialParams(kDipsWebViewExperiment, kDipsWebViewGroup,
params);
aw_feature_overrides.OverrideFeatureWithFieldTrial(
features::kDIPSTtl,
features::kBtmTtl,
base::FeatureList::OverrideState::OVERRIDE_ENABLE_FEATURE,
dips_field_trial);
}
// Delete Incidental Party State (DIPS) feature is not yet supported on
// WebView.
aw_feature_overrides.DisableFeature(::features::kDIPS);
aw_feature_overrides.DisableFeature(::features::kBtm);
// These features have shown performance improvements in WebView but not some
// other platforms.
@@ -301,6 +308,9 @@ void AwFieldTrials::RegisterFeatureOverrides(base::FeatureList* feature_list) {
// Disable Topics on WebView.
aw_feature_overrides.DisableFeature(blink::features::kBrowsingTopics);
// Sharing ANGLE's Vulkan queue is not supported on WebView.
aw_feature_overrides.DisableFeature(::features::kVulkanFromANGLE);
// Temporarily turn off kFileSystemAccessDirectoryIterationBlocklistCheck for
// a kill switch. https://crbug.com/393606977
aw_feature_overrides.DisableFeature(
@@ -122,7 +122,7 @@ by a child template that "extends" this file.
<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.SCENE_UNDERSTANDING_FINE" />
<uses-permission-sdk-23 android:name="android.permission.HAND_TRACKING" />
{% endif %}
@@ -446,6 +446,18 @@ by a child template that "extends" this file.
</intent-filter>
</activity>
<activity android:name="org.chromium.chrome.browser.AutofillOptionsLauncher"
android:theme="@style/Theme.BrowserUI.NoDisplay"
android:excludeFromRecents="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.APP_BROWSER" />
<category android:name="android.intent.category.PREFERENCE" />
</intent-filter>
</activity>
<activity android:name="org.chromium.chrome.browser.app.reengagement.ReengagementActivity"
android:theme="@style/Theme.BrowserUI.Translucent"
android:taskAffinity=""
@@ -984,11 +996,13 @@ by a child template that "extends" this file.
<receiver android:name="org.chromium.chrome.browser.notifications.NotificationServiceImpl$Receiver"
android:exported="false">
<intent-filter>
<action android:name="org.chromium.chrome.browser.notifications.ALWAYS_ALLOW" />
<action android:name="org.chromium.chrome.browser.notifications.CLICK_NOTIFICATION" />
<action android:name="org.chromium.chrome.browser.notifications.CLOSE_NOTIFICATION" />
<action android:name="org.chromium.chrome.browser.notifications.PRE_UNSUBSCRIBE" />
<action android:name="org.chromium.chrome.browser.notifications.UNDO_UNSUBSCRIBE" />
<action android:name="org.chromium.chrome.browser.notifications.COMMIT_UNSUBSCRIBE" />
<action android:name="org.chromium.chrome.browser.notifications.PRE_UNSUBSCRIBE" />
<action android:name="org.chromium.chrome.browser.notifications.SHOW_ORIGINAL_NOTIFICATION" />
<action android:name="org.chromium.chrome.browser.notifications.UNDO_UNSUBSCRIBE" />
</intent-filter>
</receiver>
@@ -1225,7 +1239,7 @@ by a child template that "extends" this file.
{% endif %} />
{% endfor %}
{% set num_privileged_services = 5 %}
{% set num_privileged_services = 10 %}
<meta-data android:name="org.chromium.content.browser.NUM_PRIVILEGED_SERVICES"
android:value="{{ num_privileged_services }}"/>
@@ -1275,6 +1289,11 @@ by a child template that "extends" this file.
{% endif %}
{% if enable_vr == "true" %}
<!-- TODO(https://crbug.com/393557658): Investigate removing this. -->
<uses-native-library android:name="libopenxr.google.so" android:required="false" />
{% endif %}
<!-- Cast support -->
<meta-data
android:name=
@@ -1349,6 +1368,13 @@ by a child template that "extends" this file.
android:grantUriPermissions="true">
</provider>
<!-- Provider for querying the Autofill third party mode state. -->
<provider android:name="org.chromium.chrome.browser.autofill.AutofillThirdPartyModeContentProvider"
android:authorities="{{ manifest_package }}.AutofillThirdPartyModeContentProvider"
android:exported="true"
tools:ignore="ExportedContentProvider">
</provider>
{% block base_application_definitions %}
{% endblock %}
{% block extra_application_definitions_for_test %}
@@ -6,6 +6,7 @@
#include <stdint.h>
#include <algorithm>
#include <set>
#include <string>
#include <utility>
@@ -24,7 +25,6 @@
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/not_fatal_until.h"
#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/task/bind_post_task.h"
#include "base/task/thread_pool.h"
@@ -70,7 +70,6 @@
#include "chrome/browser/profiles/keep_alive/scoped_profile_keep_alive.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/reading_list/reading_list_model_factory.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/safe_browsing/verdict_cache_manager_factory.h"
#include "chrome/browser/search_engine_choice/search_engine_choice_service_factory.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
@@ -184,6 +183,8 @@
#if !BUILDFLAG(IS_ANDROID)
#include "chrome/browser/new_tab_page/microsoft_auth/microsoft_auth_service.h"
#include "chrome/browser/new_tab_page/microsoft_auth/microsoft_auth_service_factory.h"
#include "chrome/browser/user_annotations/user_annotations_service_factory.h"
#include "chrome/browser/user_education/browser_user_education_storage_service.h"
#include "chrome/browser/web_applications/web_app.h"
@@ -224,6 +225,10 @@
#include "chrome/browser/media/cdm_document_service_impl.h"
#endif // BUILDFLAG(IS_WIN)
#if BUILDFLAG(SAFE_BROWSING_AVAILABLE)
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#endif
using base::UserMetricsAction;
using content::BrowserContext;
using content::BrowserThread;
@@ -660,10 +665,12 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
base::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies"));
network::mojom::NetworkContext* safe_browsing_context = nullptr;
#if BUILDFLAG(SAFE_BROWSING_AVAILABLE)
safe_browsing::SafeBrowsingService* sb_service =
g_browser_process->safe_browsing_service();
if (sb_service)
safe_browsing_context = sb_service->GetNetworkContext(profile_);
#endif
// Cleared for DATA_TYPE_HISTORY, DATA_TYPE_COOKIES and DATA_TYPE_PASSWORDS.
browsing_data::RemoveFederatedSiteSettingsData(delete_begin_, delete_end_,
@@ -733,6 +740,21 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
delete_begin_, delete_end_, std::move(storage_key_matcher),
CreateTaskCompletionClosure(TracingDataType::kMediaDeviceSalts));
}
#if !BUILDFLAG(IS_ANDROID)
// Remove local storage data from New Tab page when whenever there's a
// Microsoft auth service and cookies and site data is cleared.
MicrosoftAuthService* microsoft_auth_service =
MicrosoftAuthServiceFactory::GetForProfile(profile_);
if (microsoft_auth_service) {
microsoft_auth_service->ClearAuthData();
profile_->GetDefaultStoragePartition()->ClearDataForOrigin(
content::StoragePartition::REMOVE_DATA_MASK_LOCAL_STORAGE,
/*quota_storage_remove_mask=*/0, GURL(chrome::kChromeUINewTabPageURL),
base::DoNothing());
}
#endif // !BUILDFLAG(IS_ANDROID)
}
//////////////////////////////////////////////////////////////////////////////
@@ -900,6 +922,10 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
ContentSettingsType::NOTIFICATION_INTERACTIONS, delete_begin_,
delete_end_, website_settings_filter);
host_content_settings_map_->ClearSettingsForOneTypeWithPredicate(
ContentSettingsType::ARE_SUSPICIOUS_NOTIFICATIONS_ALLOWLISTED_BY_USER,
delete_begin_, delete_end_, website_settings_filter);
PermissionDecisionAutoBlockerFactory::GetForProfile(profile_)
->RemoveEmbargoAndResetCounts(filter);
}
@@ -1047,6 +1073,8 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
if (web_data_service.get()) {
web_data_service->RemoveFormElementsAddedBetween(delete_begin_,
delete_end_);
web_data_service->RemoveEntityInstancesModifiedBetween(delete_begin_,
delete_end_);
// Clear out the Autofill StrikeDatabase in its entirety.
// TODO(crbug.com/40594007): Respect |delete_begin_| and |delete_end_| and
// only clear out entries whose last strikes were created in that
@@ -1393,7 +1421,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
// StoragePartition of an IWA, and all Controlled Frame StoragePartitions if
// DATA_TYPE_CONTROLLED_FRAME is specified in `remove_mask`.
if (!filter_builder->GetStoragePartitionConfig().has_value() &&
content::IsolatedWebAppsPolicy::AreIsolatedWebAppsEnabled(profile_)) {
content::AreIsolatedWebAppsEnabled(profile_)) {
const web_app::WebAppRegistrar& web_app_registrar =
web_app::WebAppProvider::GetForLocalAppsUnchecked(profile_)
->registrar_unsafe();
@@ -1467,9 +1495,8 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
ContentSettingsType::TOP_LEVEL_STORAGE_ACCESS}) {
host_content_settings_map_->ClearSettingsForOneTypeWithPredicate(
type_to_clear, [&](const ContentSettingPatternSource& setting) {
return content_settings::IsGrantedByRelatedWebsiteSets(
type_to_clear, setting.metadata) &&
base::ranges::any_of(
return setting.metadata.decided_by_related_website_sets() &&
std::ranges::any_of(
filter_builder->GetOrigins(),
[&](const url::Origin& origin) -> bool {
return setting.primary_pattern.Matches(
@@ -1576,8 +1603,6 @@ void ChromeBrowsingDataRemoverDelegate::OnTaskComplete(
sync_service->GetUserSettings()->KeepAccountSettingsPrefsOnlyForUsers(
base::ToVector(gaia_ids, &signin::GaiaIdHash::FromGaiaId));
}
password_manager::features_util::KeepAccountStorageSettingsOnlyForUsers(
profile_->GetPrefs(), std::move(gaia_ids).extract());
}
#endif // !BUILDFLAG(IS_ANDROID)
@@ -1760,9 +1785,8 @@ void ChromeBrowsingDataRemoverDelegate::DisablePasswordsAutoSignin(
CreateTaskCompletionClosure(
TracingDataType::kDisableAutoSigninForProfilePasswords));
}
if (account_store &&
password_manager::features_util::IsOptedInForAccountStorage(
profile_->GetPrefs(), sync_service)) {
if (account_store && password_manager::features_util::IsAccountStorageEnabled(
profile_->GetPrefs(), sync_service)) {
account_store->DisableAutoSignInForOrigins(
url_filter,
CreateTaskCompletionClosure(
@@ -90,7 +90,7 @@
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/site_engagement/core/mojom/site_engagement_details.mojom.h"
#include "components/translate/content/common/translate.mojom.h"
#include "components/user_notes/user_notes_features.h"
#include "components/webui/chrome_urls/features.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
@@ -108,8 +108,8 @@
#include "third_party/blink/public/mojom/facilitated_payments/payment_link_handler.mojom.h"
#include "third_party/blink/public/mojom/lcp_critical_path_predictor/lcp_critical_path_predictor.mojom.h"
#include "third_party/blink/public/mojom/loader/navigation_predictor.mojom.h"
#include "third_party/blink/public/mojom/payments/payment_credential.mojom.h"
#include "third_party/blink/public/mojom/payments/payment_request.mojom.h"
#include "third_party/blink/public/mojom/payments/secure_payment_confirmation_service.mojom.h"
#include "third_party/blink/public/mojom/prerender/prerender.mojom.h"
#include "third_party/blink/public/public_buildflags.h"
#include "ui/accessibility/accessibility_features.h"
@@ -126,14 +126,21 @@
#endif // BUILDFLAG(FULL_SAFE_BROWSING)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_CHROMEOS_ASH)
BUILDFLAG(IS_CHROMEOS)
#include "chrome/browser/screen_ai/screen_ai_service_router.h"
#include "chrome/browser/screen_ai/screen_ai_service_router_factory.h"
#include "chrome/browser/ui/web_applications/sub_apps_service_impl.h"
#include "chrome/browser/ui/webui/connectors_internals/connectors_internals.mojom.h"
#include "chrome/browser/ui/webui/connectors_internals/connectors_internals_ui.h"
#include "chrome/browser/ui/webui/discards/discards.mojom.h"
#include "chrome/browser/ui/webui/discards/discards_ui.h"
#include "chrome/browser/ui/webui/discards/site_data.mojom.h"
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
#include "chrome/browser/ui/webui/app_settings/web_app_settings_ui.h"
#include "chrome/browser/ui/webui/on_device_translation_internals/on_device_translation_internals_ui.h"
#include "chrome/browser/ui/webui/whats_new/whats_new_ui.h"
#include "ui/webui/resources/cr_components/app_management/app_management.mojom.h"
#endif
@@ -151,6 +158,7 @@
#else
#include "chrome/browser/badging/badge_manager.h"
#include "chrome/browser/new_tab_page/modules/file_suggestion/drive_suggestion.mojom.h"
#include "chrome/browser/new_tab_page/modules/file_suggestion/microsoft_files.mojom.h"
#include "chrome/browser/new_tab_page/modules/v2/authentication/microsoft_auth.mojom.h"
#include "chrome/browser/new_tab_page/modules/v2/calendar/google_calendar.mojom.h"
#include "chrome/browser/new_tab_page/modules/v2/calendar/outlook_calendar.mojom.h"
@@ -180,6 +188,7 @@
#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"
#include "chrome/browser/ui/webui/ntp_microsoft_auth/ntp_microsoft_auth_untrusted_ui.h"
#include "chrome/browser/ui/webui/omnibox_popup/omnibox_popup_ui.h"
#include "chrome/browser/ui/webui/password_manager/password_manager_ui.h"
#include "chrome/browser/ui/webui/privacy_sandbox/private_state_tokens/private_state_tokens.mojom.h"
@@ -219,32 +228,14 @@
#include "ui/webui/resources/js/metrics_reporter/metrics_reporter.mojom.h"
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_CHROMEOS)
#include "chrome/browser/screen_ai/screen_ai_service_router.h"
#include "chrome/browser/screen_ai/screen_ai_service_router_factory.h"
#include "chrome/browser/ui/web_applications/sub_apps_service_impl.h"
#include "chrome/browser/ui/webui/discards/discards.mojom.h"
#include "chrome/browser/ui/webui/discards/discards_ui.h"
#include "chrome/browser/ui/webui/discards/site_data.mojom.h"
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) ||
// BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
#include "chrome/browser/ui/webui/whats_new/whats_new_ui.h"
#endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
#if !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID)
#include "chrome/browser/ui/webui/app_home/app_home.mojom.h"
#include "chrome/browser/ui/webui/app_home/app_home_ui.h"
#endif // !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID)
#if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_ANDROID)
#include "chrome/browser/ui/webui/signin/profile_customization_ui.h"
#include "chrome/browser/ui/webui/signin/profile_picker_ui.h"
#endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
#endif // !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS)
#include "ash/constants/ash_features.h"
#include "ash/public/mojom/hid_preserving_bluetooth_state_controller.mojom.h"
#include "ash/webui/annotator/mojom/untrusted_annotator.mojom.h"
@@ -337,6 +328,8 @@
#include "chrome/browser/ui/webui/ash/crostini_upgrader/crostini_upgrader.mojom.h"
#include "chrome/browser/ui/webui/ash/crostini_upgrader/crostini_upgrader_ui.h"
#include "chrome/browser/ui/webui/ash/curtain_ui/remote_maintenance_curtain_ui.h"
#include "chrome/browser/ui/webui/ash/dlp_internals/dlp_internals.mojom.h"
#include "chrome/browser/ui/webui/ash/dlp_internals/dlp_internals_ui.h"
#include "chrome/browser/ui/webui/ash/emoji/emoji_picker.mojom.h"
#include "chrome/browser/ui/webui/ash/emoji/emoji_search_proxy.h"
#include "chrome/browser/ui/webui/ash/emoji/emoji_ui.h"
@@ -413,17 +406,17 @@
#include "media/capture/video/chromeos/mojom/camera_app.mojom.h"
#include "third_party/blink/public/mojom/digital_goods/digital_goods.mojom.h"
#include "ui/webui/resources/cr_components/app_management/app_management.mojom.h"
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC)
#include "chrome/browser/webshare/share_service_impl.h"
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_MAC) || \
BUILDFLAG(IS_ANDROID)
#include "third_party/blink/public/mojom/webshare/webshare.mojom.h"
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OFFICIAL_BUILD)
#if BUILDFLAG(IS_CHROMEOS) && !defined(OFFICIAL_BUILD)
#include "ash/webui/sample_system_web_app_ui/mojom/sample_system_web_app_ui.mojom.h"
#include "ash/webui/sample_system_web_app_ui/sample_system_web_app_ui.h"
#include "ash/webui/sample_system_web_app_ui/sample_system_web_app_untrusted_ui.h"
@@ -452,12 +445,6 @@
#include "media/mojo/mojom/speech_recognition_service.mojom.h"
#endif // BUILDFLAG(ENABLE_BROWSER_SPEECH_SERVICE)
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "extensions/browser/api/mime_handler_private/mime_handler_private.h"
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h"
#include "extensions/common/api/mime_handler.mojom.h" // nogncheck
#endif
#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP)
#include "chrome/browser/ui/webui/tab_strip/tab_strip.mojom.h"
#include "chrome/browser/ui/webui/tab_strip/tab_strip_ui.h"
@@ -473,11 +460,6 @@
#include "third_party/blink/public/mojom/printing/web_printing.mojom.h"
#endif
#if BUILDFLAG(IS_CHROMEOS)
#include "chrome/browser/ui/webui/ash/dlp_internals/dlp_internals.mojom.h"
#include "chrome/browser/ui/webui/ash/dlp_internals/dlp_internals_ui.h"
#endif
#if BUILDFLAG(CHROME_ROOT_STORE_CERT_MANAGEMENT_UI)
#include "chrome/browser/ui/webui/certificate_manager/certificate_manager_ui.h"
#include "ui/webui/resources/cr_components/certificate_manager/certificate_manager_v2.mojom.h"
@@ -486,12 +468,14 @@
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
#include "chrome/browser/ui/webui/signin/batch_upload/batch_upload.mojom.h"
#include "chrome/browser/ui/webui/signin/batch_upload_ui.h"
#include "chrome/browser/ui/webui/signin/signout_confirmation/signout_confirmation.mojom.h"
#include "chrome/browser/ui/webui/signin/signout_confirmation/signout_confirmation_ui.h"
#include "components/signin/public/base/signin_switches.h"
#endif // BUILDFLAG(ENABLE_DICE_SUPPORT)
#if BUILDFLAG(ENABLE_GLIC)
#include "chrome/browser/glic/glic_enabling.h"
#include "chrome/browser/ui/webui/glic/glic_ui.h"
#include "chrome/browser/glic/glic_ui.h"
#endif
namespace chrome::internal {
@@ -621,33 +605,6 @@ void ForwardToJavaFrame(content::RenderFrameHost* render_frame_host,
}
#endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
void BindMimeHandlerService(
content::RenderFrameHost* frame_host,
mojo::PendingReceiver<extensions::mime_handler::MimeHandlerService>
receiver) {
auto* guest_view =
extensions::MimeHandlerViewGuest::FromRenderFrameHost(frame_host);
if (!guest_view) {
return;
}
extensions::MimeHandlerServiceImpl::Create(guest_view->GetStreamWeakPtr(),
std::move(receiver));
}
void BindBeforeUnloadControl(
content::RenderFrameHost* frame_host,
mojo::PendingReceiver<extensions::mime_handler::BeforeUnloadControl>
receiver) {
auto* guest_view =
extensions::MimeHandlerViewGuest::FromRenderFrameHost(frame_host);
if (!guest_view) {
return;
}
guest_view->FuseBeforeUnloadControl(std::move(receiver));
}
#endif
void BindNetworkHintsHandler(
content::RenderFrameHost* frame_host,
mojo::PendingReceiver<network_hints::mojom::NetworkHintsHandler> receiver) {
@@ -667,7 +624,7 @@ void BindSpeechRecognitionContextHandler(
frame_host->GetProcess()->GetBrowserContext());
#if BUILDFLAG(ENABLE_BROWSER_SPEECH_SERVICE)
auto* factory = SpeechRecognitionServiceFactory::GetForProfile(profile);
#elif BUILDFLAG(IS_CHROMEOS_ASH)
#elif BUILDFLAG(IS_CHROMEOS)
auto* factory = CrosSpeechRecognitionServiceFactory::GetForProfile(profile);
#else
#error "No speech recognition service factory on this platform."
@@ -845,7 +802,7 @@ void PopulateChromeFrameBinders(
}
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS)
map->Add<payments::mojom::DigitalGoodsFactory>(base::BindRepeating(
&apps::DigitalGoodsFactoryImpl::BindDigitalGoodsFactory));
#endif
@@ -857,13 +814,6 @@ void PopulateChromeFrameBinders(
}
#endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
map->Add<extensions::mime_handler::MimeHandlerService>(
base::BindRepeating(&BindMimeHandlerService));
map->Add<extensions::mime_handler::BeforeUnloadControl>(
base::BindRepeating(&BindBeforeUnloadControl));
#endif
map->Add<network_hints::mojom::NetworkHintsHandler>(
base::BindRepeating(&BindNetworkHintsHandler));
map->Add<media::mojom::OnDeviceSpeechRecognition>(
@@ -896,10 +846,8 @@ void PopulateChromeFrameBinders(
map->Add<screen_ai::mojom::ScreenAIAnnotator>(
base::BindRepeating(&BindScreenAIAnnotator));
if (features::IsReadAnythingWithScreen2xEnabled()) {
map->Add<screen_ai::mojom::Screen2xMainContentExtractor>(
base::BindRepeating(&BindScreen2xMainContentExtractor));
}
map->Add<screen_ai::mojom::Screen2xMainContentExtractor>(
base::BindRepeating(&BindScreen2xMainContentExtractor));
#endif
#if BUILDFLAG(IS_WIN)
@@ -959,7 +907,7 @@ void PopulateChromeWebUIFrameBinders(
commerce::mojom::CommerceInternalsHandlerFactory,
commerce::CommerceInternalsUI>(map);
if (base::FeatureList::IsEnabled(features::kInternalOnlyUisPref)) {
if (base::FeatureList::IsEnabled(chrome_urls::kInternalOnlyUisPref)) {
RegisterWebUIControllerInterfaceBinder<
chrome_urls::mojom::PageHandlerFactory, chrome_urls::ChromeUrlsUI>(map);
}
@@ -969,15 +917,17 @@ void PopulateChromeWebUIFrameBinders(
DataSharingInternalsUI>(map);
#if BUILDFLAG(ENABLE_GLIC)
if (GlicEnabling::IsEnabledForProfile(Profile::FromBrowserContext(
if (GlicEnabling::IsProfileEligible(Profile::FromBrowserContext(
render_frame_host->GetProcess()->GetBrowserContext()))) {
// Register the binder for all eligible profiles but the WebUI page will
// check whether Glic is policy-enabled and restrict access if needed.
RegisterWebUIControllerInterfaceBinder<glic::mojom::PageHandlerFactory,
glic::GlicUI>(map);
}
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_CHROMEOS_ASH)
BUILDFLAG(IS_CHROMEOS)
RegisterWebUIControllerInterfaceBinder<
connectors_internals::mojom::PageHandler,
enterprise_connectors::ConnectorsInternalsUI>(map);
@@ -1022,7 +972,7 @@ void PopulateChromeWebUIFrameBinders(
#if BUILDFLAG(ENABLE_WEBUI_TAB_STRIP)
TabStripUI,
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS)
ash::OobeUI, ash::personalization_app::PersonalizationAppUI,
ash::vc_background_ui::VcBackgroundUI, ash::settings::OSSettingsUI,
ash::DiagnosticsDialogUI, ash::FirmwareUpdateAppUI, ash::ScanningUI,
@@ -1101,10 +1051,10 @@ void PopulateChromeWebUIFrameBinders(
RegisterWebUIControllerInterfaceBinder<
theme_color_picker::mojom::ThemeColorPickerHandlerFactory,
CustomizeChromeUI
#if !BUILDFLAG(IS_CHROMEOS_ASH)
#if !BUILDFLAG(IS_CHROMEOS)
,
ProfileCustomizationUI, settings::SettingsUI
#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
#endif // !BUILDFLAG(IS_CHROMEOS)
>(map);
#if BUILDFLAG(CHROME_ROOT_STORE_CERT_MANAGEMENT_UI)
@@ -1118,10 +1068,10 @@ void PopulateChromeWebUIFrameBinders(
settings::SettingsUI, ReadingListUI, NewTabPageUI, CustomizeChromeUI,
PasswordManagerUI, HistoryUI, lens::LensOverlayUntrustedUI,
lens::LensSidePanelUntrustedUI
#if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_ANDROID)
#if !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID)
,
ProfilePickerUI
#endif //! BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_ANDROID)
#endif //! BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID)
>(map);
#if !defined(OFFICIAL_BUILD)
@@ -1146,23 +1096,30 @@ void PopulateChromeWebUIFrameBinders(
ntp::calendar::mojom::GoogleCalendarPageHandler, NewTabPageUI>(map);
}
if (base::FeatureList::IsEnabled(ntp_features::kNtpOutlookCalendarModule)) {
if (IsOutlookCalendarModuleEnabledForProfile(Profile::FromBrowserContext(
render_frame_host->GetBrowserContext()))) {
RegisterWebUIControllerInterfaceBinder<
ntp::calendar::mojom::OutlookCalendarPageHandler, NewTabPageUI>(map);
}
if (base::FeatureList::IsEnabled(
ntp_features::kNtpMicrosoftAuthenticationModule)) {
if (IsMicrosoftModuleEnabledForProfile(Profile::FromBrowserContext(
render_frame_host->GetBrowserContext()))) {
RegisterWebUIControllerInterfaceBinder<
ntp::authentication::mojom::MicrosoftAuthPageHandler, NewTabPageUI>(
map);
}
#if BUILDFLAG(IS_CHROMEOS_ASH)
if (IsMicrosoftFilesModuleEnabledForProfile(Profile::FromBrowserContext(
render_frame_host->GetBrowserContext()))) {
RegisterWebUIControllerInterfaceBinder<
file_suggestion::mojom::MicrosoftFilesPageHandler, NewTabPageUI>(map);
}
#if BUILDFLAG(IS_CHROMEOS)
RegisterWebUIControllerInterfaceBinder<
ash::mojom::HidPreservingBluetoothStateController,
ash::settings::OSSettingsUI>(map);
#endif // defined(IS_CHROMEOS_ASH)
#endif // defined(IS_CHROMEOS)
RegisterWebUIControllerInterfaceBinder<
reading_list::mojom::PageHandlerFactory, ReadingListUI>(map);
@@ -1235,7 +1192,7 @@ void PopulateChromeWebUIFrameBinders(
TabStripUI>(map);
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS)
RegisterWebUIControllerInterfaceBinder<
ash::file_manager::mojom::PageHandlerFactory,
ash::file_manager::FileManagerUI>(map);
@@ -1606,7 +1563,7 @@ void PopulateChromeWebUIFrameBinders(
RegisterWebUIControllerInterfaceBinder<ash::growth::mojom::PageHandler,
ash::GrowthInternalsUI>(map);
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_CHROMEOS)
@@ -1630,7 +1587,7 @@ void PopulateChromeWebUIFrameBinders(
ResetPasswordUI>(map);
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS)
// Because Nearby Share is only currently supported for the primary profile,
// we should only register binders in that scenario. However, we don't want to
// plumb the profile through to this function, so we 1) ensure that
@@ -1649,7 +1606,7 @@ void PopulateChromeWebUIFrameBinders(
map);
RegisterWebUIControllerInterfaceBinder<nearby_share::mojom::ReceiveManager,
ash::settings::OSSettingsUI>(map);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS)
#if !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_ANDROID)
RegisterWebUIControllerInterfaceBinder<::app_home::mojom::PageHandlerFactory,
@@ -1698,27 +1655,27 @@ void PopulateChromeWebUIFrameBinders(
RegisterWebUIControllerInterfaceBinder<
batch_upload::mojom::PageHandlerFactory, BatchUploadUI>(map);
}
RegisterWebUIControllerInterfaceBinder<
signout_confirmation::mojom::PageHandlerFactory, SignoutConfirmationUI>(
map);
#endif // BUILDFLAG(ENABLE_DICE_SUPPORT)
#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS)
if (ash::features::IsFocusModeEnabled()) {
RegisterWebUIControllerInterfaceBinder<
ash::focus_mode::mojom::TrackProvider, ash::FocusModeUI>(map);
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
RegisterWebUIControllerInterfaceBinder<
ash::sanitize_ui::mojom::SettingsResetter, ash::SanitizeDialogUI>(map);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
if (ash::features::IsGraduationEnabled()) {
RegisterWebUIControllerInterfaceBinder<
ash::graduation_ui::mojom::GraduationUiHandler,
ash::graduation::GraduationUI>(map);
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS)
}
void PopulateChromeWebUIFrameInterfaceBrokers(
@@ -1727,23 +1684,21 @@ void PopulateChromeWebUIFrameInterfaceBrokers(
// --- Section 1: chrome:// WebUIs:
#if BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OFFICIAL_BUILD)
#if BUILDFLAG(IS_CHROMEOS) && !defined(OFFICIAL_BUILD)
registry.ForWebUI<ash::SampleSystemWebAppUI>()
.Add<ash::mojom::sample_swa::PageHandlerFactory>()
.Add<color_change_listener::mojom::PageHandler>();
registry.ForWebUI<ash::StatusAreaInternalsUI>()
.Add<ash::mojom::status_area_internals::PageHandler>();
#endif // BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OFFICIAL_BUILD)
#endif // BUILDFLAG(IS_CHROMEOS) && !defined(OFFICIAL_BUILD)
#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS)
registry.ForWebUI<ash::RecorderAppUI>()
.Add<ash::recorder_app::mojom::PageHandler>()
.Add<color_change_listener::mojom::PageHandler>()
.Add<crosapi::mojom::StructuredMetricsService>();
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
registry.ForWebUI<ash::CameraAppUI>()
.Add<color_change_listener::mojom::PageHandler>()
.Add<cros::mojom::CameraAppDeviceProvider>()
@@ -1762,10 +1717,10 @@ void PopulateChromeWebUIFrameInterfaceBrokers(
registry.ForWebUI<FeedbackUI>()
.Add<color_change_listener::mojom::PageHandler>();
registry.ForWebUI<ash::MallUI>().Add<ash::mall::mojom::PageHandler>();
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS)
// --- Section 2: chrome-untrusted:// WebUIs:
#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS)
registry.ForWebUI<ash::boca::BocaUI>()
.Add<ash::boca::mojom::BocaPageHandlerFactory>()
.Add<color_change_listener::mojom::PageHandler>();
@@ -1800,12 +1755,12 @@ void PopulateChromeWebUIFrameInterfaceBrokers(
registry.ForWebUI<ash::ScannerFeedbackUntrustedUI>()
.Add<color_change_listener::mojom::PageHandler>()
.Add<ash::mojom::scanner_feedback_ui::PageHandler>();
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OFFICIAL_BUILD)
#if BUILDFLAG(IS_CHROMEOS) && !defined(OFFICIAL_BUILD)
registry.ForWebUI<ash::SampleSystemWebAppUntrustedUI>()
.Add<ash::mojom::sample_swa::UntrustedPageInterfacesFactory>();
#endif // BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OFFICIAL_BUILD)
#endif // BUILDFLAG(IS_CHROMEOS) && !defined(OFFICIAL_BUILD)
#if BUILDFLAG(ENABLE_COMPOSE)
registry.ForWebUI<ComposeUntrustedUI>()
@@ -1839,6 +1794,10 @@ void PopulateChromeWebUIFrameInterfaceBrokers(
.Add<color_change_listener::mojom::PageHandler>();
}
registry.ForWebUI<NtpMicrosoftAuthUntrustedUI>()
.Add<new_tab_page::mojom::
MicrosoftAuthUntrustedDocumentInterfacesFactory>();
#endif // !BUILDFLAG(IS_ANDROID)
}
@@ -4,6 +4,7 @@
#include "chrome/browser/chrome_content_browser_client.h"
#include <algorithm>
#include <iterator>
#include <map>
#include <memory>
@@ -33,7 +34,6 @@
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/path_service.h"
#include "base/ranges/algorithm.h"
#include "base/stl_util.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
@@ -56,6 +56,7 @@
#include "chrome/browser/browser_features.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browsing_data/chrome_browsing_data_model_delegate.h"
#include "chrome/browser/browsing_data/chrome_browsing_data_remover_constants.h"
#include "chrome/browser/browsing_topics/browsing_topics_service_factory.h"
#include "chrome/browser/captive_portal/captive_portal_service_factory.h"
#include "chrome/browser/child_process_host_flags.h"
@@ -70,7 +71,8 @@
#include "chrome/browser/defaults.h"
#include "chrome/browser/device_api/device_service_impl.h"
#include "chrome/browser/device_api/managed_configuration_service.h"
#include "chrome/browser/dips/chrome_dips_delegate.h"
#include "chrome/browser/dips/dips_browser_signin_detector.h"
#include "chrome/browser/dips/stateful_bounce_counter.h"
#include "chrome/browser/download/chrome_download_manager_delegate.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/enterprise/browser_management/management_service_factory.h"
@@ -170,7 +172,6 @@
#include "chrome/browser/ssl/typed_navigation_upgrade_throttle.h"
#include "chrome/browser/supervised_user/classify_url_navigation_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/tab_group_sync/tab_group_sync_utils.h"
#include "chrome/browser/task_manager/sampling/task_manager_impl.h"
#include "chrome/browser/task_manager/task_manager_interface.h"
@@ -282,9 +283,9 @@
#include "components/omnibox/common/omnibox_features.h"
#include "components/page_load_metrics/browser/metrics_navigation_throttle.h"
#include "components/page_load_metrics/browser/metrics_web_contents_observer.h"
#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/payments/content/secure_payment_confirmation_service_factory.h"
#include "components/pdf/common/pdf_util.h"
#include "components/permissions/permission_context_base.h"
#include "components/policy/content/policy_blocklist_navigation_throttle.h"
@@ -329,6 +330,8 @@
#include "components/variations/variations_switches.h"
#include "components/version_info/version_info.h"
#include "components/webapps/common/web_app_id.h"
#include "components/webui/chrome_urls/features.h"
#include "components/webui/chrome_urls/pref_names.h"
#include "content/public/browser/attribution_data_model.h"
#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/browser/browser_child_process_host.h"
@@ -343,7 +346,6 @@
#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/dips_delegate.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"
@@ -372,6 +374,7 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/url_utils.h"
#include "content/public/common/window_container_type.mojom-shared.h"
#include "device/fido/features.h"
#include "device/vr/buildflags/buildflags.h"
#include "extensions/browser/browser_frame_context_data.h"
#include "extensions/buildflags/buildflags.h"
@@ -441,6 +444,7 @@
#include "chrome/browser/chrome_browser_main_win.h"
#include "chrome/browser/lifetime/application_lifetime_desktop.h"
#include "chrome/browser/performance_manager/public/dll_pre_read_policy_win.h"
#include "chrome/browser/tracing/tracing_features.h"
#include "chrome/browser/tracing/windows_system_tracing_client_win.h"
#include "chrome/install_static/install_util.h"
#include "chrome/services/util_win/public/mojom/util_win.mojom.h"
@@ -453,7 +457,7 @@
#include "chrome/browser/mac/auth_session_request.h"
#include "chrome/browser/mac/chrome_browser_main_extra_parts_mac.h"
#include "components/soda/constants.h"
#include "sandbox/mac/sandbox_compiler.h"
#include "sandbox/mac/sandbox_serializer.h"
#include "sandbox/policy/mac/params.h"
#include "sandbox/policy/mac/sandbox_mac.h"
#elif BUILDFLAG(IS_CHROMEOS)
@@ -546,6 +550,7 @@
#if !BUILDFLAG(IS_ANDROID)
#include "chrome/browser/digital_credentials/digital_identity_provider_desktop.h"
#include "chrome/browser/preloading/preview/preview_navigation_throttle.h"
#include "chrome/browser/ui/webui/ntp_microsoft_auth/ntp_microsoft_auth_response_capture_navigation_throttle.h"
#include "chrome/browser/web_applications/isolated_web_apps/chrome_content_browser_client_isolated_web_apps_part.h"
#include "chrome/browser/web_applications/locks/app_lock.h"
#include "chrome/browser/web_applications/proto/web_app_install_state.pb.h"
@@ -559,17 +564,16 @@
#include "chrome/browser/apps/app_service/app_install/app_install_navigation_throttle.h"
#include "chrome/browser/apps/intent_helper/chromeos_disabled_apps_throttle.h"
#include "chrome/browser/apps/link_capturing/chromeos_link_capturing_delegate.h"
#include "chrome/browser/apps/link_capturing/chromeos_reimpl_navigation_capturing_throttle.h"
#include "chrome/browser/chromeos/enterprise/incognito_navigation_throttle.h"
#include "chrome/browser/chromeos/policy/dlp/dlp_scoped_file_access_delegate.h"
#include "chrome/browser/chromeos/quickoffice/quickoffice_prefs.h"
#include "chrome/browser/chromeos/tablet_mode/chrome_content_browser_client_tablet_mode_part.h"
#include "chrome/browser/file_system_access/cloud_identifier/cloud_identifier_util_cros.h"
#include "chrome/browser/policy/networking/policy_cert_service.h"
#include "chrome/browser/policy/networking/policy_cert_service_factory.h"
#include "chrome/browser/policy/system_features_disable_list_policy_handler.h"
#include "chrome/browser/smart_card/chromeos_smart_card_delegate.h"
#include "chrome/browser/web_applications/web_app_tab_helper.h"
#include "chrome/common/chromeos/extensions/chromeos_system_extension_info.h"
#include "chromeos/ash/components/quickoffice/quickoffice_prefs.h"
#include "chromeos/components/kiosk/kiosk_utils.h"
#include "chromeos/constants/chromeos_features.h"
#include "content/public/browser/chromeos/multi_capture_service.h"
@@ -613,7 +617,7 @@
#include "components/lens/lens_features.h"
#include "components/password_manager/content/common/web_ui_constants.h"
#include "components/password_manager/core/common/password_manager_features.h"
#include "third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom.h"
#include "services/network/public/mojom/permissions_policy/permissions_policy_feature.mojom.h"
#endif // !BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
@@ -716,6 +720,7 @@
#include "components/pdf/browser/pdf_navigation_throttle.h"
#include "components/pdf/browser/pdf_url_loader_request_interceptor.h"
#include "components/pdf/common/constants.h"
#include "pdf/pdf_features.h"
#endif // BUILDFLAG(ENABLE_PDF)
@@ -767,11 +772,6 @@
#include "components/enterprise/common/files_scan_data.h"
#endif
// This should be after all other #includes.
#if defined(_WINDOWS_) // Detect whether windows.h was included.
#include "base/win/windows_h_disallowed.h"
#endif // defined(_WINDOWS_)
#if !BUILDFLAG(IS_ANDROID)
#include "chrome/browser/screen_ai/screen_ai_install_state.h"
#endif
@@ -805,6 +805,8 @@
#include "chrome/browser/on_device_translation/pref_names.h"
#endif // BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION)
#include "base/win/windows_h_disallowed.h"
using blink::mojom::EffectiveConnectionType;
using blink::web_pref::WebPreferences;
using content::BrowserThread;
@@ -842,18 +844,6 @@ BASE_FEATURE(kSkipPagehideInCommitForDSENavigation,
"SkipPagehideInCommitForDSENavigation",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kDisableJavascriptOptimizerByDefault,
"DisableJavascriptOptimizerByDefault",
base::FEATURE_DISABLED_BY_DEFAULT);
#if BUILDFLAG(IS_WIN)
// A Feature to selectively enable connecting to the Windows system tracing
// service when the tracing service is started.
BASE_FEATURE(kWindowsSystemTracing,
"WindowsSystemTracing",
base::FEATURE_DISABLED_BY_DEFAULT);
#endif // BUILDFLAG(IS_WIN)
// A small ChromeBrowserMainExtraParts that invokes a callback when threads are
// ready. Used to initialize ChromeContentBrowserClient data that needs the UI
// thread.
@@ -1024,7 +1014,7 @@ blink::mojom::AutoplayPolicy GetAutoplayPolicyForWebContents(
? blink::mojom::AutoplayPolicy::kDocumentUserActivationRequired
: blink::mojom::AutoplayPolicy::kNoUserGestureRequired;
} else if (web_contents->GetPrimaryMainFrame()->IsFeatureEnabled(
blink::mojom::PermissionsPolicyFeature::kAutoplay) &&
network::mojom::PermissionsPolicyFeature::kAutoplay) &&
IsAutoplayAllowedByPolicy(web_contents->GetOuterWebContents(),
prefs)) {
// If the domain policy allows autoplay and has delegated that to an iframe,
@@ -1616,6 +1606,7 @@ void ChromeContentBrowserClient::RegisterProfilePrefs(
registry->RegisterBooleanPref(
prefs::kAccessControlAllowMethodsInCORSPreflightSpecConformant, true);
registry->RegisterBooleanPref(prefs::kDataUrlInSvgUseEnabled, false);
registry->RegisterBooleanPref(prefs::kPartitionedBlobUrlUsage, true);
registry->RegisterBooleanPref(policy::policy_prefs::kMutationEventsEnabled,
false);
@@ -1649,6 +1640,8 @@ void ChromeContentBrowserClient::RegisterProfilePrefs(
registry->RegisterBooleanPref(prefs::kWebAudioOutputBufferingEnabled, false);
registry->RegisterBooleanPref(prefs::kSharedWorkerBlobURLFixEnabled, true);
registry->RegisterBooleanPref(
prefs::kServiceWorkerToControlSrcdocIframeEnabled, true);
}
// static
@@ -1776,7 +1769,7 @@ ChromeContentBrowserClient::CreateBrowserMainParts(bool is_integration_test) {
add_profiles_extra_parts = false;
#endif
if (add_profiles_extra_parts)
chrome::AddProfilesExtraParts(main_parts.get());
AddProfilesExtraParts(main_parts.get());
// Construct additional browser parts. Stages are called in the order in
// which they are added.
@@ -2241,6 +2234,13 @@ void ChromeContentBrowserClient::GetAdditionalWebUISchemes(
additional_schemes->emplace_back(content::kChromeDevToolsScheme);
}
bool ChromeContentBrowserClient::IsInternalScheme(const GURL& url) {
if (!url.is_valid()) {
return false;
}
return url.SchemeIs(chrome::kChromeNativeScheme);
}
void ChromeContentBrowserClient::GetAdditionalViewSourceSchemes(
std::vector<std::string>* additional_schemes) {
GetAdditionalWebUISchemes(additional_schemes);
@@ -2436,15 +2436,9 @@ ChromeContentBrowserClient::GetPermissionsPolicyForIsolatedWebApp(
Profile::FromBrowserContext(web_contents->GetBrowserContext());
auto& registrar =
web_app::WebAppProvider::GetForWebApps(profile)->registrar_unsafe();
// TODO(crbug.com/379916273): Evaluate call sites of FindBestAppWithUrlInScope
// for correctness.
std::vector<webapps::AppId> app_ids_for_origin =
registrar.FindAllAppsNestedInUrl(
app_origin.GetURL(),
{
web_app::proto::InstallState::INSTALLED_WITH_OS_INTEGRATION,
web_app::proto::InstallState::INSTALLED_WITHOUT_OS_INTEGRATION,
});
app_origin.GetURL(), web_app::WebAppFilter::InstalledInChrome());
if (app_ids_for_origin.empty()) {
return blink::ParsedPermissionsPolicy();
}
@@ -2560,6 +2554,11 @@ bool ChromeContentBrowserClient::ShouldDisableSiteIsolation(
ShouldDisableSiteIsolationDueToMemoryThreshold(site_isolation_mode);
}
bool ChromeContentBrowserClient::ShouldDisableOriginIsolation() {
return site_isolation::SiteIsolationPolicy::
ShouldDisableOriginIsolationDueToMemoryThreshold();
}
std::vector<std::string>
ChromeContentBrowserClient::GetAdditionalSiteIsolationModes() {
std::vector<std::string> modes;
@@ -2583,8 +2582,7 @@ bool ChromeContentBrowserClient::ShouldUrlUseApplicationIsolationLevel(
const GURL& url) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
if (!content::IsolatedWebAppsPolicy::AreIsolatedWebAppsEnabled(
browser_context)) {
if (!content::AreIsolatedWebAppsEnabled(browser_context)) {
return false;
}
@@ -2788,6 +2786,11 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
command_line->AppendSwitch(blink::switches::kDataUrlInSvgUseEnabled);
}
if (!prefs->GetBoolean(prefs::kPartitionedBlobUrlUsage)) {
command_line->AppendSwitch(
blink::switches::kDisableBlobUrlPartitioning);
}
if (prefs->GetBoolean(policy::policy_prefs::kMutationEventsEnabled)) {
command_line->AppendSwitch(blink::switches::kMutationEventsEnabled);
}
@@ -2899,11 +2902,16 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
#endif // BUILDFLAG(IS_ANDROID)
#if !BUILDFLAG(IS_ANDROID)
// Make the WebAuthenticationRemoteProxiedRequestsAllowed policy enable
// the experimental WebAuthenticationRemoteDesktopSupport Blink runtime
// Make the {WebAuthenticationRemoteProxiedRequestsAllowed or
// WebAuthenticationRemoteDesktopAllowedOrigins} policy enable the
// experimental WebAuthenticationRemoteDesktopSupport Blink runtime
// feature.
if (prefs->GetBoolean(
webauthn::pref_names::kRemoteProxiedRequestsAllowed)) {
webauthn::pref_names::kRemoteProxiedRequestsAllowed) ||
(base::FeatureList::IsEnabled(
device::kWebAuthnRemoteDesktopAllowedOriginsPolicy) &&
!prefs->GetList(webauthn::pref_names::kRemoteDesktopAllowedOrigins)
.empty())) {
command_line->AppendSwitch(switches::kWebAuthRemoteDesktopSupport);
}
#endif
@@ -3222,6 +3230,14 @@ bool ChromeContentBrowserClient::AllowCompressionDictionaryTransport(
prefs::kCompressionDictionaryTransportEnabled);
}
bool ChromeContentBrowserClient::AllowServiceWorkerToControlSrcdocIframe(
content::BrowserContext* browser_context) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
Profile* profile = Profile::FromBrowserContext(browser_context);
return profile->GetPrefs()->GetBoolean(
prefs::kServiceWorkerToControlSrcdocIframeEnabled);
}
bool ChromeContentBrowserClient::AllowSharedWorkerBlobURLFix(
content::BrowserContext* browser_context) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -3708,19 +3724,6 @@ void ChromeContentBrowserClient::GrantCookieAccessDueToHeuristic(
/*use_schemeless_patterns=*/ignore_schemes);
}
#if BUILDFLAG(IS_CHROMEOS)
void ChromeContentBrowserClient::OnTrustAnchorUsed(
content::BrowserContext* browser_context) {
policy::PolicyCertService* service =
policy::PolicyCertServiceFactory::GetForProfile(
Profile::FromBrowserContext(browser_context));
if (!service) {
NOTREACHED();
}
service->SetUsedPolicyCertificates();
}
#endif
bool ChromeContentBrowserClient::CanSendSCTAuditingReport(
content::BrowserContext* browser_context) {
return SCTReportingService::CanSendSCTAuditingReport();
@@ -3945,15 +3948,14 @@ bool UpdatePreferredColorScheme(WebPreferences* web_prefs,
ToBlinkPreferredColorScheme(native_theme->GetPreferredColorScheme());
bool using_different_colored_frame = false;
if (Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext())) {
if (ThemeService* theme_service =
ThemeServiceFactory::GetForProfile(profile)) {
using_different_colored_frame =
!theme_service->UsingDefaultTheme() ||
theme_service->GetUserColor().has_value() ||
theme_service->UsingDeviceTheme();
}
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
CHECK(profile);
if (ThemeService* theme_service =
ThemeServiceFactory::GetForProfile(profile)) {
using_different_colored_frame = !theme_service->UsingDefaultTheme() ||
theme_service->GetUserColor().has_value() ||
theme_service->UsingDeviceTheme();
}
// Update based on the ColorProvider associated with `web_contents`. Depends
@@ -3966,25 +3968,27 @@ bool UpdatePreferredColorScheme(WebPreferences* web_prefs,
: blink::mojom::PreferredColorScheme::kDark;
#endif // BUILDFLAG(IS_ANDROID)
// Reauth WebUI doesn't support dark mode yet because it shares the dialog
// with GAIA web contents that is not correctly themed.
const bool force_light =
url.SchemeIs(content::kChromeUIScheme) &&
url.host_piece() == chrome::kChromeUISigninReauthHost;
if (force_light) {
web_prefs->preferred_color_scheme =
blink::mojom::PreferredColorScheme::kLight;
#if !BUILDFLAG(IS_ANDROID)
} else if (content::HasWebUIScheme(url)) {
// TODO(crbug.com/359577226): merge the branches for WebUI and non-WebUI
// contents after kContentUsesBrowserThemeColorMode is launched.
if (content::HasWebUIScheme(url)) {
// If color scheme is not forced, WebUI should track the color mode of the
// ColorProvider associated with `web_contents`.
web_prefs->preferred_color_scheme =
web_contents->GetColorMode() == ui::ColorProviderKey::ColorMode::kLight
? blink::mojom::PreferredColorScheme::kLight
: blink::mojom::PreferredColorScheme::kDark;
#endif // !BUILDFLAG(IS_ANDROID)
} else if (base::FeatureList::IsEnabled(
features::kContentUsesBrowserThemeColorMode) &&
!profile->IsIncognitoProfile()) {
// Track the browser theme's color mode in contents.
// Incognito contents are not affected by the browser theme.
web_prefs->preferred_color_scheme =
web_contents->GetColorMode() == ui::ColorProviderKey::ColorMode::kLight
? blink::mojom::PreferredColorScheme::kLight
: blink::mojom::PreferredColorScheme::kDark;
}
#endif // !BUILDFLAG(IS_ANDROID)
return old_preferred_color_scheme != web_prefs->preferred_color_scheme;
}
@@ -4308,8 +4312,9 @@ content::TtsPlatform* ChromeContentBrowserClient::GetTtsPlatform() {
#endif
}
void ChromeContentBrowserClient::OverrideWebkitPrefs(
void ChromeContentBrowserClient::OverrideWebPreferences(
WebContents* web_contents,
content::SiteInstance& main_frame_site,
WebPreferences* web_prefs) {
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
@@ -4574,10 +4579,8 @@ void ChromeContentBrowserClient::OverrideWebkitPrefs(
UpdateForcedColorsForWebContent(web_prefs, web_contents, GetWebTheme());
UpdatePreferredColorScheme(
web_prefs,
web_contents->GetPrimaryMainFrame()->GetSiteInstance()->GetSiteURL(),
web_contents, GetWebTheme());
UpdatePreferredColorScheme(web_prefs, main_frame_site.GetSiteURL(),
web_contents, GetWebTheme());
web_prefs->translate_service_available = TranslateService::IsAvailable(prefs);
@@ -4613,7 +4616,7 @@ void ChromeContentBrowserClient::OverrideWebkitPrefs(
#endif
for (auto& parts : extra_parts_) {
parts->OverrideWebkitPrefs(web_contents, web_prefs);
parts->OverrideWebPreferences(web_contents, main_frame_site, web_prefs);
}
web_prefs->prefers_default_scrollbar_styles =
@@ -4622,12 +4625,14 @@ void ChromeContentBrowserClient::OverrideWebkitPrefs(
bool ChromeContentBrowserClientParts::OverrideWebPreferencesAfterNavigation(
WebContents* web_contents,
content::SiteInstance& main_frame_site,
WebPreferences* web_prefs) {
return false;
}
bool ChromeContentBrowserClient::OverrideWebPreferencesAfterNavigation(
WebContents* web_contents,
content::SiteInstance& main_frame_site,
WebPreferences* web_prefs) {
bool prefs_changed = false;
@@ -4656,8 +4661,8 @@ bool ChromeContentBrowserClient::OverrideWebPreferencesAfterNavigation(
#endif // !BUILDFLAG(IS_ANDROID)
for (auto& parts : extra_parts_) {
prefs_changed |=
parts->OverrideWebPreferencesAfterNavigation(web_contents, web_prefs);
prefs_changed |= parts->OverrideWebPreferencesAfterNavigation(
web_contents, main_frame_site, web_prefs);
}
prefs_changed |=
@@ -5308,6 +5313,19 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
throttles.push_back(std::move(url_to_apps_throttle));
}
#if BUILDFLAG(IS_CHROMEOS)
// TODO(crbug.com/366547977): This currently does nothing and allows all
// navigations to proceed if v2 is enabled on ChromeOS. Implement.
std::unique_ptr<content::NavigationThrottle>
chromeos_reimpl_navigation_throttle =
apps::ChromeOsReimplNavigationCapturingThrottle::MaybeCreate(handle);
if (chromeos_reimpl_navigation_throttle) {
// Verify the v1 throttle has not been created.
CHECK_EQ(url_to_apps_throttle, nullptr);
throttles.push_back(std::move(chromeos_reimpl_navigation_throttle));
}
#endif // BUILDFLAG(IS_CHROMEOS)
std::unique_ptr<content::NavigationThrottle>
navigation_capturing_redirection_throttle =
web_app::NavigationCapturingRedirectionThrottle::MaybeCreate(handle);
@@ -5342,16 +5360,9 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
SupervisedUserGoogleAuthNavigationThrottle::MaybeCreate(handle),
&throttles);
if (base::FeatureList::IsEnabled(
supervised_user::kClassifyUrlOnProcessResponseEvent)) {
MaybeAddThrottle(
supervised_user::MaybeCreateClassifyUrlNavigationThrottleFor(handle),
&throttles);
} else {
MaybeAddThrottle(
SupervisedUserNavigationThrottle::MaybeCreateThrottleFor(handle),
&throttles);
}
if (auto* throttle_manager =
subresource_filter::ContentSubresourceFilterThrottleManager::
@@ -5360,7 +5371,8 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
}
if (fingerprinting_protection_filter::features::
IsFingerprintingProtectionFeatureEnabled()) {
IsFingerprintingProtectionEnabledForIncognitoState(
profile ? profile->IsIncognitoProfile() : false)) {
if (auto* throttle_manager = fingerprinting_protection_filter::
ThrottleManager::FromNavigationHandle(*handle)) {
throttle_manager->MaybeAppendNavigationThrottles(handle, &throttles);
@@ -5527,6 +5539,11 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
}
}
}
MaybeAddThrottle(
NtpMicrosoftAuthResponseCaptureNavigationThrottle::MaybeCreateThrottleFor(
handle),
&throttles);
#endif
#if BUILDFLAG(ENABLE_OFFLINE_PAGES)
@@ -5828,10 +5845,10 @@ ChromeContentBrowserClient::MaybeCreateSafeBrowsingURLLoaderThrottle(
// Don't run checks if it matches the enterprise allowlist.
return nullptr;
}
bool has_valid_dm_token = false;
auto* connectors_service =
enterprise_connectors::ConnectorsServiceFactory::GetForBrowserContext(
browser_context);
bool has_valid_dm_token = false;
if (connectors_service) {
base::expected<std::string, enterprise_connectors::ConnectorsServiceBase::
NoDMTokenForRealTimeUrlCheckReason>
@@ -5885,13 +5902,17 @@ ChromeContentBrowserClient::MaybeCreateSafeBrowsingURLLoaderThrottle(
std::optional<safe_browsing::internal::ReferringAppInfo> referring_app_info =
std::nullopt;
#if BUILDFLAG(IS_ANDROID)
if (base::FeatureList::IsEnabled(
if (safe_browsing::IsEnhancedProtectionEnabled(*profile->GetPrefs()) &&
base::FeatureList::IsEnabled(
safe_browsing::kAddReferringAppInfoToProtegoPings)) {
bool get_webapk_info = base::FeatureList::IsEnabled(
safe_browsing::kAddReferringWebApkToProtegoPings);
WebContents* web_contents = wc_getter.Run();
if (web_contents) {
referring_app_info =
std::make_optional<safe_browsing::internal::ReferringAppInfo>(
safe_browsing::GetReferringAppInfo(web_contents));
safe_browsing::GetReferringAppInfo(web_contents,
get_webapk_info));
}
}
#endif
@@ -6160,8 +6181,7 @@ ChromeContentBrowserClient::CreateNonNetworkNavigationURLLoaderFactory(
#endif // BUILDFLAG(IS_CHROMEOS)
#if !BUILDFLAG(IS_ANDROID)
if (scheme == chrome::kIsolatedAppScheme) {
if (content::IsolatedWebAppsPolicy::AreIsolatedWebAppsEnabled(
browser_context) &&
if (content::AreIsolatedWebAppsEnabled(browser_context) &&
!browser_context->ShutdownStarted()) {
return web_app::IsolatedWebAppURLLoaderFactory::CreateForFrame(
browser_context, /*app_origin=*/std::nullopt, frame_tree_node_id);
@@ -6184,8 +6204,7 @@ void ChromeContentBrowserClient::
DCHECK(factories);
#if !BUILDFLAG(IS_ANDROID)
if (content::IsolatedWebAppsPolicy::AreIsolatedWebAppsEnabled(
browser_context) &&
if (content::AreIsolatedWebAppsEnabled(browser_context) &&
!browser_context->ShutdownStarted()) {
factories->emplace(chrome::kIsolatedAppScheme,
web_app::IsolatedWebAppURLLoaderFactory::Create(
@@ -6212,8 +6231,7 @@ void ChromeContentBrowserClient::
DCHECK(factories);
#if !BUILDFLAG(IS_ANDROID)
if (content::IsolatedWebAppsPolicy::AreIsolatedWebAppsEnabled(
browser_context) &&
if (content::AreIsolatedWebAppsEnabled(browser_context) &&
!browser_context->ShutdownStarted()) {
factories->emplace(chrome::kIsolatedAppScheme,
web_app::IsolatedWebAppURLLoaderFactory::Create(
@@ -6480,8 +6498,7 @@ void ChromeContentBrowserClient::
bool is_initiator_iwa =
request_initiator_origin.has_value() &&
request_initiator_origin->scheme() == chrome::kIsolatedAppScheme;
if (content::IsolatedWebAppsPolicy::AreIsolatedWebAppsEnabled(
browser_context) &&
if (content::AreIsolatedWebAppsEnabled(browser_context) &&
!browser_context->ShutdownStarted() && is_initiator_iwa) {
if (frame_host != nullptr) {
factories->emplace(
@@ -6666,7 +6683,6 @@ bool ChromeContentBrowserClient::WillInterceptWebSocket(
return false;
return (web_request_api->MayHaveProxies() ||
web_request_api->MayHaveWebsocketProxiesForExtensionTelemetry() ||
web_request_api->IsAvailableToWebViewEmbedderFrame(frame));
#else
return false;
@@ -6969,10 +6985,12 @@ ChromeContentBrowserClient::GetWebAuthenticationRequestDelegate(
}
#endif
void ChromeContentBrowserClient::CreatePaymentCredential(
void ChromeContentBrowserClient::CreateSecurePaymentConfirmationService(
content::RenderFrameHost* render_frame_host,
mojo::PendingReceiver<payments::mojom::PaymentCredential> receiver) {
payments::CreatePaymentCredential(render_frame_host, std::move(receiver));
mojo::PendingReceiver<payments::mojom::SecurePaymentConfirmationService>
receiver) {
payments::CreateSecurePaymentConfirmationService(render_frame_host,
std::move(receiver));
}
std::unique_ptr<net::ClientCertStore>
@@ -7304,10 +7322,6 @@ ChromeContentBrowserClient::GetAsyncCheckTracker(
contents->IsPrerenderedFrame(frame_tree_node_id)) {
return nullptr;
}
if (!base::FeatureList::IsEnabled(
safe_browsing::kSafeBrowsingAsyncRealTimeCheck)) {
return nullptr;
}
return safe_browsing::AsyncCheckTracker::GetOrCreateForWebContents(
contents, safe_browsing_service_->ui_manager().get(),
safe_browsing::AsyncCheckTracker::
@@ -7856,7 +7870,8 @@ bool ChromeContentBrowserClient::IsJitDisabledForSite(
bool ChromeContentBrowserClient::AreV8OptimizationsDisabledForSite(
content::BrowserContext* browser_context,
const GURL& site_url) {
// Only disable optimizations for schemes that might atually load web content.
// Only disable optimizations for schemes that might actually load web
// content.
auto* policy = ChildProcessSecurityPolicy::GetInstance();
if (!site_url.is_empty() && !policy->IsWebSafeScheme(site_url.scheme())) {
return false;
@@ -7871,20 +7886,19 @@ bool ChromeContentBrowserClient::AreV8OptimizationsDisabledForSite(
CONTENT_SETTING_BLOCK;
}
// Activate experiment only for users who haven't explicitly disabled v8
// optimization by default so that most of the users in the "experiment
// off" branch have v8 optimization enabled.
if (base::FeatureList::GetInstance()->IsEnabled(
kDisableJavascriptOptimizerByDefault)) {
return true;
}
return (map &&
map->GetContentSetting(site_url, site_url,
ContentSettingsType::JAVASCRIPT_OPTIMIZER) ==
CONTENT_SETTING_BLOCK);
}
bool ChromeContentBrowserClient::DisallowV8FeatureFlagOverridesForSite(
const GURL& site_url) {
// Disable V8 feature flag overrides specifically for top-chrome WebUI URLs.
return base::FeatureList::IsEnabled(features::kWebUIBundledCodeCache) &&
IsTopChromeWebUIURL(site_url);
}
ukm::UkmService* ChromeContentBrowserClient::GetUkmService() {
return g_browser_process->GetMetricsServicesManager()->GetUkmService();
}
@@ -7947,20 +7961,21 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() {
#if BUILDFLAG(IS_MAC)
bool ChromeContentBrowserClient::SetupEmbedderSandboxParameters(
sandbox::mojom::Sandbox sandbox_type,
sandbox::SandboxCompiler* compiler) {
sandbox::SandboxSerializer* serializer) {
if (sandbox_type == sandbox::mojom::Sandbox::kSpeechRecognition) {
base::FilePath soda_component_path = speech::GetSodaDirectory();
CHECK(!soda_component_path.empty());
CHECK(compiler->SetParameter(sandbox::policy::kParamSodaComponentPath,
soda_component_path.value()));
CHECK(serializer->SetParameter(sandbox::policy::kParamSodaComponentPath,
soda_component_path.value()));
base::FilePath soda_language_pack_path =
speech::GetSodaLanguagePacksDirectory();
CHECK(!soda_language_pack_path.empty());
CHECK(compiler->SetParameter(sandbox::policy::kParamSodaLanguagePackPath,
soda_language_pack_path.value()));
CHECK(serializer->SetParameter(sandbox::policy::kParamSodaLanguagePackPath,
soda_language_pack_path.value()));
return true;
} else if (sandbox_type == sandbox::mojom::Sandbox::kScreenAI) {
}
if (sandbox_type == sandbox::mojom::Sandbox::kScreenAI) {
// ScreenAI service needs read access to ScreenAI component binary path to
// load it.
base::FilePath screen_ai_binary_path =
@@ -7970,9 +7985,11 @@ bool ChromeContentBrowserClient::SetupEmbedderSandboxParameters(
VLOG(1) << "Screen AI component not found.";
return false;
}
return compiler->SetParameter(sandbox::policy::kParamScreenAiComponentPath,
screen_ai_binary_path.value());
} else if (sandbox_type == sandbox::mojom::Sandbox::kOnDeviceTranslation) {
return serializer->SetParameter(
sandbox::policy::kParamScreenAiComponentPath,
screen_ai_binary_path.value());
}
if (sandbox_type == sandbox::mojom::Sandbox::kOnDeviceTranslation) {
auto translatekit_binary_path =
on_device_translation::ComponentManager::GetInstance()
.GetTranslateKitComponentPath();
@@ -7980,7 +7997,7 @@ bool ChromeContentBrowserClient::SetupEmbedderSandboxParameters(
VLOG(1) << "TranslationKit component not found.";
return false;
}
return compiler->SetParameter(
return serializer->SetParameter(
sandbox::policy::kParamTranslatekitComponentPath,
translatekit_binary_path.value());
}
@@ -8165,8 +8182,7 @@ ChromeContentBrowserClient::GetAlternativeErrorPageOverrideInfo(
content::BrowserContext* browser_context,
int32_t error_code) {
#if !BUILDFLAG(IS_ANDROID)
if (content::IsolatedWebAppsPolicy::AreIsolatedWebAppsEnabled(
browser_context) &&
if (content::AreIsolatedWebAppsEnabled(browser_context) &&
url.SchemeIs(chrome::kIsolatedAppScheme)) {
content::mojom::AlternativeErrorPageOverrideInfoPtr
alternative_error_page_override_info =
@@ -8450,6 +8466,20 @@ bool ChromeContentBrowserClient::
return true;
}
bool ChromeContentBrowserClient::IsBlobUrlPartitioningEnabled(
content::BrowserContext* browser_context) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
const PrefService::Preference* pref =
Profile::FromBrowserContext(browser_context)
->GetPrefs()
->FindPreference(prefs::kPartitionedBlobUrlUsage);
if (pref && pref->IsManaged() && pref->GetValue()->is_bool()) {
return pref->GetValue()->GetBool();
}
return true;
}
void ChromeContentBrowserClient::SetIsMinimalMode(bool minimal) {
is_minimal_mode_ = minimal;
}
@@ -8464,13 +8494,13 @@ bool ChromeContentBrowserClient::
}
#if BUILDFLAG(ENABLE_VIDEO_EFFECTS)
void ChromeContentBrowserClient::BindVideoEffectsManager(
void ChromeContentBrowserClient::BindReadonlyVideoEffectsManager(
const std::string& device_id,
content::BrowserContext* browser_context,
mojo::PendingReceiver<media::mojom::VideoEffectsManager>
video_effects_manager) {
media_effects::BindVideoEffectsManager(device_id, browser_context,
std::move(video_effects_manager));
mojo::PendingReceiver<media::mojom::ReadonlyVideoEffectsManager>
readonly_video_effects_manager) {
media_effects::BindReadonlyVideoEffectsManager(
device_id, browser_context, std::move(readonly_video_effects_manager));
}
void ChromeContentBrowserClient::BindVideoEffectsProcessor(
@@ -8549,12 +8579,6 @@ void ChromeContentBrowserClient::NotifyMultiCaptureStateChanged(
}
#endif // BUILDFLAG(IS_CHROMEOS)
std::unique_ptr<content::DipsDelegate>
ChromeContentBrowserClient::CreateDipsDelegate() {
return std::make_unique<ChromeDipsDelegate>(
base::PassKey<ChromeContentBrowserClient>());
}
bool ChromeContentBrowserClient::ShouldEnableDips(
content::BrowserContext* browser_context) {
return ShouldBrowserContextEnableDips(browser_context);
@@ -8563,12 +8587,35 @@ bool ChromeContentBrowserClient::ShouldEnableDips(
bool ShouldBrowserContextEnableDips(content::BrowserContext* browser_context) {
Profile* profile = Profile::FromBrowserContext(browser_context);
Profile* result = GetHumanProfileSelections().ApplyProfileSelection(profile);
// TODO: crbug.com/358137275 - Use CHECK() once we know it's safe.
DUMP_WILL_BE_CHECK(!result || result == profile)
CHECK(!result || result == profile)
<< "ApplyProfileSelection() returned a different profile";
return result == profile;
}
void ChromeContentBrowserClient::OnDipsServiceCreated(
content::BrowserContext* browser_context,
content::BtmService* dips_service) {
// Create BtmBrowserSigninDetector.
CHECK(BtmBrowserSigninDetector::Get(browser_context));
dips::StatefulBounceCounter::CreateFor(dips_service);
}
static_assert(content::ContentBrowserClient::kDefaultDipsRemoveMask ==
(chrome_browsing_data_remover::FILTERABLE_DATA_TYPES &
((content::BrowsingDataRemover::DATA_TYPE_CONTENT_END << 1) -
1)),
"kDefaultDipsRemoveMask must contain all the entries of "
"FILTERABLE_DATA_TYPES that are known in //content");
uint64_t ChromeContentBrowserClient::GetDipsRemoveMask() {
return chrome_browsing_data_remover::FILTERABLE_DATA_TYPES;
}
bool ChromeContentBrowserClient::ShouldDipsDeleteInteractionRecords(
uint64_t remove_mask) {
return remove_mask & chrome_browsing_data_remover::DATA_TYPE_HISTORY;
}
bool ChromeContentBrowserClient::ShouldSuppressAXLoadComplete(
RenderFrameHost* rfh) {
CHECK(rfh);
@@ -8802,16 +8849,39 @@ void ChromeContentBrowserClient::OnTracingServiceStopped() {
std::unique_ptr<content::WebUIController>
ChromeContentBrowserClient::OverrideForInternalWebUI(content::WebUI* web_ui,
const GURL& url) {
if (!base::FeatureList::IsEnabled(features::kInternalOnlyUisPref)) {
if (!base::FeatureList::IsEnabled(chrome_urls::kInternalOnlyUisPref)) {
return nullptr;
}
PrefService* local_state = g_browser_process->local_state();
DCHECK(local_state);
DCHECK(local_state->FindPreference(prefs::kInternalOnlyUisEnabled));
if (local_state->GetBoolean(prefs::kInternalOnlyUisEnabled)) {
DCHECK(local_state->FindPreference(chrome_urls::kInternalOnlyUisEnabled));
if (local_state->GetBoolean(chrome_urls::kInternalOnlyUisEnabled)) {
return nullptr;
}
return std::make_unique<InternalDebugPagesDisabledUI>(web_ui, url.host());
}
#if BUILDFLAG(ENABLE_PDF)
std::optional<network::CrossOriginEmbedderPolicy>
ChromeContentBrowserClient::MaybeOverrideLocalURLCrossOriginEmbedderPolicy(
content::NavigationHandle* navigation_handle) {
if (!chrome_pdf::features::IsOopifPdfEnabled() ||
!navigation_handle->IsPdf()) {
return std::nullopt;
}
// TODO(crbug.com/40053796): Local URLs inherit their policy container from
// the navigation initiator instead of the document creating the navigation
// request, so local PDF URL navigations in the PDF renderer inherit policies
// from the PDF extension frame (the parent frame) and might have the
// incorrect COEP. Until this is fixed, just copy the COEP directly from the
// PDF embedder.
content::RenderFrameHost* pdf_extension = navigation_handle->GetParentFrame();
CHECK(pdf_extension);
content::RenderFrameHost* pdf_embedder = pdf_extension->GetParent();
CHECK(pdf_embedder);
return pdf_embedder->GetCrossOriginEmbedderPolicy();
}
#endif // BUILDFLAG(ENABLE_PDF)
@@ -90,6 +90,7 @@
#include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
#include "chrome/browser/ui/webui/policy/policy_ui.h"
#include "chrome/browser/ui/webui/print_preview/policy_settings.h"
#include "components/page_info/core/merchant_trust_service.h"
#include "components/plus_addresses/plus_address_prefs.h"
#include "components/privacy_sandbox/tpcd_pref_names.h"
#include "components/services/on_device_translation/buildflags/buildflags.h"
@@ -190,6 +191,7 @@
#include "components/translate/core/browser/translate_prefs.h"
#include "components/update_client/update_client.h"
#include "components/variations/service/variations_service.h"
#include "components/webui/chrome_urls/pref_names.h"
#include "content/public/browser/render_process_host.h"
#include "extensions/buildflags/buildflags.h"
#include "net/http/http_server_properties_manager.h"
@@ -203,6 +205,8 @@
#endif
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
#include "chrome/browser/extensions/extension_web_ui.h"
#include "chrome/browser/ui/webui/extensions/extensions_ui_prefs.h"
#include "extensions/browser/api/runtime/runtime_api.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/permissions_manager.h"
@@ -215,7 +219,6 @@
#include "chrome/browser/extensions/activity_log/activity_log.h"
#include "chrome/browser/extensions/api/tabs/tabs_api.h"
#include "chrome/browser/extensions/commands/command_service.h"
#include "chrome/browser/extensions/extension_web_ui.h"
#include "chrome/browser/extensions/preinstalled_apps.h"
#include "chrome/browser/ui/extensions/settings_api_bubble_helpers.h"
#include "chrome/browser/ui/webui/extensions/extensions_ui.h"
@@ -276,6 +279,7 @@
#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/file_suggestion/drive_service.h"
#include "chrome/browser/new_tab_page/modules/file_suggestion/microsoft_files_page_handler.h"
#include "chrome/browser/new_tab_page/modules/safe_browsing/safe_browsing_handler.h"
#include "chrome/browser/new_tab_page/modules/v2/authentication/microsoft_auth_page_handler.h"
#include "chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler.h"
@@ -312,7 +316,6 @@
#include "components/live_caption/live_caption_controller.h"
#include "components/live_caption/live_translate_controller.h"
#include "components/ntp_tiles/custom_links_manager_impl.h"
#include "components/user_notes/user_notes_prefs.h"
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
@@ -323,15 +326,14 @@
#include "chrome/browser/chromeos/extensions/echo_private/echo_private_api_util.h"
#include "chrome/browser/chromeos/extensions/login_screen/login/login_api_prefs.h"
#include "chrome/browser/chromeos/policy/dlp/dlp_rules_manager_impl.h"
#include "chrome/browser/chromeos/quickoffice/quickoffice_prefs.h"
#include "chrome/browser/chromeos/reporting/metric_reporting_prefs.h"
#include "chrome/browser/extensions/api/document_scan/profile_prefs_registry_util.h"
#include "chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_registry_util.h"
#include "chrome/browser/memory/oom_kills_monitor.h"
#include "chrome/browser/policy/annotations/blocklist_handler.h"
#include "chrome/browser/policy/networking/policy_cert_service.h"
#include "chrome/browser/policy/system_features_disable_list_policy_handler.h"
#include "chrome/browser/ui/webui/certificates_handler.h"
#include "chromeos/ash/components/quickoffice/quickoffice_prefs.h"
#include "chromeos/ui/wm/fullscreen/pref_names.h"
#if BUILDFLAG(USE_CUPS)
#include "chrome/browser/extensions/api/printing/printing_api_handler.h"
@@ -339,7 +341,6 @@
#endif // BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/components/arc/arc_prefs.h"
#include "ash/constants/ash_pref_names.h"
#include "ash/public/cpp/ash_prefs.h"
#include "chrome/browser/apps/app_discovery_service/almanac_fetcher.h"
@@ -420,7 +421,6 @@
#include "chrome/browser/ash/printing/enterprise/enterprise_printers_provider.h"
#include "chrome/browser/ash/release_notes/release_notes_storage.h"
#include "chrome/browser/ash/scanning/chrome_scanning_app_delegate.h"
#include "chrome/browser/ash/scheduler_config/scheduler_configuration_manager.h"
#include "chrome/browser/ash/settings/device_settings_cache.h"
#include "chrome/browser/ash/system/automatic_reboot_manager.h"
#include "chrome/browser/ash/system/input_device_settings.h"
@@ -435,6 +435,7 @@
#include "chrome/browser/ui/webui/settings/reset_settings_handler.h"
#include "chrome/browser/upgrade_detector/upgrade_detector_chromeos.h"
#include "chromeos/ash/components/audio/audio_devices_pref_handler_impl.h"
#include "chromeos/ash/components/boca/babelorca/babel_orca_manager.h"
#include "chromeos/ash/components/boca/on_task/on_task_prefs.h"
#include "chromeos/ash/components/demo_mode/utils/demo_session_utils.h"
#include "chromeos/ash/components/local_search_service/search_metrics_reporter.h"
@@ -446,7 +447,9 @@
#include "chromeos/ash/components/network/proxy/proxy_config_handler.h"
#include "chromeos/ash/components/policy/restriction_schedule/device_restriction_schedule_controller.h"
#include "chromeos/ash/components/report/report_controller.h"
#include "chromeos/ash/components/scheduler_config/scheduler_configuration_manager.h"
#include "chromeos/ash/components/timezone/timezone_resolver.h"
#include "chromeos/ash/experiences/arc/arc_prefs.h"
#include "chromeos/ash/services/assistant/public/cpp/assistant_prefs.h"
#include "chromeos/ash/services/auth_factor_config/auth_factor_config.h"
#include "chromeos/ash/services/bluetooth_config/bluetooth_power_controller_impl.h"
@@ -512,7 +515,7 @@
#include "chrome/browser/ui/startup/first_run_service.h"
#endif
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(ENABLE_DOWNGRADE_PROCESSING)
#include "chrome/browser/downgrade/downgrade_prefs.h"
#endif
@@ -557,66 +560,6 @@ namespace {
// Please keep the list of deprecated prefs in chronological order. i.e. Add to
// the bottom of the list, not here at the top.
// Deprecated 01/2024.
const char kPrivacySandboxPageViewed[] = "privacy_sandbox.page_viewed";
// Deprecated 01/2024.
const char kPrivacySandboxApisEnabledV2[] = "privacy_sandbox.apis_enabled_v2";
const char kPrivacySandboxManuallyControlledV2[] =
"privacy_sandbox.manually_controlled_v2";
// Deprecated 01/2024.
#if BUILDFLAG(ENABLE_COMPOSE)
constexpr char kPrefHasAcceptedComposeConsent[] =
"compose_has_accepted_consent";
constexpr char kAutofillAssistanceEnabled[] = "autofill_assistance.enabled";
#endif
// Deprecated 01/2024.
const char kSyncedLastTimePasswordCheckCompleted[] =
"profile.credentials_last_password_checkup_time";
// Deprecated 01/2024.
const char kDownloadBubbleIphSuppression[] = "suppress_download_bubble_iph";
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 01/2024.
const char kPersistedSystemExtensions[] = "system_extensions.persisted";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 01/2024.
const char kPPAPISharedImagesForVideoDecoderAllowed[] =
"policy.ppapi_shared_images_for_video_decoder_allowed";
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 01/2024.
const char kBorealisVmTokenHash[] = "borealis.vm_token_hash";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 01/2024.
#if BUILDFLAG(IS_CHROMEOS_ASH)
constexpr char kExtendedFkeysModifier[] =
"ash.settings.extended_fkeys_modifier";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 01/2024.
constexpr char kNtpShownPage[] = "ntp.shown_page";
constexpr char kNtpAppPageNames[] = "ntp.app_page_names";
// Deprecated 01/2024.
#if BUILDFLAG(IS_WIN)
const char kSearchResultsPagePrimaryFontsPref[] =
"cached_fonts.search_results_page.primary";
const char kSearchResultsPageFallbackFontsPref[] =
"cached_fonts.search_results_page.fallback";
#endif // BUILDFLAG(IS_WIN)
// Deprecated 01/2024.
#if BUILDFLAG(IS_CHROMEOS_ASH)
constexpr char kUpdateNotificationLastShownMilestone[] =
"update_notification_last_shown_milestone";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 02/2024.
#if BUILDFLAG(IS_ANDROID)
constexpr char kSavePasswordsSuspendedByError[] =
@@ -1154,42 +1097,55 @@ inline constexpr char kDeleteTimePeriodV2Basic[] =
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 12/2024
const char kCryptAuthDeviceSyncIsRecoveringFromFailure[] =
inline const char kCryptAuthDeviceSyncIsRecoveringFromFailure[] =
"cryptauth.device_sync.is_recovering_from_failure";
const char kCryptAuthDeviceSyncLastSyncTimeSeconds[] =
inline const char kCryptAuthDeviceSyncLastSyncTimeSeconds[] =
"cryptauth.device_sync.last_device_sync_time_seconds";
const char kCryptAuthDeviceSyncReason[] = "cryptauth.device_sync.reason";
const char kCryptAuthDeviceSyncUnlockKeys[] =
inline const char kCryptAuthDeviceSyncReason[] = "cryptauth.device_sync.reason";
inline const char kCryptAuthDeviceSyncUnlockKeys[] =
"cryptauth.device_sync.unlock_keys";
const char kCryptAuthEnrollmentIsRecoveringFromFailure[] =
inline const char kCryptAuthEnrollmentIsRecoveringFromFailure[] =
"cryptauth.enrollment.is_recovering_from_failure";
const char kCryptAuthEnrollmentLastEnrollmentTimeSeconds[] =
inline const char kCryptAuthEnrollmentLastEnrollmentTimeSeconds[] =
"cryptauth.enrollment.last_enrollment_time_seconds";
const char kCryptAuthEnrollmentReason[] = "cryptauth.enrollment.reason";
const char kCryptAuthEnrollmentUserPublicKey[] =
inline const char kCryptAuthEnrollmentReason[] = "cryptauth.enrollment.reason";
inline const char kCryptAuthEnrollmentUserPublicKey[] =
"cryptauth.enrollment.user_public_key";
const char kCryptAuthEnrollmentUserPrivateKey[] =
inline const char kCryptAuthEnrollmentUserPrivateKey[] =
"cryptauth.enrollment.user_private_key";
const char kLacrosLaunchOnLogin[] = "lacros.launch_on_login";
const char kLacrosLaunchSwitch[] = "lacros_launch_switch";
const char kLacrosSelection[] = "lacros_selection";
inline const char kLacrosLaunchOnLogin[] = "lacros.launch_on_login";
inline const char kLacrosLaunchSwitch[] = "lacros_launch_switch";
inline const char kLacrosSelection[] = "lacros_selection";
inline constexpr char kAccessibilityCursorColorEnabled[] =
"settings.a11y.cursor_color_enabled";
#endif
// Deprecated 12/2024.
inline constexpr char kPageContentCollectionEnabled[] =
"page_content_collection.enabled";
// Deprecated 01/2025.
inline constexpr char kCompactModeEnabled[] = "compact_mode";
// Deprecated 01/2025.
inline constexpr char kSafeBrowsingAutomaticDeepScanningIPHSeen[] =
"safebrowsing.automatic_deep_scanning_iph_seen";
inline constexpr char kSafeBrowsingAutomaticDeepScanPerformed[] =
"safe_browsing.automatic_deep_scan_performed";
#if BUILDFLAG(IS_CHROMEOS)
// Deprecated 01/2025.
inline constexpr char kUsedPolicyCertificates[] =
"policy.used_policy_certificates";
#endif // BUILDFLAG(IS_CHROMEOS)
// Deprecated 02/2025.
inline constexpr char kUserAgentClientHintsGREASEUpdateEnabled[] =
"policy.user_agent_client_hints_grease_update_enabled";
// Register local state used only for migration (clearing or moving to a new
// key).
void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
// Deprecated 01/2024.
registry->RegisterBooleanPref(kPPAPISharedImagesForVideoDecoderAllowed, true);
// Deprecated 01/2024.
#if BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterIntegerPref(kExtendedFkeysModifier, 0);
#endif
// Deprecated 02/2024
#if BUILDFLAG(IS_MAC)
registry->RegisterBooleanPref(kScreenTimeEnabled, true);
@@ -1294,6 +1250,9 @@ void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
registry->RegisterIntegerPref(kLacrosLaunchSwitch, 0);
registry->RegisterIntegerPref(kLacrosSelection, 0);
#endif
// Deprecated 02/2025.
registry->RegisterBooleanPref(kUserAgentClientHintsGREASEUpdateEnabled, true);
}
// Register prefs used only for migration (clearing or moving to a new key).
@@ -1301,47 +1260,6 @@ void RegisterProfilePrefsForMigration(
user_prefs::PrefRegistrySyncable* registry) {
chrome_browser_net::secure_dns::RegisterProbesSettingBackupPref(registry);
// Deprecated 01/2024.
registry->RegisterBooleanPref(kPrivacySandboxPageViewed, false);
// Deprecated 01/2024.
registry->RegisterBooleanPref(kPrivacySandboxApisEnabledV2, false);
registry->RegisterBooleanPref(kPrivacySandboxManuallyControlledV2, false);
// Deprecated 01/2024.
#if BUILDFLAG(ENABLE_COMPOSE)
registry->RegisterBooleanPref(kPrefHasAcceptedComposeConsent, false);
registry->RegisterBooleanPref(kAutofillAssistanceEnabled, false);
#endif
// Deprecated 01/2024.
registry->RegisterTimePref(kSyncedLastTimePasswordCheckCompleted,
base::Time());
// Deprecated 01/2024.
registry->RegisterBooleanPref(kDownloadBubbleIphSuppression, false);
// Deprecated 01/2024.
#if BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterDictionaryPref(kPersistedSystemExtensions);
registry->RegisterStringPref(kBorealisVmTokenHash, "");
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
// Deprecated 01/2024.
registry->RegisterIntegerPref(kNtpShownPage, 0);
registry->RegisterListPref(kNtpAppPageNames);
// Deprecated 01/2024.
#if BUILDFLAG(IS_WIN)
registry->RegisterListPref(kSearchResultsPagePrimaryFontsPref);
registry->RegisterListPref(kSearchResultsPageFallbackFontsPref);
#endif
// Deprecated 01/2024.
#if BUILDFLAG(IS_CHROMEOS_ASH)
registry->RegisterIntegerPref(kUpdateNotificationLastShownMilestone, -10);
#endif
// Deprecated 02/2024.
#if BUILDFLAG(IS_ANDROID)
registry->RegisterBooleanPref(kSavePasswordsSuspendedByError, false);
@@ -1676,10 +1594,24 @@ void RegisterProfilePrefsForMigration(
registry->RegisterStringPref(kCryptAuthEnrollmentUserPrivateKey,
std::string());
registry->RegisterBooleanPref(kLacrosLaunchOnLogin, false);
registry->RegisterBooleanPref(kAccessibilityCursorColorEnabled, false);
#endif
// Deprecated 12/2024.
registry->RegisterBooleanPref(kPageContentCollectionEnabled, false);
// Deprecated 01/2025.
registry->RegisterBooleanPref(kCompactModeEnabled, false);
// Deprecated 01/2025.
registry->RegisterBooleanPref(kSafeBrowsingAutomaticDeepScanningIPHSeen,
false);
registry->RegisterBooleanPref(kSafeBrowsingAutomaticDeepScanPerformed, false);
#if BUILDFLAG(IS_CHROMEOS)
// Deprecated 01/2025.
registry->RegisterBooleanPref(kUsedPolicyCertificates, false);
#endif // BUILDFLAG(IS_CHROMEOS)
}
} // namespace
@@ -1708,6 +1640,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
BrowserProcessImpl::RegisterPrefs(registry);
ChromeContentBrowserClient::RegisterLocalStatePrefs(registry);
chrome_labs_prefs::RegisterLocalStatePrefs(registry);
chrome_urls::RegisterPrefs(registry);
ChromeMetricsServiceClient::RegisterPrefs(registry);
enterprise_util::RegisterLocalStatePrefs(registry);
component_updater::RegisterPrefs(registry);
@@ -1773,12 +1706,9 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
// function called above. Please keep this list alphabetized.
registry->RegisterBooleanPref(
policy::policy_prefs::kIntensiveWakeUpThrottlingEnabled, false);
registry->RegisterBooleanPref(
policy::policy_prefs::kUserAgentClientHintsGREASEUpdateEnabled, true);
#if BUILDFLAG(IS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
registry->RegisterBooleanPref(prefs::kFeatureNotificationsEnabled, true);
#endif // BUILDFLAG(IS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
registry->RegisterBooleanPref(prefs::kInternalOnlyUisEnabled, false);
#if BUILDFLAG(IS_ANDROID)
registry->RegisterBooleanPref(policy::policy_prefs::kBackForwardCacheEnabled,
true);
@@ -1949,7 +1879,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
#endif // BUILDFLAG(IS_WIN)
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(ENABLE_DOWNGRADE_PROCESSING)
downgrade::RegisterPrefs(registry);
#endif
@@ -2058,6 +1988,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
media_device_salt::MediaDeviceIDSalt::RegisterProfilePrefs(registry);
MediaEngagementService::RegisterProfilePrefs(registry);
MediaStorageIdSalt::RegisterProfilePrefs(registry);
page_info::MerchantTrustService::RegisterProfilePrefs(registry);
metrics::RegisterDemographicsProfilePrefs(registry);
NotificationDisplayServiceImpl::RegisterProfilePrefs(registry);
NotifierStateTracker::RegisterProfilePrefs(registry);
@@ -2127,14 +2058,14 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
extensions::PermissionsManager::RegisterProfilePrefs(registry);
extensions::ExtensionPrefs::RegisterProfilePrefs(registry);
extensions::RuntimeAPI::RegisterPrefs(registry);
extensions_ui_prefs::RegisterProfilePrefs(registry);
ExtensionWebUI::RegisterProfilePrefs(registry);
#endif // BUILDFLAG(ENABLE_EXTENSIONS_CORE)
#if BUILDFLAG(ENABLE_EXTENSIONS)
ExtensionWebUI::RegisterProfilePrefs(registry);
RegisterAnimationPolicyPrefs(registry);
extensions::ActivityLog::RegisterProfilePrefs(registry);
extensions::AudioAPI::RegisterUserPrefs(registry);
extensions::ExtensionsUI::RegisterProfilePrefs(registry);
#if BUILDFLAG(IS_CHROMEOS_ASH)
extensions::shared_storage::RegisterProfilePrefs(registry);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
@@ -2199,6 +2130,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
media_router::RegisterAccessCodeProfilePrefs(registry);
media_router::RegisterProfilePrefs(registry);
MicrosoftAuthPageHandler::RegisterProfilePrefs(registry);
MicrosoftFilesPageHandler::RegisterProfilePrefs(registry);
NewTabPageHandler::RegisterProfilePrefs(registry);
NewTabPageUI::RegisterProfilePrefs(registry);
ntp::SafeBrowsingHandler::RegisterProfilePrefs(registry);
@@ -2220,7 +2152,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
ThemeColorPickerHandler::RegisterProfilePrefs(registry);
toolbar::RegisterProfilePrefs(registry);
UnifiedAutoplayConfig::RegisterProfilePrefs(registry);
user_notes::RegisterProfilePrefs(registry);
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_CHROMEOS)
@@ -2232,7 +2163,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
chromeos::cloud_storage::RegisterProfilePrefs(registry);
chromeos::cloud_upload::RegisterProfilePrefs(registry);
policy::NetworkAnnotationBlocklistHandler::RegisterPrefs(registry);
policy::PolicyCertService::RegisterProfilePrefs(registry);
quickoffice::RegisterProfilePrefs(registry);
registry->RegisterBooleanPref(prefs::kDeskAPIThirdPartyAccessEnabled, false);
registry->RegisterBooleanPref(prefs::kDeskAPIDeskSaveAndShareEnabled, false);
@@ -2337,6 +2267,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
ash::reporting::RegisterProfilePrefs(registry);
ChromeMediaAppGuestUIDelegate::RegisterProfilePrefs(registry);
ash::boca::RegisterOnTaskProfilePrefs(registry);
ash::boca::BabelOrcaManager::RegisterProfilePrefs(registry);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS_LACROS)
@@ -2389,6 +2320,9 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
registry->RegisterBooleanPref(
webauthn::pref_names::kRemoteProxiedRequestsAllowed, false);
registry->RegisterListPref(
webauthn::pref_names::kRemoteDesktopAllowedOrigins);
registry->RegisterStringPref(
webauthn::pref_names::kLastUsedPairingFromSyncPublicKey, "");
@@ -2446,8 +2380,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
registry->RegisterIntegerPref(prefs::kLensOverlayStartCount, 0);
registry->RegisterDictionaryPref(prefs::kReportingEndpoints);
registry->RegisterBooleanPref(prefs::kCompactModeEnabled, false);
}
void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
@@ -2493,14 +2425,6 @@ void MigrateObsoleteLocalStatePrefs(PrefService* local_state) {
// BEGIN_MIGRATE_OBSOLETE_LOCAL_STATE_PREFS
// Please don't delete the preceding line. It is used by PRESUBMIT.py.
// Added 01/2024.
local_state->ClearPref(kPPAPISharedImagesForVideoDecoderAllowed);
// Added 01/2024.
#if BUILDFLAG(IS_CHROMEOS_ASH)
local_state->ClearPref(kExtendedFkeysModifier);
#endif
// Added 02/2024
#if BUILDFLAG(IS_MAC)
local_state->ClearPref(kScreenTimeEnabled);
@@ -2606,6 +2530,9 @@ void MigrateObsoleteLocalStatePrefs(PrefService* local_state) {
local_state->ClearPref(kLacrosSelection);
#endif
// Added 02/2025.
local_state->ClearPref(kUserAgentClientHintsGREASEUpdateEnabled);
// Please don't delete the following line. It is used by PRESUBMIT.py.
// END_MIGRATE_OBSOLETE_LOCAL_STATE_PREFS
@@ -2658,57 +2585,6 @@ void MigrateObsoleteProfilePrefs(PrefService* profile_prefs,
profile_path);
#endif
// Added 01/2024.
profile_prefs->ClearPref(kPrivacySandboxPageViewed);
// Added 01/2024.
profile_prefs->ClearPref(kPrivacySandboxApisEnabledV2);
profile_prefs->ClearPref(kPrivacySandboxManuallyControlledV2);
// Added 01/2024.
#if BUILDFLAG(ENABLE_COMPOSE)
profile_prefs->ClearPref(kPrefHasAcceptedComposeConsent);
profile_prefs->ClearPref(kAutofillAssistanceEnabled);
#endif
// Added 01/2024.
profile_prefs->ClearPref(kSyncedLastTimePasswordCheckCompleted);
// Added 01/2024.
profile_prefs->ClearPref(kDownloadBubbleIphSuppression);
// Added 01/2024.
#if BUILDFLAG(IS_CHROMEOS_ASH)
profile_prefs->ClearPref(kPersistedSystemExtensions);
profile_prefs->ClearPref(kBorealisVmTokenHash);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if !BUILDFLAG(IS_ANDROID)
// Added 1/2024.
performance_manager::user_tuning::prefs::MigrateTabDiscardingExceptionsPref(
profile_prefs);
#endif
// Added 01/2024.
profile_prefs->ClearPref(kNtpShownPage);
profile_prefs->ClearPref(kNtpAppPageNames);
// Added 01/2024.
#if BUILDFLAG(IS_WIN)
profile_prefs->ClearPref(kSearchResultsPagePrimaryFontsPref);
profile_prefs->ClearPref(kSearchResultsPageFallbackFontsPref);
#endif
// Added 01/2024.
#if BUILDFLAG(IS_CHROMEOS_ASH)
profile_prefs->ClearPref(kUpdateNotificationLastShownMilestone);
#endif
// Added 01/2024.
#if BUILDFLAG(IS_ANDROID)
profile_prefs->ClearPref(kSavePasswordsSuspendedByError);
#endif
// Added 02/2024
profile_prefs->ClearPref(kSafeBrowsingDeepScanPromptSeen);
profile_prefs->ClearPref(kSafeBrowsingEsbEnabledTimestamp);
@@ -3022,11 +2898,30 @@ void MigrateObsoleteProfilePrefs(PrefService* profile_prefs,
profile_prefs->ClearPref(kCryptAuthEnrollmentUserPublicKey);
profile_prefs->ClearPref(kCryptAuthEnrollmentUserPrivateKey);
profile_prefs->ClearPref(kLacrosLaunchOnLogin);
profile_prefs->ClearPref(kAccessibilityCursorColorEnabled);
#endif
// Added 12/2024.
profile_prefs->ClearPref(kPageContentCollectionEnabled);
#if !BUILDFLAG(IS_ANDROID)
// Added 01/2025.
password_manager::features_util::MigrateDefaultProfileStorePref(
profile_prefs);
#endif // !BUILDFLAG(IS_ANDROID)
// Added 01/2025.
profile_prefs->ClearPref(kCompactModeEnabled);
// Added 01/2025.
profile_prefs->ClearPref(kSafeBrowsingAutomaticDeepScanPerformed);
profile_prefs->ClearPref(kSafeBrowsingAutomaticDeepScanningIPHSeen);
#if BUILDFLAG(IS_CHROMEOS)
// Added 01/2025.
profile_prefs->ClearPref(kUsedPolicyCertificates);
#endif // BUILDFLAG(IS_CHROMEOS)
// Please don't delete the following line. It is used by PRESUBMIT.py.
// END_MIGRATE_OBSOLETE_PROFILE_PREFS
@@ -13,7 +13,6 @@
#include "base/time/default_tick_clock.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/breadcrumbs/breadcrumb_manager_tab_helper.h"
#include "chrome/browser/browser_process.h"
@@ -153,7 +152,6 @@
#include "components/site_engagement/content/site_engagement_service.h"
#include "components/tracing/common/tracing_switches.h"
#include "components/ukm/content/source_url_recorder.h"
#include "components/user_notes/user_notes_features.h"
#include "components/webapps/browser/installable/installable_manager.h"
#include "components/webapps/browser/installable/ml_installability_promoter.h"
#include "content/public/browser/web_contents.h"
@@ -212,22 +210,15 @@
#include "components/zoom/zoom_controller.h"
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS)
#include "chrome/browser/ash/boot_times_recorder/boot_times_recorder_tab_helper.h"
#include "chrome/browser/ash/growth/campaigns_manager_session_tab_helper.h"
#include "chrome/browser/ash/mahi/web_contents/mahi_tab_helper.h"
#include "chrome/browser/ui/ash/google_one/google_one_offer_iph_tab_helper.h"
#endif
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chrome/browser/lacros/web_contents_can_go_back_observer.h"
#endif
#if BUILDFLAG(IS_CHROMEOS)
#include "chrome/browser/chromeos/cros_apps/cros_apps_tab_helper.h"
#include "chrome/browser/chromeos/gemini_app/gemini_app_tab_helper.h"
#include "chrome/browser/chromeos/policy/dlp/dlp_content_tab_helper.h"
#include "chrome/browser/chromeos/printing/print_preview/printing_init_cros.h"
#include "chrome/browser/ui/ash/google_one/google_one_offer_iph_tab_helper.h"
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
@@ -356,9 +347,11 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
}
if (fingerprinting_protection_filter::features::
IsFingerprintingProtectionFeatureEnabled()) {
IsFingerprintingProtectionEnabledForIncognitoState(
profile->IsIncognitoProfile())) {
CreateFingerprintingProtectionWebContentsHelper(
web_contents, profile->GetPrefs(),
HostContentSettingsMapFactory::GetForProfile(profile),
TrackingProtectionSettingsFactory::GetForProfile(profile),
profile->IsIncognitoProfile());
}
@@ -507,9 +500,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
web_contents,
safe_browsing::TailoredSecurityServiceFactory::GetForProfile(profile));
}
if (base::FeatureList::IsEnabled(
safe_browsing::kSafeBrowsingAsyncRealTimeCheck) &&
g_browser_process->safe_browsing_service()) {
if (g_browser_process->safe_browsing_service()) {
safe_browsing::AsyncCheckTracker::CreateForWebContents(
web_contents, g_browser_process->safe_browsing_service()->ui_manager(),
safe_browsing::AsyncCheckTracker::
@@ -663,20 +654,14 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
}
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
#if BUILDFLAG(IS_CHROMEOS)
GoogleOneOfferIphTabHelper::CreateForWebContents(web_contents);
// Do not create for Incognito mode.
if (!profile->IsOffTheRecord()) {
CampaignsManagerSessionTabHelper::CreateForWebContents(web_contents);
}
ash::BootTimesRecorderTabHelper::MaybeCreateForWebContents(web_contents);
#endif
#if BUILDFLAG(IS_CHROMEOS_LACROS)
WebContentsCanGoBackObserver::CreateForWebContents(web_contents);
#endif
#if BUILDFLAG(IS_CHROMEOS)
CrosAppsTabHelper::MaybeCreateForWebContents(web_contents);
GeminiAppTabHelper::MaybeCreateForWebContents(web_contents);
mahi::MahiTabHelper::MaybeCreateForWebContents(web_contents);
@@ -687,10 +672,7 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
webapps::PreRedirectionURLObserver::CreateForWebContents(web_contents);
#endif
// TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \
(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
metrics::DesktopSessionDurationObserver::CreateForWebContents(web_contents);
#endif
@@ -710,7 +692,11 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
kPerformanceControlsMemorySaverOptOutSurvey) ||
base::FeatureList::IsEnabled(
performance_manager::features::
kPerformanceControlsBatterySaverOptOutSurvey)) {
kPerformanceControlsBatterySaverOptOutSurvey) ||
base::FeatureList::IsEnabled(
page_info::kMerchantTrustEvaluationControlSurvey) ||
base::FeatureList::IsEnabled(
page_info::kMerchantTrustEvaluationExperimentSurvey)) {
HatsHelper::CreateForWebContents(web_contents);
}
SharedHighlightingPromo::CreateForWebContents(web_contents);
@@ -56,8 +56,9 @@ ChromeContentBrowserClientWebUiPart::ChromeContentBrowserClientWebUiPart() =
ChromeContentBrowserClientWebUiPart::~ChromeContentBrowserClientWebUiPart() =
default;
void ChromeContentBrowserClientWebUiPart::OverrideWebkitPrefs(
void ChromeContentBrowserClientWebUiPart::OverrideWebPreferences(
content::WebContents* web_contents,
content::SiteInstance& main_frame_site,
blink::web_pref::WebPreferences* web_prefs) {
// This logic is invoked at startup, and anytime the default prefs change.
GURL url = GetVisibleURL(web_contents);
@@ -83,6 +84,7 @@ void ChromeContentBrowserClientWebUiPart::OverrideWebkitPrefs(
bool ChromeContentBrowserClientWebUiPart::OverrideWebPreferencesAfterNavigation(
content::WebContents* web_contents,
content::SiteInstance& main_frame_site,
blink::web_pref::WebPreferences* web_prefs) {
// This logic is invoked once on each navigation.
@@ -92,8 +94,7 @@ bool ChromeContentBrowserClientWebUiPart::OverrideWebPreferencesAfterNavigation(
}
// Extensions are handled by ChromeContentBrowserClientExtensionsPart.
const GURL& site_url =
web_contents->GetPrimaryMainFrame()->GetSiteInstance()->GetSiteURL();
const GURL& site_url = main_frame_site.GetSiteURL();
if (site_url.SchemeIs(extensions::kExtensionScheme)) {
return false;
}
@@ -23,8 +23,7 @@ namespace autofillPrivate {
boolean isAutofillSyncToggleEnabled;
};
// A copy of FieldType from
// chrome/common/extensions/api/autofill_private.idl
// A copy of FieldType from components/autofill/core/browser/field_types.h.
enum FieldType {
NO_SERVER_DATA,
UNKNOWN_TYPE,
@@ -127,6 +126,14 @@ namespace autofillPrivate {
ADDRESS_HOME_HOUSE_NUMBER_AND_APT,
SINGLE_USERNAME_WITH_INTERMEDIATE_VALUES,
IMPROVED_PREDICTION,
PASSPORT_NAME_TAG,
PASSPORT_NUMBER,
PASSPORT_ISSUING_COUNTRY_TAG,
PASSPORT_EXPIRATION_DATE_TAG,
PASSPORT_ISSUE_DATE_TAG,
LOYALTY_MEMBERSHIP_PROGRAM,
LOYALTY_MEMBERSHIP_PROVIDER,
LOYALTY_MEMBERSHIP_ID,
MAX_VALID_FIELD_TYPE
};
@@ -335,6 +342,10 @@ namespace autofillPrivate {
// |address|: The address entry to save.
static void saveAddress(AddressEntry address);
// Removes the address with the given ID.
// |guid|: ID of the address to remove.
static void removeAddress(DOMString guid);
// Gets the list of all countries.
// |forAccountAddressProfile|: whether the address profile opened in the
// editor originates in the user's profile.
@@ -367,9 +378,9 @@ namespace autofillPrivate {
// |iban|: The IBAN entry to save.
static void saveIban(IbanEntry iban);
// Removes the entry (address or credit card) with the given ID.
// |guid|: ID of the entry to remove.
static void removeEntry(DOMString guid);
// Removes the payments entity with the given ID.
// |guid|: ID of the entity to remove.
static void removePaymentsEntity(DOMString guid);
// Gets the list of credit cards.
// |callback|: Callback which will be called with the list of credit cards.
@@ -814,6 +814,8 @@ namespace autotestPrivate {
// Response callback to report if a field trial exists and has been activated.
callback IsFieldTrialActiveCallback = void(boolean active);
callback OverrideLobsterResponseForTestingCallback = void(boolean success);
// Request data containing the mock responses from
// overrideOrcaResponseForTesting.
dictionary OrcaResponseArray {
@@ -1615,6 +1617,11 @@ namespace autotestPrivate {
static void getCurrentInputMethodDescriptor(
GetCurrentInputMethodDescriptorCallback callback);
// Overrides the response from Lobster Fetcher and returns the boolean value
// that indicates if the overriding is successful or not.
static void overrideLobsterResponseForTesting(
OverrideLobsterResponseForTestingCallback callback);
// Overrides the response from Orca Provider and returns the boolean value
// that indicates if the overriding is successful or not.
static void overrideOrcaResponseForTesting(
@@ -257,6 +257,7 @@ namespace developerPrivate {
DOMString id;
AccessModifier incognitoAccess;
DOMString[] installWarnings;
boolean isCommandRegistrationHandledExternally;
DOMString? launchUrl;
Location location;
DOMString? locationText;
@@ -21,14 +21,14 @@ namespace enterprise.platformKeys {
// interface. The cryptographic operations, including key generation, are
// hardware-backed.
// <p>Only non-extractable keys can be generated. The supported key types
// are RSASSA-PKCS1-V1_5 and RSA-OAEP (on Chrome versions 134+) with
// are RSASSA-PKCS1-V1_5 and RSA-OAEP (on Chrome versions 135+) with
// <code>modulusLength</code> up to 2048 and ECDSA with
// <code>namedCurve</code> P-256. Each RSASSA-PKCS1-V1_5 and ECDSA key can
// be used for signing data at most once, unless the extension is
// allowlisted through the
// <a href="https://chromeenterprise.google/policies/#KeyPermissions">KeyPermissions policy</a>,
// in which case the key can be used indefinitely. RSA-OAEP keys are
// supported since Chrome version 134 and can be used by extensions
// supported since Chrome version 135 and can be used by extensions
// allowlisted through that same policy to unwrap other keys.</p>
// <p>Keys generated on a specific <code>Token</code> cannot be used with
// any other Tokens, nor can they be used with
@@ -44,13 +44,13 @@ namespace enterprise.platformKeys {
// non-extractable property, is done in software, so the keys are less
// protected than hardware-backed keys.
// <p>Only non-extractable keys can be generated. The supported key types
// are RSASSA-PKCS1-V1_5 and RSA-OAEP (on Chrome versions 134+) with
// are RSASSA-PKCS1-V1_5 and RSA-OAEP (on Chrome versions 135+) with
// <code>modulusLength</code> up to 2048. Each RSASSA-PKCS1-V1_5 key can be
// used for signing data at most once, unless the extension is allowlisted
// through the
// <a href="https://chromeenterprise.google/policies/#KeyPermissions">KeyPermissions policy</a>,
// in which case the key can be used indefinitely. RSA-OAEP keys are
// supported since Chrome version 134 and can be used by extensions
// supported since Chrome version 135 and can be used by extensions
// allowlisted through that same policy to unwrap other keys.</p>
// <p>Keys generated on a specific <code>Token</code> cannot be used with
// any other Tokens, nor can they be used with
@@ -22,7 +22,7 @@ namespace enterprise.platformKeysInternal {
DOMString name;
// Provided in case the algorithm is RSASSA-PKCS1-v1_5 or RSA-OAEP
// (the last type is supported on Chrome versions 134+).
// (the last type is supported on Chrome versions 135+).
long? modulusLength;
ArrayBuffer? publicExponent;
Hash? hash;
@@ -46,7 +46,7 @@ namespace enterprise.platformKeysInternal {
static void getTokens(GetTokensCallback callback);
// Internal version of SubtleCrypto.generateKey, currently supporting only
// RSASSA-PKCS1-v1_5, RSA-OAEP (on Chrome versions 134+), and ECDSA.
// RSASSA-PKCS1-v1_5, RSA-OAEP (on Chrome versions 135+), and ECDSA.
// |tokenId| The id of a Token returned by |getTokens|.
// |algorithm| The algorithm parameters as specified by WebCrypto.
// |softwareBacked| Whether the key operations should be executed in
@@ -14,5 +14,8 @@ namespace experimentalAiData {
DOMString userInput,
long tabId,
DataCallback callback);
static void getAiDataWithSpecifier(long tabId,
ArrayBuffer aiDataSpecifier,
DataCallback callback);
};
};
@@ -357,7 +357,6 @@ namespace passwordsPrivate {
callback PasswordCheckStatusCallback = void(PasswordCheckStatus status);
callback ImportPasswordsCallback = void(ImportResults results);
callback FetchFamilyResultsCallback = void(FamilyFetchResults results);
callback IsAccountStoreDefaultCallback = void(boolean isDefault);
callback GetUrlCollectionCallback = void(UrlCollection urlCollection);
callback CredentialsWithReusedPasswordCallback =
void(PasswordUiEntryList[] entries);
@@ -523,12 +522,6 @@ namespace passwordsPrivate {
static void getPasswordCheckStatus(
PasswordCheckStatusCallback callback);
// Requests whether the account store is a default location for saving
// passwords. False means the device store is a default one. Must be called
// when account storage is enabled.
static void isAccountStoreDefault(
IsAccountStoreDefaultCallback callback);
// Requests whether the given |url| meets the requirements to save a
// password for it (e.g. valid, has proper scheme etc.) and returns the
// corresponding URLCollection on success. Otherwise it raises an error.
@@ -1,38 +0,0 @@
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Manages an app's system indicator icon, an image displayed in the system's
// menubar, system tray, or other visible area provided by the OS.
// This is modelled after the other extension action APIs, such as
// chrome.browserAction and chrome.pageAction.
namespace systemIndicator {
dictionary SetIconDetails {
any? path;
any? imageData;
};
callback DoneCallback = void ();
interface Functions {
// Set the image to be used as an indicator icon, using a set of ImageData
// objects. These objects should have multiple resolutions so that an
// appropriate size can be selected for the given icon size and DPI scaling
// settings. Only square ImageData objects are accepted.
static void setIcon(
SetIconDetails details,
optional DoneCallback callback);
// Show the icon in the status tray.
static void enable();
// Hide the icon from the status tray.
static void disable();
};
interface Events {
// Fired only when a click on the icon does not result in a menu being
// shown.
static void onClicked();
};
};
@@ -9,6 +9,7 @@
#include <optional>
#include <string_view>
#include <utility>
#include <vector>
#include "base/check_op.h"
#include "base/command_line.h"
@@ -20,6 +21,7 @@
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/process/current_process.h"
#include "base/profiler/thread_group_profiler.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -38,6 +40,7 @@
#include "chrome/common/crash_keys.h"
#include "chrome/common/pepper_permission_util.h"
#include "chrome/common/ppapi_utils.h"
#include "chrome/common/profiler/chrome_thread_group_profiler_client.h"
#include "chrome/common/profiler/chrome_thread_profiler_client.h"
#include "chrome/common/profiler/core_unwinders.h"
#include "chrome/common/profiler/thread_profiler_configuration.h"
@@ -185,8 +188,6 @@
#if BUILDFLAG(IS_ANDROID)
#include "chrome/renderer/sandbox_status_extension_android.h"
#include "chrome/renderer/wallet/boarding_pass_extractor.h"
#include "components/facilitated_payments/content/renderer/facilitated_payments_agent.h"
#include "components/facilitated_payments/core/features/features.h"
#include "components/feed/content/renderer/rss_link_reader.h"
#include "components/feed/feed_feature_list.h"
#else
@@ -230,7 +231,6 @@
#endif // BUILDFLAG(ENABLE_GUEST_VIEW)
#if BUILDFLAG(ENABLE_PDF)
#include "chrome/renderer/pdf/chrome_pdf_internal_plugin_delegate.h"
#include "components/pdf/renderer/internal_plugin_renderer_helpers.h"
#endif // BUILDFLAG(ENABLE_PDF)
@@ -285,7 +285,6 @@ using blink::WebURL;
using blink::WebURLError;
using blink::WebURLRequest;
using blink::WebURLResponse;
using blink::WebVector;
using blink::mojom::FetchCacheMode;
using content::RenderFrame;
using content::RenderThread;
@@ -309,17 +308,23 @@ const char* const kPredefinedAllowedCameraDeviceOrigins[] = {
"4EB74897CB187C7633357C2FE832E0AD6A44883A"};
#endif
#if BUILDFLAG(ENABLE_PDF)
std::vector<url::Origin> GetAdditionalPdfInternalPluginAllowedOrigins() {
return {url::Origin::Create(GURL(chrome::kChromeUIPrintURL))};
}
#endif // BUILDFLAG(ENABLE_PDF)
#if BUILDFLAG(ENABLE_PLUGINS)
void AppendParams(
const std::vector<WebPluginMimeType::Param>& additional_params,
WebVector<WebString>* existing_names,
WebVector<WebString>* existing_values) {
std::vector<WebString>* existing_names,
std::vector<WebString>* existing_values) {
DCHECK(existing_names->size() == existing_values->size());
size_t existing_size = existing_names->size();
size_t total_size = existing_size + additional_params.size();
WebVector<WebString> names(total_size);
WebVector<WebString> values(total_size);
std::vector<WebString> names(total_size);
std::vector<WebString> values(total_size);
for (size_t i = 0; i < existing_size; ++i) {
names[i] = (*existing_names)[i];
@@ -381,6 +386,8 @@ ChromeContentRendererClient::ChromeContentRendererClient()
: remote_module_watcher_(nullptr, base::OnTaskRunnerDeleter(nullptr))
#endif
{
base::ThreadGroupProfiler::SetClient(
std::make_unique<ChromeThreadGroupProfilerClient>());
sampling_profiler::ThreadProfiler::SetClient(
std::make_unique<ChromeThreadProfilerClient>());
@@ -608,7 +615,7 @@ void ChromeContentRendererClient::RenderFrameCreated(
auto content_settings_delegate =
std::make_unique<ChromeContentSettingsAgentDelegate>(render_frame);
#if BUILDFLAG(ENABLE_EXTENSIONS)
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
content_settings_delegate->SetExtensionDispatcher(
extensions::ExtensionsRendererClient::Get()->dispatcher());
#endif
@@ -706,23 +713,9 @@ void ChromeContentRendererClient::RenderFrameCreated(
render_frame, associated_interfaces);
auto password_generation_agent = std::make_unique<PasswordGenerationAgent>(
render_frame, password_autofill_agent.get(), associated_interfaces);
new AutofillAgent(
render_frame,
{ExtractAllDatalists(false), FocusRequiresScroll(true),
QueryPasswordSuggestions(false), SecureContextRequired(false),
UserGestureRequired(true),
UsesKeyboardAccessoryForSuggestions(BUILDFLAG(IS_ANDROID))},
std::move(password_autofill_agent),
std::move(password_generation_agent), associated_interfaces);
#if BUILDFLAG(IS_ANDROID)
if (render_frame->IsMainFrame() &&
base::FeatureList::IsEnabled(
payments::facilitated::kEnablePixDetection)) {
new payments::facilitated::FacilitatedPaymentsAgent(
render_frame, associated_interfaces);
}
#endif
new AutofillAgent(render_frame, std::move(password_autofill_agent),
std::move(password_generation_agent),
associated_interfaces);
}
if (content_capture::features::IsContentCaptureEnabled()) {
@@ -866,7 +859,8 @@ bool ChromeContentRendererClient::IsPluginHandledExternally(
// used within an origin allowed to create the internal PDF plugin;
// otherwise, let Blink try to create the in-process PDF plugin.
if (IsPdfInternalPluginAllowedOrigin(
render_frame->GetWebFrame()->GetSecurityOrigin())) {
render_frame->GetWebFrame()->GetSecurityOrigin(),
GetAdditionalPdfInternalPluginAllowedOrigins())) {
return true;
}
}
@@ -902,6 +896,7 @@ v8::Local<v8::Object> ChromeContentRendererClient::GetScriptableObject(
const blink::WebElement& plugin_element,
v8::Isolate* isolate) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
// Used for plugins.
return extensions::ExtensionsRendererClient::Get()->GetScriptableObject(
plugin_element, isolate);
#else
@@ -915,6 +910,7 @@ bool ChromeContentRendererClient::OverrideCreatePlugin(
WebPlugin** plugin) {
std::string orig_mime_type = params.mime_type.Utf8();
#if BUILDFLAG(ENABLE_EXTENSIONS)
// Used for plugins.
if (!extensions::ExtensionsRendererClient::Get()->OverrideCreatePlugin(
render_frame, params)) {
return false;
@@ -1158,7 +1154,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
if (info.path.value() == ChromeContentClient::kPDFInternalPluginPath) {
return pdf::CreateInternalPlugin(
std::move(params), render_frame,
std::make_unique<ChromePdfInternalPluginDelegate>());
GetAdditionalPdfInternalPluginAllowedOrigins());
}
#endif // BUILDFLAG(ENABLE_PDF)
@@ -1434,7 +1430,7 @@ bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() {
}
bool ChromeContentRendererClient::AllowPopup() {
#if BUILDFLAG(ENABLE_EXTENSIONS)
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
return extensions::ExtensionsRendererClient::Get()->AllowPopup();
#else
return false;
@@ -1443,7 +1439,7 @@ bool ChromeContentRendererClient::AllowPopup() {
bool ChromeContentRendererClient::ShouldNotifyServiceWorkerOnWebSocketActivity(
v8::Local<v8::Context> context) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
return extensions::Dispatcher::ShouldNotifyServiceWorkerOnWebSocketActivity(
context);
#else
@@ -1457,7 +1453,7 @@ ChromeContentRendererClient::GetProtocolHandlerSecurityLevel(
if (origin.scheme() == chrome::kIsolatedAppScheme) {
return blink::ProtocolHandlerSecurityLevel::kSameOrigin;
}
#if BUILDFLAG(ENABLE_EXTENSIONS)
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
return extensions::ExtensionsRendererClient::Get()
->GetProtocolHandlerSecurityLevel();
#else
@@ -1473,7 +1469,7 @@ void ChromeContentRendererClient::WillSendRequest(
const net::SiteForCookies& site_for_cookies,
const url::Origin* initiator_origin,
GURL* new_url) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
// Check whether the request should be allowed. If not allowed, we reset the
// URL to something invalid to prevent the request and cause an error.
extensions::ExtensionsRendererClient::Get()->WillSendRequest(
@@ -1637,7 +1633,7 @@ ChromeContentRendererClient::GetSupportedKeySystems(
bool ChromeContentRendererClient::ShouldReportDetailedMessageForSource(
const std::u16string& source) {
#if BUILDFLAG(ENABLE_EXTENSIONS)
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
return extensions::IsSourceFromAnExtension(source);
#else
return false;
@@ -1862,7 +1858,7 @@ void ChromeContentRendererClient::DidSetUserAgent(
void ChromeContentRendererClient::AppendContentSecurityPolicy(
const blink::WebURL& url,
blink::WebVector<blink::WebContentSecurityPolicyHeader>* csp) {
std::vector<blink::WebContentSecurityPolicyHeader>* csp) {
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
#if BUILDFLAG(ENABLE_PDF)
// Don't apply default CSP to PDF renderers.
@@ -271,11 +271,19 @@ TimeUsageLimitEntry:
UsbDeviceId:
properties:
product_id:
maximum: 65535
minimum: 0
type: integer
vendor_id:
maximum: 65535
minimum: 0
type: integer
required:
- product_id
- vendor_id
type: object
UsbDeviceIdInclusive:
description: Use UsbDeviceId in new code.
properties:
product_id:
type: integer
@@ -1324,7 +1324,15 @@ policies:
1323: AllowedInputMethodsForceEnabled
1324: WebRtcIPHandlingUrl
1325: GenAIPhotoEditingSettings
1326: PartitionedBlobUrlUsage
1327: GlicSettings
1328: DefaultControlledFrameSetting
1329: ControlledFrameAllowedForUrls
1330: ControlledFrameBlockedForUrls
1331: ExternalStorageAllowlist
1332: WebAuthenticationRemoteDesktopAllowedOrigins
1333: ServiceWorkerToControlSrcdocIframeEnabled
1334: ProvisionManagedClientCertificateForBrowser
atomic_groups:
1: Homepage
@@ -1383,3 +1391,4 @@ atomic_groups:
54: BrowserEventReporting
55: SmartCardConnectSettings
56: WebRtc
57: ControlledFrameSettings
@@ -0,0 +1,30 @@
caption: Allow Controlled Frame API on these sites
desc: |-
The Controlled Frame API, available to certain isolated contexts such as Isolated Web Apps (IWAs), allows an app to embed and manipulate arbitrary content.
Please see https://github.com/WICG/controlled-frame for details.
Setting the policy lets you list the URL patterns that specify which sites are allowed to use the Controlled Frame API.
Valid patterns are limited to Isolated Web Apps.
Leaving the policy unset means <ph name="DEFAULT_CONTROLLED_FRAME_SETTING_POLICY_NAME">DefaultControlledFrameSetting</ph> applies for all sites, if it's set.
URL patterns must not conflict with <ph name="CONTROLLED_FRAME_BLOCKED_FOR_URLS_POLICY_NAME">ControlledFrameBlockedForUrls</ph>. Neither policy takes precedence if a URL matches with both.
For detailed information on valid url patterns, please see https://cloud.google.com/docs/chrome-enterprise/policies/url-patterns. <ph name="WILDCARD_VALUE">*</ph> is not an accepted value for this policy.
example_value:
- isolated-app://aerugqztij5biqquuk3mfwpsaibuegaqcitgfchwuosuofdjabzqaaic
features:
dynamic_refresh: true
per_profile: true
supported_on:
- chrome_os:134-
future_on:
- chrome.*
owners:
- file://chrome/browser/controlled_frame/OWNERS
schema:
items:
type: string
type: array
tags: []
type: list
@@ -0,0 +1,30 @@
caption: Block Controlled Frame API on these sites
desc: |-
The Controlled Frame API, available to certain isolated contexts such as Isolated Web Apps (IWAs), allows an app to embed and manipulate arbitrary content.
Please see https://github.com/WICG/controlled-frame for details.
Setting the policy lets you list the URL patterns that specify which sites are not allowed to use the Controlled Frame API.
Valid patterns are limited to Isolated Web Apps.
Leaving the policy unset means <ph name="DEFAULT_CONTROLLED_FRAME_SETTING_POLICY_NAME">DefaultControlledFrameSetting</ph> applies for all sites, if it's set.
URL patterns must not conflict with <ph name="CONTROLLED_FRAME_ALLOWED_FOR_URLS_POLICY_NAME">ControlledFrameAllowedForUrls</ph>. Neither policy takes precedence if a URL matches with both.
For detailed information on valid url patterns, please see https://cloud.google.com/docs/chrome-enterprise/policies/url-patterns. <ph name="WILDCARD_VALUE">*</ph> is not an accepted value for this policy.
example_value:
- isolated-app://aerugqztij5biqquuk3mfwpsaibuegaqcitgfchwuosuofdjabzqaaic
features:
dynamic_refresh: true
per_profile: true
supported_on:
- chrome_os:134-
future_on:
- chrome.*
owners:
- file://chrome/browser/controlled_frame/OWNERS
schema:
items:
type: string
type: array
tags: []
type: list
@@ -0,0 +1,33 @@
caption: Control use of the Controlled Frame API
default: null
desc: |-
The Controlled Frame API, available to certain isolated contexts such as Isolated Web Apps (IWAs), allows an app to embed and manipulate arbitrary content.
Please see https://github.com/WICG/controlled-frame for details.
Setting the policy to 1 or leaving it unset allows Isolated Web App origins to use the Controlled Frame.
Setting the policy to 2 blocks Isolated Web App origins from using the Controlled Frame.
example_value: 1
features:
dynamic_refresh: true
per_profile: true
supported_on:
- chrome_os:134-
future_on:
- chrome.*
items:
- caption: Allow Isolated Web App origins to use the Controlled Frame
name: AllowControlledFrame
value: 1
- caption: Do not allow Isolated Web App origins to use the Controlled Frame
name: BlockControlledFrame
value: 2
owners:
- file://chrome/browser/controlled_frame/OWNERS
schema:
enum:
- 1
- 2
type: integer
tags: []
type: int-enum
@@ -11,6 +11,7 @@ desc: |-
example_value:
- www.example.com
- '[*.]example.edu'
deprecated: true
features:
dynamic_refresh: true
per_profile: true
@@ -0,0 +1,52 @@
caption: Choose whether Blob URLs are partitioned during fetching and navigations
default: true
desc: |-
This policy controls whether Blob URLs are partitioned during fetching and navigation.
If this policy is set to Enabled or not set, Blob URLs will be partitioned.
If this policy is set to Disabled, Blob URLs won't be partitioned.
If storage partitioning is disabled for a given top-level origin by either
<ph name="THIRD_PARTY_STORAGE_PARTITIONING_BLOCKED_FOR_ORIGINS_POLICY_NAME">ThirdPartyStoragePartitioningBlockedForOrigins</ph>
or <ph name="DEFAULT_THIRD_PARTY_STORAGE_PARTITIONING_SETTING_POLICY_NAME">DefaultThirdPartyStoragePartitioningSetting</ph>,
then Blob URLs will also not be partitioned.
If you must use the policy, please file a bug on crbug.com explaining your
use case and CC {janiceliu, awillia}@chromium.org. The policy is scheduled to
be offered through <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>
version 138, after which the old implementation will be removed.
NOTE: Only newly-started renderer processes will reflect changes to this
policy while the browser is running.
For detailed information on third-party storage partitioning, please see https://developers.google.com/privacy-sandbox/cookies/storage-partitioning.
example_value: false
features:
dynamic_refresh: true
per_profile: true
future_on:
- chrome.*
- chrome_os
- android
items:
- caption: Partition Blob URLs during fetching and navigation.
value: true
- caption: Do not partition Blob URLs during fetching and navigation.
value: false
owners:
- awillia@chromium.org
- janiceliu@chromium.org
- potassium-katabolism@google.com
schema:
type: boolean
tags: []
type: main
@@ -96,6 +96,12 @@ DirectSocketsSettings:
- DefaultDirectSocketsPrivateNetworkAccessSetting
- DirectSocketsPrivateNetworkAccessAllowedForUrls
- DirectSocketsPrivateNetworkAccessBlockedForUrls
ControlledFrameSettings:
caption: Controlled Frame settings
policies:
- DefaultControlledFrameSetting
- ControlledFrameAllowedForUrls
- ControlledFrameBlockedForUrls
SmartCardConnectSettings:
caption: Smart Card Connect settings
policies:
@@ -1,8 +1,8 @@
caption: Configure when the <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph> Content Transfer tool is available
caption: Configure when the <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph> Content transfer tool is available
desc: |-
This policy enables the Content Transfer app for managed users. The Content Transfer app helps users transfer their data from their managed account to a consumer account.
This policy enables the Content transfer app for managed users. The Content transfer app helps users transfer their data from their managed account to a consumer account.
If <ph name="CONTENT_TRANSFER_ENABLEMENT_STATUS_IS_ENABLED_VALUE">is_enabled</ph> is set to <ph name="CONTENT_TRANSFER_ENABLEMENT_STATUS_IS_ENABLED_VALUE_TRUE">true</ph>, the Content Transfer app will be shown on and between the start and end dates according to the local time.
If <ph name="CONTENT_TRANSFER_ENABLEMENT_STATUS_IS_ENABLED_VALUE">is_enabled</ph> is set to <ph name="CONTENT_TRANSFER_ENABLEMENT_STATUS_IS_ENABLED_VALUE_TRUE">true</ph>, the Content transfer app will be shown on and between the start and end dates according to the local time.
If <ph name="CONTENT_TRANSFER_ENABLEMENT_STATUS_IS_ENABLED_VALUE">is_enabled</ph> is set to <ph name="CONTENT_TRANSFER_ENABLEMENT_STATUS_IS_ENABLED_VALUE_FALSE">false</ph> or unset, the app will not be shown.
@@ -10,9 +10,9 @@ desc: |-
If <ph name="CONTENT_TRANSFER_ENABLEMENT_STATUS_END_DATE_VALUE">end_date</ph> is unset, then the app is shown indefinitely from the start date.
If both <ph name="CONTENT_TRANSFER_ENABLEMENT_STATUS_START_DATE_VALUE">start_date</ph> and <ph name="CONTENT_TRANSFER_ENABLEMENT_STATUS_END_DATE_VALUE">end_date</ph> are unset, the app is shown indefinitely. If the start and end dates are invalid, then the Content Transfer app will not be shown. This includes if the provided dates are non-existent or the end date is before the start date.
If both <ph name="CONTENT_TRANSFER_ENABLEMENT_STATUS_START_DATE_VALUE">start_date</ph> and <ph name="CONTENT_TRANSFER_ENABLEMENT_STATUS_END_DATE_VALUE">end_date</ph> are unset, the app is shown indefinitely. If the start and end dates are invalid, then the Content transfer app will not be shown. This includes if the provided dates are non-existent or the end date is before the start date.
Data transfer with Takeout also needs to be enabled in order for the Content Transfer app to work properly. See https://support.google.com/a/answer/6364687 for additional information.
Data transfer with Takeout also needs to be enabled in order for the Content transfer app to work properly. See https://support.google.com/a/answer/6364687 for additional information.
example_value:
is_enabled: true
start_date:
@@ -1,13 +1,17 @@
caption: Settings for Autofill Prediction Settings
desc: |-
Enables Autofill Prediction Settings.
Enables Autofill Prediction Settings.
0 = Enable the feature for users, and send relevant data to Google to help train or improve AI models. Relevant data may include prompts, inputs, outputs, and source materials, depending on the feature. It may be reviewed by humans for the sole purpose of improving AI models. 0 is the default value, except when noted below.
0 = Allow the feature to be used, while allowing Google to use relevant data to improve its AI models. Relevant data may include prompts, inputs, outputs, source materials, and written feedback, depending on the feature. It may also be reviewed by humans to improve AI models. 0 is the default value, except when noted below.
1 = Enable the feature for users, but do not send data to Google to train or improve AI models. 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
1 = Allow the feature to be used, but does not allow Google to improve models using users' content (including prompts, inputs, outputs, source materials, and written feedback). 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
2 = Disable the feature.
2 = Do not allow the feature.
If the policy is unset, its behavior is determined by the <ph name="GEN_AI_DEFAULT_SETTINGS_POLICY_NAME">GenAiDefaultSettings</ph> policy.
For more information on data handling for generative AI features, please see https://support.google.com/chrome/a?p=generative_ai_settings.
default: 0
example_value: 2
@@ -25,7 +29,7 @@ items:
name: Disabled
value: 2
owners:
- file://components/autofill_prediction_improvements/OWNERS
- file://components/autofill_ai/OWNERS
- file://components/optimization_guide/OWNERS
schema:
enum:
@@ -3,11 +3,13 @@ caption: Settings for Create Themes with AI
desc: |-
Create Themes with AI lets users create custom themes/wallpapers by preselecting from a list of options.
0 = Enable the feature for users, and send relevant data to Google to help train or improve AI models. Relevant data may include prompts, inputs, outputs, and source materials, depending on the feature. It may be reviewed by humans for the sole purpose of improving AI models. 0 is the default value, except when noted below.
0 = Allow the feature to be used, while allowing Google to use relevant data to improve its AI models. Relevant data may include prompts, inputs, outputs, source materials, and written feedback, depending on the feature. It may also be reviewed by humans to improve AI models. 0 is the default value, except when noted below.
1 = Enable the feature for users, but do not send data to Google to train or improve AI models. 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
1 = Allow the feature to be used, but does not allow Google to improve models using users' content (including prompts, inputs, outputs, source materials, and written feedback). 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
2 = Disable the feature.
2 = Do not allow the feature.
If the policy is unset, its behavior is determined by the <ph name="GEN_AI_DEFAULT_SETTINGS_POLICY_NAME">GenAiDefaultSettings</ph> policy.
For more information on data handling for generative AI features, please see https://support.google.com/chrome/a?p=generative_ai_settings.
default: 0
@@ -3,17 +3,21 @@ caption: Settings for DevTools Generative AI Features
desc: |-
These features in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>'s DevTools employ generative AI models to provide additional debugging information. To use these features, <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> has to collect data such as error messages, stack traces, code snippets, and network requests and send them to a server owned by Google, which runs a generative AI model. Response body or authentication and cookie headers in network requests are not included in the data sent to the server.
0 = Enable the feature for users, and send relevant data to Google to help train or improve AI models. Relevant data may include prompts, inputs, outputs, and source materials, depending on the feature. It may be reviewed by humans for the sole purpose of improving AI models. 0 is the default value, except when noted below.
0 = Allow the feature to be used, while allowing Google to use relevant data to improve its AI models. Relevant data may include prompts, inputs, outputs, source materials, and written feedback, depending on the feature. It may also be reviewed by humans to improve AI models. 0 is the default value, except when noted below.
1 = Enable the feature for users, but do not send data to Google to train or improve AI models. 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
1 = Allow the feature to be used, but does not allow Google to improve models using users' content (including prompts, inputs, outputs, source materials, and written feedback). 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
2 = Disable the feature.
2 = Do not allow the feature.
If the policy is unset, its behavior is determined by the <ph name="GEN_AI_DEFAULT_SETTINGS_POLICY_NAME">GenAiDefaultSettings</ph> policy.
DevTools Generative AI features include:
- Console Insights: explains console messages and offers suggestions on how to fix console errors.
- AI assistance: get help with understanding CSS styles (since version 131), network requests, performance, and files (all since version 132).
For more information on data handling for generative AI features, please see https://support.google.com/chrome/a?p=generative_ai_settings.
default: 0
example_value: 2
features:
@@ -2,11 +2,15 @@ caption: Settings for Generative AI Photo Editing feature
desc: |-
This policy controls the settings of the Generative AI Photo Editing feature for <ph name="PRODUCT_OS_NAME">$1<ex>Google ChromeOS</ex></ph>.
0 = Enable the feature for users, and send relevant data to Google to help train or improve AI models. Relevant data may include prompts, inputs, outputs, and source materials, depending on the feature. It may be reviewed by humans for the sole purpose of improving AI models. 0 is the default value, except when noted below.
0 = Allow the feature to be used, while allowing Google to use relevant data to improve its AI models. Relevant data may include prompts, inputs, outputs, source materials, and written feedback, depending on the feature. It may also be reviewed by humans to improve AI models. 0 is the default value, except when noted below.
1 = Enable the feature for users, but do not send data to Google to train or improve AI models. 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
1 = Allow the feature to be used, but does not allow Google to improve models using users' content (including prompts, inputs, outputs, source materials, and written feedback). 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
2 = Disable the feature.
2 = Do not allow the feature.
If the policy is unset, its behavior is determined by the <ph name="GEN_AI_DEFAULT_SETTINGS_POLICY_NAME">GenAiDefaultSettings</ph> policy.
For more information on data handling for generative AI features, please see https://support.google.com/chrome/a?p=generative_ai_settings.
default: 0
example_value: 2
@@ -2,11 +2,13 @@ caption: Settings for Generative AI VC Background feature
desc: |-
Generative AI VC Background allows users to self-express using generative AI features to create personalized video conferencing backgrounds in <ph name="PRODUCT_OS_NAME">$1<ex>Google ChromeOS</ex></ph>.
0 = Enable the feature for users, and send relevant data to Google to help train or improve AI models. Relevant data may include prompts, inputs, outputs, and source materials, depending on the feature. It may be reviewed by humans for the sole purpose of improving AI models. 0 is the default value, except when noted below.
0 = Allow the feature to be used, while allowing Google to use relevant data to improve its AI models. Relevant data may include prompts, inputs, outputs, source materials, and written feedback, depending on the feature. It may also be reviewed by humans to improve AI models. 0 is the default value, except when noted below.
1 = Enable the feature for users, but do not send data to Google to train or improve AI models. 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
1 = Allow the feature to be used, but does not allow Google to improve models using users' content (including prompts, inputs, outputs, source materials, and written feedback). 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
2 = Disable the feature.
2 = Do not allow the feature.
If the policy is unset, its behavior is determined by the <ph name="GEN_AI_DEFAULT_SETTINGS_POLICY_NAME">GenAiDefaultSettings</ph> policy.
For more information on data handling for generative AI features, please see https://support.google.com/chrome/a?p=generative_ai_settings.
default: 0
@@ -2,11 +2,13 @@ caption: Settings for Generative AI Wallpaper feature
desc: |-
Generative AI Wallpaper allows users to self-express using generative AI features to create personalized wallpapers in <ph name="PRODUCT_OS_NAME">$1<ex>Google ChromeOS</ex></ph>.
0 = Enable the feature for users, and send relevant data to Google to help train or improve AI models. Relevant data may include prompts, inputs, outputs, and source materials, depending on the feature. It may be reviewed by humans for the sole purpose of improving AI models. 0 is the default value, except when noted below.
0 = Allow the feature to be used, while allowing Google to use relevant data to improve its AI models. Relevant data may include prompts, inputs, outputs, source materials, and written feedback, depending on the feature. It may also be reviewed by humans to improve AI models. 0 is the default value, except when noted below.
1 = Enable the feature for users, but do not send data to Google to train or improve AI models. 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
1 = Allow the feature to be used, but does not allow Google to improve models using users' content (including prompts, inputs, outputs, source materials, and written feedback). 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
2 = Disable the feature.
2 = Do not allow the feature.
If the policy is unset, its behavior is determined by the <ph name="GEN_AI_DEFAULT_SETTINGS_POLICY_NAME">GenAiDefaultSettings</ph> policy.
For more information on data handling for generative AI features, please see https://support.google.com/chrome/a?p=generative_ai_settings.
default: 0
@@ -3,15 +3,15 @@ caption: Set the default policy value for <ph name="PRODUCT_NAME">$1<ex>Google C
desc: |-
This policy defines the default setting for all covered generative AI features. For example, if this policy is set to value 1, then 1 will be the default setting for all covered generative AI features. It will not impact any manually set policy values. See https://support.google.com/chrome/a?p=generative_ai_settings for the list of covered features.
0 = Allows the feature to be used, while allowing Google to use relevant data to improve its AI models. Relevant data may include prompts, inputs, outputs, source materials, and written feedback, depending on the feature. It may also be reviewed by humans to improve AI models. 0 is the default value, except when noted below.
0 = Allow the feature to be used, while allowing Google to use relevant data to improve its AI models. Relevant data may include prompts, inputs, outputs, source materials, and written feedback, depending on the feature. It may also be reviewed by humans to improve AI models. 0 is the default value, except when noted below.
1 = Allows the feature to be used, but does not allow Google to improve models using users' content (including prompts, inputs, outputs, source materials, and written feedback). 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
1 = Allow the feature to be used, but does not allow Google to improve models using users' content (including prompts, inputs, outputs, source materials, and written feedback). 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
2 = Disable the feature.
2 = Do not allow the feature.
If a covered feature does not have an equivalent policy value, the closest higher value will be used. Please review documentation for that feature for more details about how it interacts with values in this policy.
For more information on data handling for generative AI features, please see https://support.google.com/chrome/a?p=generative_ai_settings
For more information on data handling for generative AI features, please see https://support.google.com/chrome/a?p=generative_ai_settings.
default: 0
default_for_enterprise_users: 1
@@ -5,11 +5,15 @@ desc: |-
There is no user setting to control this feature, it is generally made available to all users with Google as their default search engine unless disabled by this policy.
0 = Enable the feature for users, and send relevant data to Google to help train or improve AI models. Relevant data may include prompts, inputs, outputs, and source materials, depending on the feature. It may be reviewed by humans for the sole purpose of improving AI models. 0 is the default value, except when noted below.
0 = Allow the feature to be used, while allowing Google to use relevant data to improve its AI models. Relevant data may include prompts, inputs, outputs, source materials, and written feedback, depending on the feature. It may also be reviewed by humans to improve AI models. 0 is the default value, except when noted below.
1 = Enable the feature for users, but do not send data to Google to train or improve AI models. 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
1 = Allow the feature to be used, but does not allow Google to improve models using users' content (including prompts, inputs, outputs, source materials, and written feedback). 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
2 = Disable the feature.
2 = Do not allow the feature.
If the policy is unset, its behavior is determined by the <ph name="GEN_AI_DEFAULT_SETTINGS_POLICY_NAME">GenAiDefaultSettings</ph> policy.
For more information on data handling for generative AI features, please see https://support.google.com/chrome/a?p=generative_ai_settings.
default: 0
example_value: 2
@@ -2,11 +2,15 @@ caption: Settings for Help Me Read feature
desc: |-
This policy controls the settings of the Help Me Read feature for <ph name="PRODUCT_OS_NAME">$1<ex>Google ChromeOS</ex></ph>.
0 = Enable the feature for users, and send relevant data to Google to help train or improve AI models. Relevant data may include prompts, inputs, outputs, and source materials, depending on the feature. It may be reviewed by humans for the sole purpose of improving AI models. 0 is the default value, except when noted below.
0 = Allow the feature to be used, while allowing Google to use relevant data to improve its AI models. Relevant data may include prompts, inputs, outputs, source materials, and written feedback, depending on the feature. It may also be reviewed by humans to improve AI models. 0 is the default value, except when noted below.
1 = Enable the feature for users, but do not send data to Google to train or improve AI models. 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
1 = Allow the feature to be used, but does not allow Google to improve models using users' content (including prompts, inputs, outputs, source materials, and written feedback). 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
2 = Disable the feature.
2 = Do not allow the feature.
If the policy is unset, its behavior is determined by the <ph name="GEN_AI_DEFAULT_SETTINGS_POLICY_NAME">GenAiDefaultSettings</ph> policy.
For more information on data handling for generative AI features, please see https://support.google.com/chrome/a?p=generative_ai_settings.
default: 0
example_value: 2
@@ -3,11 +3,13 @@ caption: Settings for Help Me Write
desc: |-
Help Me Write is an AI-based writing assistant for short-form content on the web. Suggested content is based on prompts entered by the user and the content of the web page.
0 = Enable the feature for users, and send relevant data to Google to help train or improve AI models. Relevant data may include prompts, inputs, outputs, and source materials, depending on the feature. It may be reviewed by humans for the sole purpose of improving AI models. 0 is the default value, except when noted below.
0 = Allow the feature to be used, while allowing Google to use relevant data to improve its AI models. Relevant data may include prompts, inputs, outputs, source materials, and written feedback, depending on the feature. It may also be reviewed by humans to improve AI models. 0 is the default value, except when noted below.
1 = Enable the feature for users, but do not send data to Google to train or improve AI models. 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
1 = Allow the feature to be used, but does not allow Google to improve models using users' content (including prompts, inputs, outputs, source materials, and written feedback). 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
2 = Disable the feature.
2 = Do not allow the feature.
If the policy is unset, its behavior is determined by the <ph name="GEN_AI_DEFAULT_SETTINGS_POLICY_NAME">GenAiDefaultSettings</ph> policy.
For more information on data handling for generative AI features, please see https://support.google.com/chrome/a?p=generative_ai_settings.
default: 0
@@ -3,13 +3,13 @@ caption: Settings for AI-powered History Search
desc: |-
AI History Search is a feature that allows users to search their browsing history and receive generated answers based on page contents and not just the page title and URL.
0 = Enable the feature for users, and send relevant data to Google to help train or improve AI models. Relevant data may include prompts, inputs, outputs, and source materials, depending on the feature. It may be reviewed by humans for the sole purpose of improving AI models. 0 is the default value, except when noted below.
0 = Allow the feature to be used, while allowing Google to use relevant data to improve its AI models. Relevant data may include prompts, inputs, outputs, source materials, and written feedback, depending on the feature. It may also be reviewed by humans to improve AI models. 0 is the default value, except when noted below.
1 = Enable the feature for users, but do not send data to Google to train or improve AI models. 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
1 = Allow the feature to be used, but does not allow Google to improve models using users' content (including prompts, inputs, outputs, source materials, and written feedback). 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
2 = Disable the feature.
2 = Do not allow the feature.
If the policy is unset, the default behavior is 0 for regular consumer users and 2 for managed users on <ph name="PRODUCT_OS_NAME">$2<ex>Google ChromeOS</ex></ph>.
If the policy is unset, its behavior is determined by the <ph name="GEN_AI_DEFAULT_SETTINGS_POLICY_NAME">GenAiDefaultSettings</ph> policy.
For more information on data handling for generative AI features, please see https://support.google.com/chrome/a?p=generative_ai_settings.
default: 0
@@ -3,11 +3,15 @@ default: 0
desc: |-
Tab Compare is an AI-powered tool for comparing information across a user's tabs. As an example, the feature can be offered to the user when multiple tabs with products in a similar category are open.
0 = Enable the feature for users, and send relevant data to Google to help train or improve AI models. Relevant data may include prompts, inputs, outputs, and source materials, depending on the feature. It may be reviewed by humans for the sole purpose of improving AI models. 0 is the default value, except when noted below.
0 = Allow the feature to be used, while allowing Google to use relevant data to improve its AI models. Relevant data may include prompts, inputs, outputs, source materials, and written feedback, depending on the feature. It may also be reviewed by humans to improve AI models. 0 is the default value, except when noted below.
1 = Enable the feature for users, but do not send data to Google to train or improve AI models. 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
1 = Allow the feature to be used, but does not allow Google to improve models using users' content (including prompts, inputs, outputs, source materials, and written feedback). 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
2 = Disable the feature.
2 = Do not allow the feature.
If the policy is unset, its behavior is determined by the <ph name="GEN_AI_DEFAULT_SETTINGS_POLICY_NAME">GenAiDefaultSettings</ph> policy.
For more information on data handling for generative AI features, please see https://support.google.com/chrome/a?p=generative_ai_settings.
example_value: 2
features:
@@ -3,11 +3,13 @@ caption: Settings for Tab Organizer
desc: |-
Tab Organizer is an AI-based tool that automatically creates tab groups based on a user's open tabs. Suggestions are based on open tabs (but not page content).
0 = Enable the feature for users, and send relevant data to Google to help train or improve AI models. Relevant data may include prompts, inputs, outputs, and source materials, depending on the feature. It may be reviewed by humans for the sole purpose of improving AI models. 0 is the default value, except when noted below.
0 = Allow the feature to be used, while allowing Google to use relevant data to improve its AI models. Relevant data may include prompts, inputs, outputs, source materials, and written feedback, depending on the feature. It may also be reviewed by humans to improve AI models. 0 is the default value, except when noted below.
1 = Enable the feature for users, but do not send data to Google to train or improve AI models. 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
1 = Allow the feature to be used, but does not allow Google to improve models using users' content (including prompts, inputs, outputs, source materials, and written feedback). 1 is the default value for Enterprise users managed by <ph name="GOOGLE_ADMIN_CONSOLE_PRODUCT_NAME">Google Admin console</ph> and for Education accounts managed by <ph name="GOOGLE_WORKSPACE_PRODUCT_NAME">Google Workspace</ph>.
2 = Disable the feature.
2 = Do not allow the feature.
If the policy is unset, its behavior is determined by the <ph name="GEN_AI_DEFAULT_SETTINGS_POLICY_NAME">GenAiDefaultSettings</ph> policy.
For more information on data handling for generative AI features, please see https://support.google.com/chrome/a?p=generative_ai_settings.
default: 0
@@ -0,0 +1,24 @@
caption: External Storage Allowlist
desc: |-
This policy specifies a list of USB storage devices that are exempt from the <ph name="EXTERNAL_STORAGE_DISABLED_POLICY_NAME">ExternalStorageDisabled</ph> and <ph name="EXTERNAL_STORAGE_READ_ONLY_POLICY_NAME">ExternalStorageReadOnly</ph> policies.
Entries are pairs of USB Vendor Identifier and Product Identifier that identify the specific USB device model.
example_value:
- product_id: 24577
vendor_id: 1027
- product_id: 8453
vendor_id: 16700
features:
dynamic_refresh: true
per_profile: true
owners:
- isandrk@chromium.org
schema:
items:
$ref: UsbDeviceId
type: array
future_on:
- chrome_os
tags: []
type: dict
@@ -0,0 +1,32 @@
caption: Control <ph name="GLIC">Glic</ph> access
desc: |-
If this policy is Enabled or not set, users are able to use the
<ph name="GLIC">Glic</ph> feature. Setting this policy to Disabled prevents
users from interacting with <ph name="GLIC">Glic</ph>; the button in the tab
strip is hidden and <ph name="GLIC">Glic</ph> is unavailable via keyboard
shortcut unless enabled in another profile.
owners:
- bokan@chromium.org
- file://chrome/browser/glic/OWNERS
example_value: 0
future_on:
- chrome.*
features:
dynamic_refresh: true
per_profile: true
type: int-enum
schema:
type: integer
enum:
- 0
- 1
items:
- caption: Enable use of <ph name="GLIC">Glic</ph>
name: Enabled
value: 0
- caption: Disable use of <ph name="GLIC">Glic</ph>.
name: Disabled
value: 1
default: 0
tags:
- google-sharing
@@ -11,6 +11,7 @@ supported_on:
- chrome_os:124-
features:
dynamic_refresh: true
internal_only: true
per_profile: false
schema:
type: integer
@@ -9,7 +9,9 @@ desc: |-
Each item can also include these optional fields:
* <ph name="UPDATE_CHANNEL_OPTION">update_channel</ph>: The IWA release/update channel name. If not set, "default" is used.
* <ph name="PINNED_VERSION_OPTION">pinned_version</ph>: A specific version to install. The system will attempt to install this version if available on the specified update channel. By default, pinning an IWA to a specific version prevents it from being updated beyond that version. To unpin, remove this field.
* <ph name="ALLOW_DOWNGRADES_OPTION">allow_downgrades</ph>:: Enables installing older versions of the IWA. This requires the `pinned_version` field to be set. If not provided or set to <ph name="FALSE">false</ph> downgrading is disabled for that IWA.
example_value:
- update_manifest_url: https://example.com/isolated_web_app/update_manifest.json
@@ -22,6 +24,8 @@ features:
per_profile: true
supported_on:
- chrome_os:128-
future_on:
- chrome.*
owners:
- file://chrome/browser/web_applications/isolated_web_apps/OWNERS
- iwa-team@google.com
@@ -1,8 +1,12 @@
caption: Show Outlook Calendar card on the New Tab Page
caption: Show Outlook Calendar card on the New Tab Page (Beta)
default: false
desc: |- # TODO(crbug.com/376287682): insert HC article link
This is a beta feature.
This policy controls the visibility of the Outlook Card on the New Tab Page. The card will only be displayed on the New Tab Page if the policy is enabled and your organization authorized the usage of the Outlook Calendar data in the browser.
Outlook data will not be stored by the browser.
The Outlook card shows the next calendar event, along with a glanceable look at the rest of the day's meetings. It aims to address the issue of context switching and enhance productivity by giving users a shortcut to their next meeting.
The Microsoft Outlook card will require additional admin configuration. For detailed information on connecting the Chrome New Tab Page Card to Outlook, please see help article.
@@ -12,9 +16,6 @@ example_value: false
features:
dynamic_refresh: true
per_profile: true
future_on:
- chrome.*
- chrome_os
items:
- caption: Enable NTP Outlook Calendar Card
value: true
@@ -27,5 +28,8 @@ owners:
- ftirelo@chromium.org
schema:
type: boolean
supported_on:
- chrome.*:134-
- chrome_os:134-
tags: []
type: main
@@ -1,24 +1,25 @@
caption: Show Sharepoint File Card on the New Tab Page
caption: Show SharePoint and OneDrive File Card on the New Tab Page (Beta)
default: false
desc: |- # TODO(crbug.com/376287682): insert HC article link
This policy controls the visibility of the Sharepoint File Card on the New Tab Page. The card will only be displayed on the New Tab Page if the policy is enabled and your organization authorized the usage of the Sharepoint File data in the browser.
This is a beta feature.
The Sharepoint Files recommendation card shows a list of recommended files. It aims to address the issue of context switching and enhance productivity by giving users a shortcut to their most important documents.
This policy controls the visibility of the SharePoint and OneDrive File Card on the New Tab Page. The card will only be displayed on the New Tab Page if the policy is enabled and your organization authorized the usage of the SharePoint and OneDrive File data in the browser.
The Microsoft Sharepoint card will require additional admin configuration. For detailed information on connecting the Chrome New Tab Page Card to Sharepoint, please see help article.
SharePoint and OneDrive data will not be stored by the browser.
If the <ph name="NTPCARDSVISIBLE">NTPCardsVisible</ph> is disabled, the Sharepoint Card will not be shown. If <ph name="NTPCARDSVISIBLE">NTPCardsVisible</ph> is enabled, the Sharepoint card will be shown if this policy is also enabled and there is data to be shown. If <ph name="NTPCARDSVISIBLE">NTPCardsVisible</ph> is unset, the Sharepoint card will be shown if this policy is also enabled, the user has the card enabled in Customize Chrome, and there is data to be shown.
The SharePoint and OneDrive Files recommendation card shows a list of recommended files. It aims to address the issue of context switching and enhance productivity by giving users a shortcut to their most important documents.
The Microsoft SharePoint and OneDrive card will require additional admin configuration. For detailed information on connecting the Chrome New Tab Page Card to Sharepoint, please see help article.
If the <ph name="NTPCARDSVISIBLE">NTPCardsVisible</ph> is disabled, the SharePoint and OneDrive Card will not be shown. If <ph name="NTPCARDSVISIBLE">NTPCardsVisible</ph> is enabled, the SharePoint and OneDrive card will be shown if this policy is also enabled and there is data to be shown. If <ph name="NTPCARDSVISIBLE">NTPCardsVisible</ph> is unset, the SharePoint and OneDrive card will be shown if this policy is also enabled, the user has the card enabled in Customize Chrome, and there is data to be shown.
example_value: false
features:
dynamic_refresh: true
per_profile: true
future_on:
- chrome.*
- chrome_os
items:
- caption: Enable NTP Sharepoint File Card
- caption: Enable NTP SharePoint and OneDrive File Card
value: true
- caption: Disable NTP Sharepoint File Card
- caption: Disable NTP SharePoint and OneDrive File Card
value: false
owners:
- rtatum@google.com
@@ -27,5 +28,8 @@ owners:
- ftirelo@chromium.org
schema:
type: boolean
supported_on:
- chrome.*:134-
- chrome_os:134-
tags: []
type: main
@@ -1,6 +1,6 @@
caption: Origins or hostname patterns for which restrictions on insecure origins should not apply
desc: |-
Setting the policy specifies a list of origins (URLs) or hostname patterns (such as *.example.com) for which security restrictions on insecure origins won't apply. Organizations can specify origins for legacy applications that can't deploy TLS or set up a staging server for internal web development, so developers can test out features requiring secure contexts without having to deploy TLS on the staging server. This policy also prevents the origin from being labeled "Not Secure" in the address bar.
Setting the policy specifies a list of origins (URLs) or hostname patterns (such as *.example.com) for which security restrictions on insecure origins won't apply. Patterns are only accepted for hostnames; URLs/origins with schemes must be exact strings. Organizations can specify origins for legacy applications that can't deploy TLS or set up a staging server for internal web development, so developers can test out features requiring secure contexts without having to deploy TLS on the staging server. This policy also prevents the origin from being labeled "Not Secure" in the address bar.
Setting a list of URLs in this policy amounts to setting the command-line flag --unsafely-treat-insecure-origin-as-secure to a comma-separated list of the same URLs. The policy overrides the command-line flag and UnsafelyTreatInsecureOriginAsSecure, if present.
@@ -0,0 +1,32 @@
owners:
- hmare@google.com
- cbe-device-trust-eng@google.com
- file://components/enterprise/client_certificates/OWNERS
caption: Enables the provisioning of client certificates for managed browsers
desc: |-
Setting this policy to <ph name="PROVISION_MANAGED_CLIENT_CERTIFICATE_FOR_BROWSER_ENABLED">Enabled</ph> (value 1) will make the <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> request a client certificate from the device management server for a managed browser session. This certificate will be made available for, e.g., mTLS connections.
Setting this policy to <ph name="PROVISION_MANAGED_CLIENT_CERTIFICATE_FOR_BROWSER_DISABLED">Disabled</ph> (value 0), or leaving unset will prevent <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> from requesting the client certificate. If a browser's managed client certificate had already been provisioned, due to this policy being enabled before, it will not be deleted, but it won't be available for mTLS connections and won't be renewed when it expires.
future_on:
- chrome.*
features:
dynamic_refresh: true
per_profile: false
cloud_only: true
type: int-enum
schema:
type: integer
enum:
- 0
- 1
items:
- caption: Disable client certificate provisioning for browsers
name: Disabled
value: 0
- caption: Enable client certificate provisioning for browsers
name: Enabled
value: 1
default: 0
example_value: 0
tags: []
@@ -0,0 +1,35 @@
caption: Allow ServiceWorker to control srcdoc iframes
desc: |-
https://github.com/w3c/ServiceWorker/issues/765 asks srcdoc iframe with
the "allow-same-origin" sandbox attribute to be under ServiceWorker control.
Setting the policy to Enabled or leaving it unset means
<ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> makes srcdoc iframes
with "allow-same-origin" sandbox attributes to be under ServiceWorker control.
Setting the policy to Disabled leaves the srcdoc iframe not controlled by
ServiceWorker.
This policy is intended to be temporary and will be removed in 2026.
default: true
example_value: true
features:
dynamic_refresh: false
per_profile: true
items:
- caption: ServiceWorker can control srcdoc iframes
value: true
- caption: ServiceWorker won't control srcdoc iframes
value: false
owners:
- yyanagisawa@chromium.org
- file://content/browser/worker_host/OWNERS
schema:
type: boolean
supported_on:
- android:134-
- chrome.*:134-
- chrome_os:134-
- fuchsia:134-
tags: []
type: main
@@ -0,0 +1,32 @@
caption: Allowed Origins for Proxied WebAuthn Requests from Remote Desktop Applications.
desc: |-
A list of origins of remote desktop client apps that may execute WebAuthn API
requests that originate from a browsing session on a remote host.
Any origin configured in this policy can make WebAuthn requests for Relying
Party IDs (RP IDs) that it would normally not allowed to be able to claim.
Only valid HTTPS origins are allowed. Wildcards are not supported.
Any invalid entries are ignored.
features:
dynamic_refresh: true
per_profile: true
platform_only: true
future_on:
- chrome.*
- chrome_os
example_value:
- https://remotedesktop.google.com
- https://vdi.corp.example
- https://server:8080/
owners:
- natiahlyi@google.com
- file://device/fido/OWNERS
schema:
items:
type: string
type: array
tags:
- full-admin-access
type: list
@@ -26,5 +26,6 @@ schema:
supported_on:
- chrome.*:132-
- chrome_os:132-
- ios:134-
tags: []
type: main
@@ -37,7 +37,7 @@ schema:
- 2
- 3
type: integer
future_on:
- chrome_os
supported_on:
- chrome_os:134-
tags: []
type: int-enum
@@ -19,6 +19,7 @@ desc: |-
supported_on:
- chrome.*:119-
- ios:134-
features:
cloud_only: true
@@ -1,3 +1,3 @@
caption: Turn SkyVault on or off
caption: Local user data storage
desc: |-
Configure policies to control whether user data is allowed on the device, and whether existing data should be uploaded to the cloud.
@@ -1,5 +1,5 @@
SkyVaultSettings:
caption: SkyVault (all data in cloud) settings
caption: Local user data storage settings
policies:
- LocalUserFilesAllowed
- LocalUserFilesMigrationDestination
@@ -6,6 +6,7 @@
#include <stddef.h>
#include <algorithm>
#include <cmath>
#include <memory>
#include <optional>
@@ -16,6 +17,7 @@
#include <utility>
#include <vector>
#include "base/auto_reset.h"
#include "base/base_switches.h"
#include "base/check_op.h"
#include "base/command_line.h"
@@ -38,7 +40,6 @@
#include "base/no_destructor.h"
#include "base/observer_list.h"
#include "base/process/process.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -49,11 +50,12 @@
#include "base/trace_event/optional_trace_event.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "cc/input/browser_controls_offset_tags_info.h"
#include "cc/input/browser_controls_offset_tag_modifications.h"
#include "components/attribution_reporting/features.h"
#include "components/download/public/common/download_stats.h"
#include "components/input/cursor_manager.h"
#include "components/input/render_widget_host_input_event_router.h"
#include "components/input/switches.h"
#include "components/input/utils.h"
#include "components/url_formatter/url_formatter.h"
#include "components/viz/common/features.h"
@@ -124,6 +126,7 @@
#include "content/browser/tpcd_heuristics/opener_heuristic_tab_helper.h"
#include "content/browser/tpcd_heuristics/redirect_heuristic_tab_helper.h"
#include "content/browser/wake_lock/wake_lock_context_host.h"
#include "content/browser/web_contents/accessibility_mode_policy.h"
#include "content/browser/web_contents/java_script_dialog_commit_deferring_condition.h"
#include "content/browser/web_contents/partitioned_popins_controller.h"
#include "content/browser/web_contents/slow_web_preference_cache.h"
@@ -189,6 +192,7 @@
#include "third_party/blink/public/common/switches.h"
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
#include "third_party/blink/public/common/widget/constants.h"
#include "third_party/blink/public/mojom/frame/deferred_fetch_policy.mojom-shared.h"
#include "third_party/blink/public/mojom/frame/frame.mojom.h"
#include "third_party/blink/public/mojom/frame/fullscreen.mojom.h"
#include "third_party/blink/public/mojom/image_downloader/image_downloader.mojom.h"
@@ -1268,9 +1272,6 @@ WebContentsImpl::WebContentsImpl(BrowserContext* browser_context)
zoom_scroll_remainder_(0),
force_disable_overscroll_content_(false),
last_dialog_suppressed_(false),
accessibility_mode_(
BrowserAccessibilityState::GetInstance()
->GetAccessibilityModeForBrowserContext(browser_context)),
audio_stream_monitor_(this),
media_web_contents_observer_(
std::make_unique<MediaWebContentsObserver>(this)),
@@ -1410,34 +1411,6 @@ WebContentsImpl::~WebContentsImpl() {
// prerendering. Shutdown them by destructing PrerenderHostRegistry.
prerender_host_registry_.reset();
// For historical reasons, it is the requestor's responsibility to reset
// `PrefetchContainer`s that were created by the requestor (= `this`) but have
// not yet started prefetching (Otherwise, they will stay alive forever in
// `PrefetchService`).
// TODO(crbug.com/40946257): Refactor to handle this case better.
if (base::FeatureList::IsEnabled(
features::kPrefetchBrowserInitiatedTriggers)) {
PrefetchService* prefetch_service =
BrowserContextImpl::From(GetBrowserContext())->GetPrefetchService();
if (prefetch_service) {
for (const auto& prefetch_container : prefetch_containers_) {
if (prefetch_container) {
switch (prefetch_container->GetLoadState()) {
case PrefetchContainer::LoadState::kNotStarted:
case PrefetchContainer::LoadState::kEligible:
case PrefetchContainer::LoadState::kFailedIneligible:
case PrefetchContainer::LoadState::kFailedHeldback:
prefetch_service->ResetPrefetch(prefetch_container);
break;
case PrefetchContainer::LoadState::kStarted:
break;
}
}
}
}
prefetch_containers_.clear();
}
#if BUILDFLAG(ENABLE_PPAPI)
// Call this before WebContentsDestroyed() is broadcasted since
// AudioFocusManager will be destroyed after that.
@@ -1501,7 +1474,7 @@ std::unique_ptr<WebContentsImpl> WebContentsImpl::CreateWithOpener(
{opener_flags,
{} /* container_policy */,
{} /* required_document_policy */,
blink::FramePolicy::DeferredFetchPolicy::kDisabled});
blink::mojom::DeferredFetchPolicy::kDisabled});
}
new_root->SetInitialPopupURL(params.initial_popup_url);
new_root->SetPopupCreatorOrigin(opener_rfh->GetLastCommittedOrigin());
@@ -2053,7 +2026,29 @@ ui::ColorProviderKey::ColorMode WebContentsImpl::GetColorMode() const {
return source->GetColorMode();
}
void WebContentsImpl::SetAccessibilityMode(ui::AXMode mode) {
void WebContentsImpl::SetAccessibilityMode(ui::AXMode new_ax_mode) {
// Create the policy lazily so that the client is only enrolled into an arm
// of a trial if accessibility is enabled.
if (!accessibility_mode_policy_) {
// Exit early if the first call is a no-op, since creating the policy in
// this case would skew analysis of any trials.
if (new_ax_mode.is_mode_off()) {
return;
}
accessibility_mode_policy_ = AccessibilityModePolicy::Create(*this);
}
// Unretained is safe here because this owns the policy.
accessibility_mode_policy_->SetAccessibilityMode(base::BindRepeating(
[](WebContentsImpl* web_contents, ui::AXMode ax_mode, bool apply) {
if (web_contents) {
web_contents->SetAccessibilityModeImpl(apply ? ax_mode
: ui::AXMode{});
}
},
base::Unretained(this), new_ax_mode));
}
void WebContentsImpl::SetAccessibilityModeImpl(ui::AXMode mode) {
OPTIONAL_TRACE_EVENT2("content", "WebContentsImpl::SetAccessibilityMode",
"mode", mode.ToString(), "previous_mode",
accessibility_mode_.ToString());
@@ -2226,8 +2221,13 @@ FindRequestManager* WebContentsImpl::GetFindRequestManagerForTesting() {
}
void WebContentsImpl::UpdateZoom() {
UpdateZoom(GetPrimaryMainFrame()->GetGlobalId());
}
void WebContentsImpl::UpdateZoom(const GlobalRenderFrameHostId& rfh_id) {
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::UpdateZoom");
RenderWidgetHostImpl* rwh = GetRenderViewHost()->GetWidget();
RenderFrameHostImpl* rfh = RenderFrameHostImpl::FromID(rfh_id);
RenderWidgetHostImpl* rwh = rfh->GetRenderWidgetHost();
if (rwh->GetView()) {
rwh->SynchronizeVisualProperties();
}
@@ -2235,9 +2235,15 @@ void WebContentsImpl::UpdateZoom() {
void WebContentsImpl::UpdateZoomIfNecessary(const std::string& scheme,
const std::string& host) {
UpdateZoomIfNecessary(scheme, host, GetPrimaryMainFrame());
}
void WebContentsImpl::UpdateZoomIfNecessary(const std::string& scheme,
const std::string& host,
RenderFrameHostImpl* rfh) {
OPTIONAL_TRACE_EVENT2("content", "WebContentsImpl::UpdateZoomIfNecessary",
"scheme", scheme, "host", host);
NavigationEntry* entry = GetController().GetLastCommittedEntry();
NavigationEntry* entry = rfh->GetController().GetLastCommittedEntry();
if (!entry) {
return;
}
@@ -2248,7 +2254,7 @@ void WebContentsImpl::UpdateZoomIfNecessary(const std::string& scheme,
return;
}
UpdateZoom();
UpdateZoom(rfh->GetGlobalId());
}
std::vector<WebContentsImpl*> WebContentsImpl::GetWebContentsAndAllInner() {
@@ -2455,8 +2461,8 @@ const std::u16string& WebContentsImpl::GetTitle() {
return GetNavigationEntryForTitle()->GetTitleForDisplay();
}
const std::optional<std::u16string>& WebContentsImpl::GetAppTitle() {
return GetNavigationEntryForTitle()->GetAppTitle();
const std::optional<std::u16string>& WebContentsImpl::GetApplicationTitle() {
return GetNavigationEntryForTitle()->GetApplicationTitle();
}
SiteInstanceImpl* WebContentsImpl::GetSiteInstance() {
@@ -2639,19 +2645,20 @@ bool WebContentsImpl::IsCurrentlyAudible() {
return is_currently_audible_;
}
bool WebContentsImpl::IsCapabilityActive(CapabilityType capability_type) {
bool WebContentsImpl::IsCapabilityActive(
WebContentsCapabilityType capability_type) {
switch (capability_type) {
case CapabilityType::kBluetoothConnected:
case WebContentsCapabilityType::kBluetoothConnected:
return bluetooth_connected_device_count_ > 0;
case CapabilityType::kBluetoothScanning:
case WebContentsCapabilityType::kBluetoothScanning:
return bluetooth_scanning_sessions_count_ > 0;
case CapabilityType::kSerial:
case WebContentsCapabilityType::kSerial:
return serial_active_frame_count_ > 0;
case CapabilityType::kHID:
case WebContentsCapabilityType::kHID:
return hid_active_frame_count_ > 0;
case CapabilityType::kUSB:
case WebContentsCapabilityType::kUSB:
return usb_active_frame_count_ > 0;
case CapabilityType::kGeolocation:
case WebContentsCapabilityType::kGeolocation:
return geolocation_active_frame_count_ > 0;
}
}
@@ -2833,10 +2840,10 @@ void WebContentsImpl::OnAudioStateChanged() {
audio_stream_monitor_.IsCurrentlyAudible() ||
(browser_plugin_embedder_ &&
browser_plugin_embedder_->AreAnyGuestsCurrentlyAudible()) ||
base::ranges::any_of(GetInnerWebContents(),
[](WebContents* inner_contents) {
return inner_contents->IsCurrentlyAudible();
});
std::ranges::any_of(GetInnerWebContents(),
[](WebContents* inner_contents) {
return inner_contents->IsCurrentlyAudible();
});
OPTIONAL_TRACE_EVENT2("content", "WebContentsImpl::OnAudioStateChanged",
"is_currently_audible", is_currently_audible,
"was_audible", is_currently_audible_);
@@ -3362,8 +3369,10 @@ void WebContentsImpl::DidChangeVisibleSecurityState() {
&WebContentsObserver::DidChangeVisibleSecurityState);
}
const blink::web_pref::WebPreferences WebContentsImpl::ComputeWebPreferences() {
const blink::web_pref::WebPreferences WebContentsImpl::ComputeWebPreferences(
RenderFrameHostImpl* main_frame) {
OPTIONAL_TRACE_EVENT0("browser", "WebContentsImpl::ComputeWebPreferences");
CHECK(main_frame->is_main_frame());
blink::web_pref::WebPreferences prefs;
@@ -3540,13 +3549,14 @@ const blink::web_pref::WebPreferences WebContentsImpl::ComputeWebPreferences() {
#endif // BUILDFLAG(IS_ANDROID)
// GuestViews in the same StoragePartition need to find each other's frames.
prefs.renderer_wide_named_frame_lookup = IsGuest();
prefs.renderer_wide_named_frame_lookup =
IsGuest() || main_frame->frame_tree()->is_guest();
if (command_line.HasSwitch(switches::kHideScrollbars)) {
prefs.hide_scrollbars = true;
}
GetContentClient()->browser()->OverrideWebkitPrefs(this, &prefs);
GetContentClient()->browser()->OverrideWebPreferences(
this, *main_frame->GetSiteInstance(), &prefs);
return prefs;
}
@@ -3560,15 +3570,26 @@ void WebContentsImpl::OnWebPreferencesChanged() {
return;
}
updating_web_preferences_ = true;
SetWebPreferences(ComputeWebPreferences());
SetWebPreferences(ComputeWebPreferences(GetPrimaryMainFrame()));
#if BUILDFLAG(IS_ANDROID)
for (FrameTreeNode* node : primary_frame_tree_.Nodes()) {
RenderFrameHostImpl* rfh = node->current_frame_host();
if (rfh->is_local_root()) {
if (auto* rwh = rfh->GetRenderWidgetHost()) {
rwh->SetForceEnableZoom(web_preferences_->force_enable_zoom);
const bool force_enable_zoom_changed =
(force_enable_zoom_ != web_preferences_->force_enable_zoom);
force_enable_zoom_ = web_preferences_->force_enable_zoom;
if (force_enable_zoom_changed) {
std::vector<viz::FrameSinkId> frame_sink_ids;
for (FrameTreeNode* node : primary_frame_tree_.Nodes()) {
RenderFrameHostImpl* rfh = node->current_frame_host();
if (rfh->is_local_root()) {
if (auto* rwh = rfh->GetRenderWidgetHost()) {
rwh->SetForceEnableZoom(force_enable_zoom_);
frame_sink_ids.push_back(rwh->GetFrameSinkId());
}
}
}
// Notify VizCompositor thread of force_enable_zoom state changes.
if (auto* remote = GetRenderInputRouterDelegateRemote()) {
remote->ForceEnableZoomStateChanged(force_enable_zoom_, frame_sink_ids);
}
}
#endif
updating_web_preferences_ = false;
@@ -3665,28 +3686,28 @@ void WebContentsImpl::OnSharedDictionaryAccessed(
void WebContentsImpl::OnDeviceBoundSessionAccessed(
NavigationHandle* navigation,
const net::device_bound_sessions::SessionKey& session) {
const net::device_bound_sessions::SessionAccess& access) {
OPTIONAL_TRACE_EVENT1("content",
"WebContentsImpl::OnDeviceBoundSessionAccessed",
"navigation_handle", navigation);
// Use a variable to select between overloads.
void (WebContentsObserver::*func)(
NavigationHandle*, const net::device_bound_sessions::SessionKey&) =
NavigationHandle*, const net::device_bound_sessions::SessionAccess&) =
&WebContentsObserver::OnDeviceBoundSessionAccessed;
observers_.NotifyObservers(func, navigation, session);
observers_.NotifyObservers(func, navigation, access);
}
void WebContentsImpl::OnDeviceBoundSessionAccessed(
RenderFrameHostImpl* rfh,
const net::device_bound_sessions::SessionKey& session) {
const net::device_bound_sessions::SessionAccess& access) {
OPTIONAL_TRACE_EVENT1("content",
"WebContentsImpl::OnDeviceBoundSessionAccessed",
"render_frame_host", rfh);
// Use a variable to select between overloads.
void (WebContentsObserver::*func)(
RenderFrameHost*, const net::device_bound_sessions::SessionKey&) =
RenderFrameHost*, const net::device_bound_sessions::SessionAccess&) =
&WebContentsObserver::OnDeviceBoundSessionAccessed;
observers_.NotifyObservers(func, rfh, session);
observers_.NotifyObservers(func, rfh, access);
}
void WebContentsImpl::NotifyStorageAccessed(
@@ -3822,6 +3843,11 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
CHECK(render_view_host_delegate_view_);
CHECK(view_.get());
// Set the accessibility mode after the view is created.
SetAccessibilityMode(
BrowserAccessibilityState::GetInstance()
->GetAccessibilityModeForBrowserContext(GetBrowserContext()));
view_->CreateView(params.context);
screen_orientation_provider_ =
@@ -3839,8 +3865,8 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
}
RedirectChainDetector::CreateForWebContents(this);
DIPSWebContentsObserver::MaybeCreateForWebContents(this);
DipsNavigationFlowDetector::CreateForWebContents(this);
BtmWebContentsObserver::MaybeCreateForWebContents(this);
BtmNavigationFlowDetector::CreateForWebContents(this);
RedirectHeuristicTabHelper::CreateForWebContents(this);
OpenerHeuristicTabHelper::CreateForWebContents(this);
@@ -4225,10 +4251,10 @@ bool WebContentsImpl::CanEnterFullscreenMode(
// blocked. Therefore, disqualify it from fullscreen if it or any upstream
// WebContents has an active blocker.
return delegate_ &&
base::ranges::all_of(GetAllOpeningWebContents(this),
[](auto* opener) {
return opener->fullscreen_blocker_count_ == 0;
}) &&
std::ranges::all_of(GetAllOpeningWebContents(this),
[](auto* opener) {
return opener->fullscreen_blocker_count_ == 0;
}) &&
delegate_->CanEnterFullscreenModeForTab(requesting_frame);
}
@@ -4500,6 +4526,18 @@ void WebContentsImpl::UpdateVisibilityAndNotifyPageAndView(
base::BindRepeating(
[](PageVisibilityState page_visibility,
RenderViewHostImpl* render_view_host) {
// If we are a guest frame tree, allow the visibility (ie
// display:none) to override the page visibility.
if (render_view_host->frame_tree()->is_guest()) {
RenderFrameProxyHost* proxy = render_view_host->frame_tree()
->root()
->render_manager()
->GetProxyToOuterDelegate();
if (proxy && proxy->cross_process_frame_connector()->IsHidden()) {
page_visibility = PageVisibilityState::kHidden;
}
}
render_view_host->SetFrameTreeVisibility(page_visibility);
},
page_visibility);
@@ -5382,6 +5420,7 @@ void WebContentsImpl::CreateMediaPlayerHostForRenderFrameHost(
}
void WebContentsImpl::RequestMediaAccessPermission(
RenderFrameHostImpl* render_frame_host,
const MediaStreamRequest& request,
MediaResponseCallback callback) {
OPTIONAL_TRACE_EVENT2("content",
@@ -5389,14 +5428,22 @@ void WebContentsImpl::RequestMediaAccessPermission(
"render_process_id", request.render_process_id,
"render_frame_id", request.render_frame_id);
if (delegate_) {
if (GuestPageHolderImpl* guest =
render_frame_host
? GuestPageHolderImpl::FromRenderFrameHost(*render_frame_host)
: nullptr) {
if (auto* delegate = guest->delegate()) {
delegate->GuestRequestMediaAccessPermission(request, std::move(callback));
return;
}
} else if (delegate_) {
delegate_->RequestMediaAccessPermission(this, request, std::move(callback));
} else {
std::move(callback).Run(
blink::mojom::StreamDevicesSet(),
blink::mojom::MediaStreamRequestResult::FAILED_DUE_TO_SHUTDOWN,
std::unique_ptr<MediaStreamUI>());
return;
}
std::move(callback).Run(
blink::mojom::StreamDevicesSet(),
blink::mojom::MediaStreamRequestResult::FAILED_DUE_TO_SHUTDOWN,
std::unique_ptr<MediaStreamUI>());
}
void WebContentsImpl::ProcessSelectAudioOutput(
@@ -5423,6 +5470,15 @@ bool WebContentsImpl::CheckMediaAccessPermission(
DCHECK(type == blink::mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE ||
type == blink::mojom::MediaStreamType::DEVICE_VIDEO_CAPTURE);
if (auto* guest =
GuestPageHolderImpl::FromRenderFrameHost(*render_frame_host)) {
if (auto* delegate = guest->delegate()) {
return delegate->GuestCheckMediaAccessPermission(render_frame_host,
security_origin, type);
}
return false;
}
return delegate_ && delegate_->CheckMediaAccessPermission(
render_frame_host, security_origin, type);
}
@@ -5451,7 +5507,7 @@ bool WebContentsImpl::IsJavaScriptDialogShowing() const {
bool WebContentsImpl::ShouldIgnoreUnresponsiveRenderer() {
// Suppress unresponsive renderers if the command line asks for it.
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableHangMonitor)) {
input::switches::kDisableHangMonitor)) {
return true;
}
@@ -5924,16 +5980,16 @@ WebContents* WebContentsImpl::OpenURL(
return new_contents;
}
void WebContentsImpl::SetHistoryOffsetAndLengthForView(
void WebContentsImpl::SetHistoryIndexAndLengthForView(
RenderViewHost* render_view_host,
int history_offset,
int history_index,
int history_length) {
OPTIONAL_TRACE_EVENT2(
"content", "WebContentsImpl::SetHistoryOffsetAndLengthForView",
"history_offset", history_offset, "history_length", history_length);
"content", "WebContentsImpl::SetHistoryIndexAndLengthForView",
"history_index", history_index, "history_length", history_length);
if (auto& broadcast = static_cast<RenderViewHostImpl*>(render_view_host)
->GetAssociatedPageBroadcast()) {
broadcast->SetHistoryOffsetAndLength(history_offset, history_length);
broadcast->SetHistoryIndexAndLength(history_index, history_length);
}
}
@@ -7011,6 +7067,10 @@ void WebContentsImpl::DidFinishNavigation(NavigationHandle* navigation_handle) {
max_loaded_frame_count_ = GetFrameTreeSize(&primary_frame_tree_);
}
// TODO(crbug.com/40202416): MPArch GuestView: We might need to look up the
// preferences for the navigation here and adjust the guest, but for now
// SetWebPreferences does not adjust the guest frame tree so we look for the
// preferences matching the primary main frame.
if (web_preferences_) {
// Update the WebPreferences for this WebContents that depends on changes
// that might occur during navigation. This will only update the preferences
@@ -7018,7 +7078,8 @@ void WebContentsImpl::DidFinishNavigation(NavigationHandle* navigation_handle) {
// that needs to stay the same after navigations).
bool value_changed_due_to_override =
GetContentClient()->browser()->OverrideWebPreferencesAfterNavigation(
this, web_preferences_.get());
this, *GetPrimaryMainFrame()->GetSiteInstance(),
web_preferences_.get());
// We need to update the WebPreferences value on the renderer if the value
// is changed due to the override above, or if the navigation is served from
// the back-forward cache, because the WebPreferences value stored in the
@@ -7137,7 +7198,8 @@ input::TouchEmulator* WebContentsImpl::GetTouchEmulator(
void WebContentsImpl::NotifyObserversOfInputEvent(
const viz::FrameSinkId& frame_sink_id,
std::unique_ptr<blink::WebCoalescedInputEvent> event) {
std::unique_ptr<blink::WebCoalescedInputEvent> event,
bool dispatched_to_renderer) {
auto iter = created_widgets_.find(frame_sink_id);
// This adds a safeguard against race condition where a RenderWidgetHostImpl
// is being destroyed & removed from |created_widgets_|, but Viz may still
@@ -7145,7 +7207,8 @@ void WebContentsImpl::NotifyObserversOfInputEvent(
if (iter == created_widgets_.end()) {
return;
}
iter->second->NotifyObserversOfInputEvent(event->Event());
iter->second->NotifyObserversOfInputEvent(event->Event(),
dispatched_to_renderer);
}
void WebContentsImpl::NotifyObserversOfInputEventAcks(
@@ -8451,6 +8514,17 @@ void WebContentsImpl::NotifyOnJavaScriptDialogDismiss(
javascript_dialog_dismiss_notifier_->NotifyOnDismiss(std::move(callback));
}
void WebContentsImpl::Close(RenderFrameHostImpl* render_frame_host) {
if (GuestPageHolderImpl* guest_holder =
GuestPageHolderImpl::FromRenderFrameHost(*render_frame_host)) {
if (auto* guest_delegate = guest_holder->delegate()) {
guest_delegate->GuestClose();
}
return;
}
Close();
}
void WebContentsImpl::RunBeforeUnloadConfirm(
RenderFrameHostImpl* render_frame_host,
bool is_reload,
@@ -8581,20 +8655,46 @@ void WebContentsImpl::RunFileChooser(
}
}
double WebContentsImpl::GetPendingPageZoomLevel() {
NavigationEntry* pending_entry = GetController().GetPendingEntry();
if (!pending_entry) {
return HostZoomMap::GetZoomLevel(this);
}
double WebContentsImpl::GetPendingZoomLevel(RenderWidgetHostImpl* rwh) {
// TODO(372932834): This needs to be modified for the PDF-in-OOPIF case, as
// while the PDF will have its own RenderWidgetHost, the associated
// RenderFrameHost won't always be at the root of a FrameTree (and the
// FrameTree won't be of type kGuest).
// Note: this could involve (something like) detecting that the rfh for `rwh`
// is *not* a frame-tree root, but *does* have a temporary zoom level set in
// HostZoomMap.
RenderFrameHostImpl* rfh =
rwh->frame_tree()->root()->current_frame_host()->GetOutermostMainFrame();
GURL url = pending_entry->GetURL();
GURL url;
if (rfh->IsInBackForwardCache()) {
// If the `rfh`s page is in the bf cache, then the use of the pending (or
// last committed) entry would have the lookup be based on an unrelated URL.
// In that case use the RFH's last committed URL. While using the
// NavigationEntry is preferred in order to avoid a virtual URL, that
// shouldn't be a problem if the URL from the `rfh` is used. Note that
// subframes get their zoom updates asynchronously from the main frame, so
// it's possible to get here in a race condition for a page that is no
// longer visible. For example, it's possible to get here on Android in the
// tests FencedFrameParameterizedBrowserTest.NavigateUnfencedTopAndGoBack
// and All/FencedFrameAutomaticBeaconBrowserTest.MessageExceedsLengthLimit/
// fencedframe.
url = rfh->GetLastCommittedURL();
} else {
NavigationEntry* pending_entry = rfh->GetController().GetPendingEntry();
if (!pending_entry) {
return HostZoomMap::GetZoomLevel(this, rfh->GetGlobalId());
}
url = pending_entry->GetURL();
}
#if BUILDFLAG(IS_ANDROID)
return HostZoomMap::GetForWebContents(this)
->GetZoomLevelForHostAndSchemeAndroid(url.scheme(),
net::GetHostOrSpecFromURL(url));
#else
return HostZoomMap::GetForWebContents(this)->GetZoomLevelForHostAndScheme(
url.scheme(), net::GetHostOrSpecFromURL(url));
return HostZoomMap::Get(rfh->GetSiteInstance())
->GetZoomLevelForHostAndScheme(url.scheme(),
net::GetHostOrSpecFromURL(url));
#endif
}
@@ -8654,6 +8754,16 @@ const blink::RendererPreferences& WebContentsImpl::GetRendererPrefs(
return renderer_preferences_;
}
const blink::web_pref::WebPreferences&
WebContentsImpl::GetOrCreateWebPreferences(
RenderViewHostImpl* render_view_host) {
if (auto* guest = GuestPageHolderImpl::FromRenderFrameHost(
*render_view_host->frame_tree()->GetMainFrame())) {
return guest->GetWebPreferences();
}
return GetOrCreateWebPreferences();
}
RenderFrameHostImpl* WebContentsImpl::GetOuterWebContentsFrame() {
if (GetOuterDelegateFrameTreeNodeId().is_null()) {
return nullptr;
@@ -8914,8 +9024,18 @@ void WebContentsImpl::SetWindowRect(const gfx::Rect& new_bounds) {
delegate_->SetContentsBounds(this, bounds);
}
void WebContentsImpl::UpdateWindowPreferredSize(const gfx::Size& pref_size) {
void WebContentsImpl::UpdateWindowPreferredSize(
RenderFrameHostImpl* render_frame_host,
const gfx::Size& pref_size) {
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::UpdatePreferredSize");
if (auto* guest =
GuestPageHolderImpl::FromRenderFrameHost(*render_frame_host)) {
guest->delegate()->GuestUpdateWindowPreferredSize(pref_size);
return;
}
CHECK(render_frame_host->IsInPrimaryMainFrame());
const gfx::Size old_size = GetPreferredSize();
preferred_size_ = pref_size;
OnPreferredSizeChanged(old_size);
@@ -9182,6 +9302,20 @@ bool WebContentsImpl::MaybeCopyContentAreaAsBitmap(
return GetDelegate()->MaybeCopyContentAreaAsBitmap(std::move(callback));
}
bool WebContentsImpl::SupportsForwardTransitionAnimation() {
#if BUILDFLAG(IS_ANDROID)
return supports_forward_transition_animation_;
#else
return true;
#endif // !BUILDFLAG(IS_ANDROID)
}
#if BUILDFLAG(IS_ANDROID)
void WebContentsImpl::SetSupportsForwardTransitionAnimation(bool supports) {
supports_forward_transition_animation_ = supports;
}
#endif // !BUILDFLAG(IS_ANDROID)
void WebContentsImpl::DidChangeName(RenderFrameHostImpl* render_frame_host,
const std::string& name) {
OPTIONAL_TRACE_EVENT2("content", "WebContentsImpl::DidChangeName",
@@ -9308,11 +9442,12 @@ void WebContentsImpl::UpdateTitle(RenderFrameHostImpl* render_frame_host,
}
}
void WebContentsImpl::UpdateAppTitle(RenderFrameHostImpl* render_frame_host,
const std::u16string& app_title) {
void WebContentsImpl::UpdateApplicationTitle(
RenderFrameHostImpl* render_frame_host,
const std::u16string& application_title) {
OPTIONAL_TRACE_EVENT2("content", "WebContentsImpl::UpdateTitle",
"render_frame_host", render_frame_host, "app_title",
app_title);
"render_frame_host", render_frame_host,
"application_title", application_title);
// Same logic as UpdateTitle() above.
NavigationEntryImpl* entry =
render_frame_host->frame_tree()->controller().GetEntryWithUniqueID(
@@ -9327,14 +9462,15 @@ void WebContentsImpl::UpdateAppTitle(RenderFrameHostImpl* render_frame_host,
entry =
render_frame_host->frame_tree()->controller().GetLastCommittedEntry();
}
std::u16string final_app_title;
base::TrimWhitespace(app_title, base::TRIM_ALL, &final_app_title);
std::u16string final_application_title;
base::TrimWhitespace(application_title, base::TRIM_ALL,
&final_application_title);
if (final_app_title == entry->GetAppTitle()) {
if (final_application_title == entry->GetApplicationTitle()) {
return;
}
entry->SetAppTitle(final_app_title);
entry->SetApplicationTitle(final_application_title);
NotifyNavigationStateChanged(INVALIDATE_TYPE_TITLE);
}
@@ -9946,7 +10082,7 @@ bool WebContentsImpl::CreateRenderViewForRenderManager(
ReattachOuterDelegateIfNeeded();
}
SetHistoryOffsetAndLengthForView(
SetHistoryIndexAndLengthForView(
render_view_host,
rvh_impl->frame_tree()->controller().GetLastCommittedEntryIndex(),
rvh_impl->frame_tree()->controller().GetEntryCount());
@@ -10148,7 +10284,7 @@ gfx::Size WebContentsImpl::GetSize() {
return window->bounds().size();
#elif BUILDFLAG(IS_ANDROID)
ui::ViewAndroid* view_android = GetNativeView();
return view_android->GetSize();
return view_android->GetSizeDIPs();
#elif BUILDFLAG(IS_IOS)
// TODO(crbug.com/40254930): Implement me.
NOTREACHED();
@@ -10299,7 +10435,7 @@ void WebContentsImpl::IncrementBluetoothConnectedDeviceCount() {
// Notify for UI updates if the state changes.
bluetooth_connected_device_count_++;
if (bluetooth_connected_device_count_ == 1) {
OnCapabilityTypesChanged(CapabilityType::kBluetoothConnected,
OnCapabilityTypesChanged(WebContentsCapabilityType::kBluetoothConnected,
/*used=*/true);
}
}
@@ -10316,7 +10452,7 @@ void WebContentsImpl::DecrementBluetoothConnectedDeviceCount() {
DCHECK_NE(bluetooth_connected_device_count_, 0u);
bluetooth_connected_device_count_--;
if (bluetooth_connected_device_count_ == 0) {
OnCapabilityTypesChanged(CapabilityType::kBluetoothConnected,
OnCapabilityTypesChanged(WebContentsCapabilityType::kBluetoothConnected,
/*used=*/false);
}
}
@@ -10365,7 +10501,7 @@ void WebContentsImpl::IncrementSerialActiveFrameCount() {
// Notify for UI updates if the state changes.
serial_active_frame_count_++;
if (serial_active_frame_count_ == 1) {
OnCapabilityTypesChanged(CapabilityType::kSerial, /*used=*/true);
OnCapabilityTypesChanged(WebContentsCapabilityType::kSerial, /*used=*/true);
}
}
@@ -10382,7 +10518,8 @@ void WebContentsImpl::DecrementSerialActiveFrameCount() {
DCHECK_NE(0u, serial_active_frame_count_);
serial_active_frame_count_--;
if (serial_active_frame_count_ == 0) {
OnCapabilityTypesChanged(CapabilityType::kSerial, /*used=*/false);
OnCapabilityTypesChanged(WebContentsCapabilityType::kSerial,
/*used=*/false);
}
}
@@ -10399,7 +10536,7 @@ void WebContentsImpl::IncrementHidActiveFrameCount() {
// non-zero.
hid_active_frame_count_++;
if (hid_active_frame_count_ == 1) {
OnCapabilityTypesChanged(CapabilityType::kHID, /*used=*/true);
OnCapabilityTypesChanged(WebContentsCapabilityType::kHID, /*used=*/true);
}
}
@@ -10417,7 +10554,7 @@ void WebContentsImpl::DecrementHidActiveFrameCount() {
DCHECK_NE(0u, hid_active_frame_count_);
hid_active_frame_count_--;
if (hid_active_frame_count_ == 0) {
OnCapabilityTypesChanged(CapabilityType::kHID, /*used=*/false);
OnCapabilityTypesChanged(WebContentsCapabilityType::kHID, /*used=*/false);
}
}
@@ -10434,7 +10571,8 @@ void WebContentsImpl::IncrementGeolocationActiveFrameCount() {
// non-zero.
geolocation_active_frame_count_++;
if (geolocation_active_frame_count_ == 1) {
OnCapabilityTypesChanged(CapabilityType::kGeolocation, /*used=*/true);
OnCapabilityTypesChanged(WebContentsCapabilityType::kGeolocation,
/*used=*/true);
}
}
@@ -10452,13 +10590,14 @@ void WebContentsImpl::DecrementGeolocationActiveFrameCount() {
DCHECK_NE(0u, geolocation_active_frame_count_);
geolocation_active_frame_count_--;
if (geolocation_active_frame_count_ == 0) {
OnCapabilityTypesChanged(CapabilityType::kGeolocation,
OnCapabilityTypesChanged(WebContentsCapabilityType::kGeolocation,
/*used=*/false);
}
}
void WebContentsImpl::OnCapabilityTypesChanged(CapabilityType capability_type,
bool used) {
void WebContentsImpl::OnCapabilityTypesChanged(
WebContentsCapabilityType capability_type,
bool used) {
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::OnCapabilityTypesChanged");
NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB);
observers_.NotifyObservers(&WebContentsObserver::OnCapabilityTypesChanged,
@@ -10478,7 +10617,7 @@ void WebContentsImpl::IncrementUsbActiveFrameCount() {
// non-zero.
usb_active_frame_count_++;
if (usb_active_frame_count_ == 1) {
OnCapabilityTypesChanged(CapabilityType::kUSB, /*used=*/true);
OnCapabilityTypesChanged(WebContentsCapabilityType::kUSB, /*used=*/true);
}
}
@@ -10496,7 +10635,7 @@ void WebContentsImpl::DecrementUsbActiveFrameCount() {
DCHECK_NE(0u, usb_active_frame_count_);
usb_active_frame_count_--;
if (usb_active_frame_count_ == 0) {
OnCapabilityTypesChanged(CapabilityType::kUSB, /*used=*/false);
OnCapabilityTypesChanged(WebContentsCapabilityType::kUSB, /*used=*/false);
}
}
@@ -11374,11 +11513,12 @@ void WebContentsImpl::UpdateBrowserControlsState(
cc::BrowserControlsState constraints,
cc::BrowserControlsState current,
bool animate,
const std::optional<cc::BrowserControlsOffsetTagsInfo>& offset_tags_info) {
const std::optional<cc::BrowserControlsOffsetTagModifications>&
offset_tag_modifications) {
// Browser controls should be synchronised with the scroll state. Therefore,
// they are controlled from the renderer by the main RenderFrame(Host).
GetPrimaryPage().UpdateBrowserControlsState(constraints, current, animate,
offset_tags_info);
offset_tag_modifications);
}
void WebContentsImpl::SetV8CompileHints(base::ReadOnlySharedMemoryRegion data) {
@@ -11464,7 +11604,7 @@ WebContentsImpl::GetRenderInputRouterDelegateRemote() {
return rir_delegate_remote_.get();
}
void WebContentsImpl::StartPrefetch(
std::unique_ptr<PrefetchHandle> WebContentsImpl::StartPrefetch(
const GURL& prefetch_url,
bool use_prefetch_proxy,
const blink::mojom::Referrer& referrer,
@@ -11473,27 +11613,23 @@ void WebContentsImpl::StartPrefetch(
std::optional<PreloadingHoldbackStatus> holdback_status_override) {
if (!base::FeatureList::IsEnabled(
features::kPrefetchBrowserInitiatedTriggers)) {
return;
return nullptr;
}
PrefetchService* prefetch_service =
BrowserContextImpl::From(GetBrowserContext())->GetPrefetchService();
if (!prefetch_service) {
return;
return nullptr;
}
PrefetchType prefetch_type(PreloadingTriggerType::kEmbedder,
use_prefetch_proxy);
auto container = std::make_unique<PrefetchContainer>(
*this, prefetch_url, prefetch_type, referrer, referring_origin,
/*no_vary_search_hint=*/std::nullopt, std::move(attempt),
holdback_status_override);
// TODO(crbug.com/40946257): Update this list when prefetch container is
// eliminated from `PrefetchService`.
prefetch_containers_.push_back(container->GetWeakPtr());
prefetch_service->AddPrefetchContainer(std::move(container));
return prefetch_service->AddPrefetchContainerWithHandle(std::move(container));
}
std::unique_ptr<PrerenderHandle> WebContentsImpl::StartPrerendering(
@@ -11546,6 +11682,10 @@ void WebContentsImpl::CancelAllPrerendering() {
PrerenderFinalStatus::kAllPrerenderingCanceled);
}
bool WebContentsImpl::IsAllowedToStartPrerendering() {
return GetPrerenderHostRegistry()->IsAllowedToStartPrerenderingForEmbedder();
}
void WebContentsImpl::BackNavigationLikely(PreloadingPredictor predictor,
WindowOpenDisposition disposition) {
CHECK(!IsBeingDestroyed());
@@ -11705,6 +11845,9 @@ void WebContentsImpl::GetMediaCaptureRawDeviceIdsOpened(
}
void WebContentsImpl::WarmUpAndroidSpareRenderer() {
if (GetBrowserContext()->ShutdownStarted()) {
return;
}
int renderer_timeout_seconds =
features::kAndroidSpareRendererTimeoutSeconds.Get();
if (renderer_timeout_seconds < 0) {
@@ -194,14 +194,8 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
{wf::EnableBackgroundFetch, raw_ref(features::kBackgroundFetch)},
{wf::EnableBoundaryEventDispatchTracksNodeRemoval,
raw_ref(blink::features::kBoundaryEventDispatchTracksNodeRemoval)},
{wf::EnableBrowserVerifiedUserActivationKeyboard,
raw_ref(features::kBrowserVerifiedUserActivationKeyboard)},
{wf::EnableBrowserVerifiedUserActivationMouse,
raw_ref(features::kBrowserVerifiedUserActivationMouse)},
{wf::EnableCompositeBGColorAnimation,
raw_ref(features::kCompositeBGColorAnimation)},
{wf::EnableCooperativeScheduling,
raw_ref(features::kCooperativeScheduling)},
{wf::EnableDigitalGoods, raw_ref(features::kDigitalGoodsApi),
kSetOnlyIfOverridden},
{wf::EnableDocumentPolicyNegotiation,
@@ -217,9 +211,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
kDefault},
{wf::EnableFedCmIdPRegistration,
raw_ref(features::kFedCmIdPRegistration), kDefault},
{wf::EnableFedCmIdpSigninStatus,
raw_ref(features::kFedCmIdpSigninStatusEnabled),
kSetOnlyIfOverridden},
{wf::EnableFedCmLightweightMode,
raw_ref(features::kFedCmLightweightMode), kDefault},
{wf::EnableGamepadMultitouch,
@@ -347,9 +338,6 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
kSetOnlyIfOverridden},
{"AttributionReporting",
raw_ref(features::kPrivacySandboxAdsAPIsM1Override)},
{"AttributionReportingCrossAppWeb",
raw_ref(features::kPrivacySandboxAdsAPIsOverride),
kSetOnlyIfOverridden},
{"AndroidDownloadableFontsMatching",
raw_ref(features::kAndroidDownloadableFontsMatching)},
#if BUILDFLAG(IS_ANDROID)
@@ -412,7 +400,9 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
{"ExperimentalMachineLearningNeuralNetwork",
raw_ref(webnn::mojom::features::
kExperimentalWebMachineLearningNeuralNetwork),
kSetOnlyIfOverridden}};
kSetOnlyIfOverridden},
{"WebAuthenticationNewBfCacheHandlingBlink",
raw_ref(device::kWebAuthnNewBfCacheHandling)}};
for (const auto& mapping : runtimeFeatureNameToChromiumFeatureMapping) {
SetRuntimeFeatureFromChromiumFeature(
*mapping.chromium_feature, mapping.option, [&mapping](bool enabled) {
@@ -622,21 +612,6 @@ void ResolveInvalidConfigurations() {
WebRuntimeFeatures::EnableAttributionReporting(false);
}
if (!base::FeatureList::IsEnabled(
attribution_reporting::features::kConversionMeasurement) ||
!base::FeatureList::IsEnabled(
network::features::kAttributionReportingCrossAppWeb)) {
LOG_IF(WARNING,
WebRuntimeFeatures::IsAttributionReportingCrossAppWebEnabled())
<< "AttributionReportingCrossAppWeb cannot be enabled in this "
"configuration. Use --"
<< switches::kEnableFeatures << "="
<< attribution_reporting::features::kConversionMeasurement.name << ","
<< network::features::kAttributionReportingCrossAppWeb.name
<< " in addition.";
WebRuntimeFeatures::EnableAttributionReportingCrossAppWeb(false);
}
if (!base::FeatureList::IsEnabled(blink::features::kInterestGroupStorage)) {
LOG_IF(WARNING,
WebRuntimeFeatures::IsAdInterestGroupAPIEnabledByRuntimeFlag())
@@ -27,13 +27,12 @@
#include "content/browser/ai/echo_ai_manager_impl.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/public/browser/anchor_element_preconnect_delegate.h"
#include "content/public/browser/authenticator_request_client_delegate.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_main_parts.h"
#include "content/public/browser/browsing_data_remover.h"
#include "content/public/browser/client_certificate_delegate.h"
#include "content/public/browser/devtools_manager_delegate.h"
#include "content/public/browser/digital_identity_provider.h"
#include "content/public/browser/dips_delegate.h"
#include "content/public/browser/identity_request_dialog_controller.h"
#include "content/public/browser/legacy_tech_cookie_issue_details.h"
#include "content/public/browser/login_delegate.h"
@@ -87,7 +86,7 @@
#include "third_party/blink/public/mojom/file_system_access/file_system_access_cloud_identifier.mojom.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_error.mojom.h"
#include "third_party/blink/public/mojom/origin_trials/origin_trials_settings.mojom.h"
#include "third_party/blink/public/mojom/payments/payment_credential.mojom.h"
#include "third_party/blink/public/mojom/payments/secure_payment_confirmation_service.mojom.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/shell_dialogs/select_file_policy.h"
#include "url/gurl.h"
@@ -96,6 +95,8 @@
#if BUILDFLAG(IS_ANDROID)
#include "content/public/browser/tts_environment_android.h"
#else
#include "content/public/browser/authenticator_request_client_delegate.h"
#include "content/public/browser/web_authentication_delegate.h"
#include "third_party/blink/public/mojom/installedapp/related_application.mojom.h"
#endif
@@ -243,6 +244,10 @@ void ContentBrowserClient::GetAdditionalViewSourceSchemes(
GetAdditionalWebUISchemes(additional_schemes);
}
bool ContentBrowserClient::IsInternalScheme(const GURL& url) {
return false;
}
network::mojom::IPAddressSpace
ContentBrowserClient::DetermineAddressSpaceFromURL(const GURL& url) {
return network::mojom::IPAddressSpace::kUnknown;
@@ -367,6 +372,10 @@ bool ContentBrowserClient::ShouldDisableSiteIsolation(
return false;
}
bool ContentBrowserClient::ShouldDisableOriginIsolation() {
return false;
}
std::vector<std::string>
ContentBrowserClient::GetAdditionalSiteIsolationModes() {
return std::vector<std::string>();
@@ -486,6 +495,11 @@ bool ContentBrowserClient::AllowCompressionDictionaryTransport(
return true;
}
bool ContentBrowserClient::AllowServiceWorkerToControlSrcdocIframe(
BrowserContext* context) {
return true;
}
bool ContentBrowserClient::AllowSharedWorkerBlobURLFix(
BrowserContext* context) {
return true;
@@ -493,6 +507,7 @@ bool ContentBrowserClient::AllowSharedWorkerBlobURLFix(
bool ContentBrowserClient::OverrideWebPreferencesAfterNavigation(
WebContents* web_contents,
SiteInstance& main_frame_site,
blink::web_pref::WebPreferences* prefs) {
return false;
}
@@ -1217,9 +1232,10 @@ void ContentBrowserClient::CreateManagedConfigurationService(
mojo::PendingReceiver<blink::mojom::ManagedConfigurationService> receiver) {
}
void ContentBrowserClient::CreatePaymentCredential(
void ContentBrowserClient::CreateSecurePaymentConfirmationService(
RenderFrameHost* render_frame_host,
mojo::PendingReceiver<payments::mojom::PaymentCredential> receiver) {}
mojo::PendingReceiver<payments::mojom::SecurePaymentConfirmationService>
receiver) {}
#if !BUILDFLAG(IS_ANDROID)
SerialDelegate* ContentBrowserClient::GetSerialDelegate() {
@@ -1552,6 +1568,11 @@ bool ContentBrowserClient::AreV8OptimizationsDisabledForSite(
return false;
}
bool ContentBrowserClient::DisallowV8FeatureFlagOverridesForSite(
const GURL& site_url) {
return false;
}
ukm::UkmService* ContentBrowserClient::GetUkmService() {
return nullptr;
}
@@ -1568,7 +1589,7 @@ void ContentBrowserClient::OnKeepaliveRequestFinished() {}
#if BUILDFLAG(IS_MAC)
bool ContentBrowserClient::SetupEmbedderSandboxParameters(
sandbox::mojom::Sandbox sandbox_type,
sandbox::SandboxCompiler* compiler) {
sandbox::SandboxSerializer* serializer) {
return false;
}
#endif // BUILDFLAG(IS_MAC)
@@ -1745,23 +1766,28 @@ bool ContentBrowserClient::
return true;
}
bool ContentBrowserClient::IsBlobUrlPartitioningEnabled(
content::BrowserContext* browser_context) {
return true;
}
bool ContentBrowserClient::UseOutermostMainFrameOrEmbedderForSubCaptureTargets()
const {
return false;
}
#if BUILDFLAG(ENABLE_VIDEO_EFFECTS)
void ContentBrowserClient::BindVideoEffectsManager(
void ContentBrowserClient::BindReadonlyVideoEffectsManager(
const std::string& device_id,
BrowserContext* browser_context,
mojo::PendingReceiver<media::mojom::VideoEffectsManager>
video_effects_manager) {}
mojo::PendingReceiver<media::mojom::ReadonlyVideoEffectsManager>
readonly_video_effects_manager) {}
void ContentBrowserClient::BindVideoEffectsProcessor(
const std::string& device_id,
BrowserContext* browser_context,
mojo::PendingReceiver<video_effects::mojom::VideoEffectsProcessor>
video_effects_manager) {}
video_effects_processor) {}
#endif // BUILDFLAG(ENABLE_VIDEO_EFFECTS)
void ContentBrowserClient::PreferenceRankAudioDeviceInfos(
@@ -1786,14 +1812,19 @@ void ContentBrowserClient::NotifyMultiCaptureStateChanged(
const std::string& label,
MultiCaptureChanged state) {}
std::unique_ptr<DipsDelegate> ContentBrowserClient::CreateDipsDelegate() {
return nullptr;
}
bool ContentBrowserClient::ShouldEnableDips(BrowserContext* browser_context) {
return true;
}
uint64_t ContentBrowserClient::GetDipsRemoveMask() {
return kDefaultDipsRemoveMask;
}
bool ContentBrowserClient::ShouldDipsDeleteInteractionRecords(
uint64_t remove_mask) {
return remove_mask & BrowsingDataRemover::DATA_TYPE_COOKIES;
}
bool ContentBrowserClient::ShouldSuppressAXLoadComplete(RenderFrameHost* rfh) {
return false;
}
@@ -1894,4 +1925,10 @@ std::unique_ptr<WebUIController> ContentBrowserClient::OverrideForInternalWebUI(
return nullptr;
}
std::optional<network::CrossOriginEmbedderPolicy>
ContentBrowserClient::MaybeOverrideLocalURLCrossOriginEmbedderPolicy(
content::NavigationHandle* navigation_handle) {
return std::nullopt;
}
} // namespace content
@@ -67,11 +67,10 @@ 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.
// Specifies the user script world ID to execute in. If omitted, the script
// will execute in the default user script world. Only valid if `world` is
// omitted or is `USER_SCRIPT`. Values with leading underscores (`_`) are
// reserved.
DOMString? worldId;
};
@@ -116,13 +115,19 @@ namespace userScripts {
// prior to page load, as the page may have already loaded by the time the
// script reaches the target.
boolean? injectImmediately;
// The script source to inject into the target.
ScriptSource js;
// The list of ScriptSource objects defining sources of scripts to be
// injected into the target.
ScriptSource[] js;
// Details specifying the target into which to inject the script.
InjectionTarget target;
// The JavaScript "world" to run the script in. The default is
// <code>USER_SCRIPT</code>.
ExecutionWorld? world;
// Specifies the user script world ID to execute in. If omitted, the script
// will execute in the default user script world. Only valid if `world` is
// omitted or is `USER_SCRIPT`. Values with leading underscores (`_`) are
// reserved.
DOMString? worldId;
};
// An object used to update the <code>`USER_SCRIPT`</code> world
+28 -18
View File
@@ -261,8 +261,28 @@ class V8FeatureVisitor : public base::FeatureVisitor {
namespace {
// Sets mandatory V8 flags.
void SetFlags(IsolateHolder::ScriptMode mode,
const std::string& js_command_line_flags) {
SetV8Flags("--js-explicit-resource-management");
if (IsolateHolder::kStrictMode == mode) {
SetV8Flags("--use_strict");
}
// Apply any --js-flags explicitly specified by the caller.
if (!js_command_line_flags.empty()) {
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) {
v8::V8::SetFlagsFromString(std::string(flag).c_str(), flag.size());
}
}
}
// Sets feature controlled V8 flags.
void SetFeatureFlags() {
// Chromium features prefixed with "V8Flag_" are forwarded to V8 as V8 flags,
// with the "V8Flag_" prefix stripped off. For example, an enabled feature
// "V8Flag_foo_bar" will be passed to V8 as the flag `--foo_bar`. Similarly,
@@ -504,10 +524,6 @@ void SetFlags(IsolateHolder::ScriptMode mode,
SetV8FlagsIfOverridden(features::kJavaScriptPromiseTry, "--js-promise-try",
"--no-js-promise-try");
if (IsolateHolder::kStrictMode == mode) {
SetV8Flags("--use_strict");
}
// WebAssembly features.
SetV8FlagsIfOverridden(features::kWebAssemblyDeopt, "--wasm-deopt",
@@ -523,17 +539,6 @@ void SetFlags(IsolateHolder::ScriptMode mode,
SetV8FlagsIfOverridden(features::kWebAssemblyTurboshaftInstructionSelection,
"--turboshaft-wasm-instruction-selection-staged",
"--no-turboshaft-wasm-instruction-selection-staged");
if (js_command_line_flags.empty())
return;
// Allow the --js-flags switch to override existing flags:
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) {
v8::V8::SetFlagsFromString(std::string(flag).c_str(), flag.size());
}
}
} // namespace
@@ -541,14 +546,19 @@ void SetFlags(IsolateHolder::ScriptMode mode,
// static
void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
const std::string& js_command_line_flags,
bool disallow_v8_feature_flag_overrides,
v8::OOMErrorCallback oom_error_callback) {
static bool v8_is_initialized = false;
if (v8_is_initialized)
return;
// Flags need to be set before InitializePlatform as they are used for
// system instrumentation initialization.
// See https://crbug.com/v8/11043
// Flags need to be set before InitializePlatform as they are used for system
// instrumentation initialization, see https://crbug.com/v8/11043. --js-flags
// and other mandatory flags in `SetFlags` must be ordered after feature flag
// overrides.
if (!disallow_v8_feature_flag_overrides) {
SetFeatureFlags();
}
SetFlags(mode, js_command_line_flags);
v8::V8::InitializePlatform(V8Platform::Get());
@@ -29,7 +29,6 @@
#include "base/memory/ref_counted.h"
#include "base/metrics/histogram_functions.h"
#include "base/not_fatal_until.h"
#include "base/ranges/algorithm.h"
#include "base/sequence_checker.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -110,6 +109,7 @@
#include "services/network/http_server_properties_pref_delegate.h"
#include "services/network/ignore_errors_cert_verifier.h"
#include "services/network/is_browser_initiated.h"
#include "services/network/known_legacy_scope_domains_delegate.h"
#include "services/network/net_log_exporter.h"
#include "services/network/network_service.h"
#include "services/network/network_service_network_delegate.h"
@@ -134,6 +134,7 @@
#include "services/network/public/mojom/reporting_service.mojom.h"
#include "services/network/public/mojom/trust_tokens.mojom-forward.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "services/network/public/mojom/web_transport.mojom.h"
#include "services/network/resolve_host_request.h"
#include "services/network/resource_scheduler/resource_scheduler_client.h"
#include "services/network/restricted_cookie_manager.h"
@@ -167,10 +168,6 @@
#include "services/network/sct_auditing/sct_auditing_handler.h"
#endif // BUILDFLAG(IS_CT_SUPPORTED)
#if BUILDFLAG(IS_CHROMEOS)
#include "services/network/cert_verifier_with_trust_anchors.h"
#endif // BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(ENABLE_WEBSOCKETS)
#include "services/network/websocket_factory.h"
#endif // BUILDFLAG(ENABLE_WEBSOCKETS)
@@ -597,7 +594,10 @@ enum class HSTSRedirectUpgradeReason {
// LINT.ThenChange(//tools/metrics/histograms/metadata/net/enums.xml:HSTSRedirectUpgradeReason)
void RecordHSTSPreconnectUpgradeReason(HSTSRedirectUpgradeReason reason) {
base::UmaHistogramEnumeration("Net.PreconnectHSTSUpgradesUrl", reason);
if (!base::FeatureList::IsEnabled(
net::features::kHstsTopLevelNavigationsOnly)) {
base::UmaHistogramEnumeration("Net.PreconnectHSTSUpgradesUrl", reason);
}
}
} // namespace
@@ -1041,12 +1041,14 @@ void NetworkContext::GetRestrictedCookieManager(
const url::Origin& origin,
const net::IsolationInfo& isolation_info,
const net::CookieSettingOverrides& cookie_setting_overrides,
const net::CookieSettingOverrides& devtools_cookie_setting_overrides,
mojo::PendingRemote<mojom::CookieAccessObserver> cookie_observer) {
RestrictedCookieManager::ComputeFirstPartySetMetadata(
origin, url_request_context_->cookie_store(), isolation_info,
base::BindOnce(&NetworkContext::OnComputedFirstPartySetMetadata,
weak_factory_.GetWeakPtr(), std::move(receiver), role,
origin, isolation_info, cookie_setting_overrides,
devtools_cookie_setting_overrides,
std::move(cookie_observer)));
}
@@ -1064,6 +1066,7 @@ void NetworkContext::OnComputedFirstPartySetMetadata(
const url::Origin& origin,
const net::IsolationInfo& isolation_info,
const net::CookieSettingOverrides& cookie_setting_overrides,
const net::CookieSettingOverrides& devtools_cookie_setting_overrides,
mojo::PendingRemote<mojom::CookieAccessObserver> cookie_observer,
net::FirstPartySetMetadata first_party_set_metadata) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
@@ -1072,8 +1075,8 @@ void NetworkContext::OnComputedFirstPartySetMetadata(
std::make_unique<RestrictedCookieManager>(
role, url_request_context_->cookie_store(),
cookie_manager_->cookie_settings(), origin, isolation_info,
cookie_setting_overrides, std::move(cookie_observer),
std::move(first_party_set_metadata),
cookie_setting_overrides, devtools_cookie_setting_overrides,
std::move(cookie_observer), std::move(first_party_set_metadata),
network_service_->metrics_updater());
auto callback = base::BindOnce(&NetworkContext::OnRCMDisconnect,
@@ -1360,11 +1363,12 @@ void NetworkContext::ClearHttpAuthCache(base::Time start_time,
url_request_context_->http_transaction_factory()->GetSession();
DCHECK(http_session);
http_session->http_auth_cache()->ClearEntriesAddedBetween(
start_time, end_time, BuildUrlFilter(std::move(filter)));
// TODO(mmenke): Use another error code for this, as ERR_ABORTED has somewhat
// magical handling with respect to navigations.
http_session->CloseAllConnections(net::ERR_ABORTED, "Clearing auth cache");
if (http_session->http_auth_cache()->ClearEntriesAddedBetween(
start_time, end_time, BuildUrlFilter(std::move(filter)))) {
// TODO(mmenke): Use another error code for this, as ERR_ABORTED has
// somewhat magical handling with respect to navigations.
http_session->CloseAllConnections(net::ERR_ABORTED, "Clearing auth cache");
}
std::move(callback).Run();
}
@@ -1929,6 +1933,14 @@ void NetworkContext::CreateWebTransport(
std::vector<mojom::WebTransportCertificateFingerprintPtr> fingerprints,
mojo::PendingRemote<mojom::WebTransportHandshakeClient>
pending_handshake_client) {
if (!IsNetworkForNonceAndUrlAllowed(
key.GetNonce().value_or(base::UnguessableToken::Null()), url)) {
mojo::Remote<mojom::WebTransportHandshakeClient> remote_handshake_client(
std::move(pending_handshake_client));
remote_handshake_client->OnHandshakeFailed(
net::WebTransportError(net::ERR_NETWORK_ACCESS_REVOKED));
return;
}
web_transports_.insert(
std::make_unique<WebTransport>(url, origin, key, fingerprints, this,
std::move(pending_handshake_client)));
@@ -2076,6 +2088,7 @@ void NetworkContext::AddHSTS(const std::string& host,
}
void NetworkContext::IsHSTSActiveForHost(const std::string& host,
bool is_top_level_nav,
IsHSTSActiveForHostCallback callback) {
net::TransportSecurityState* security_state =
url_request_context_->transport_security_state();
@@ -2085,7 +2098,8 @@ void NetworkContext::IsHSTSActiveForHost(const std::string& host,
return;
}
std::move(callback).Run(security_state->ShouldUpgradeToSSL(host));
std::move(callback).Run(
security_state->ShouldUpgradeToSSL(host, is_top_level_nav));
}
void NetworkContext::GetHSTSState(const std::string& domain,
@@ -2456,7 +2470,7 @@ const net::HttpAuthPreferences* NetworkContext::GetHttpAuthPreferences() const {
}
size_t NetworkContext::NumOpenWebTransports() const {
return base::ranges::count(web_transports_, false, &WebTransport::torn_down);
return std::ranges::count(web_transports_, false, &WebTransport::torn_down);
}
bool NetworkContext::AllURLLoaderFactoriesAreBoundToNetworkForTesting(
@@ -2555,18 +2569,6 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
cert_verifier = std::make_unique<net::CachingCertVerifier>(
std::make_unique<net::CoalescingCertVerifier>(
std::move(cert_verifier)));
#if BUILDFLAG(IS_CHROMEOS)
// TODO(crbug.com/40928765): The TrustAnchorUsed callback should
// work on all platforms. (Also consider whether this wrapper is the best
// way to handle this or if it should be refactored.)
auto cert_verifier_with_trust_anchors =
std::make_unique<CertVerifierWithTrustAnchors>(base::BindRepeating(
&NetworkContext::TrustAnchorUsed, base::Unretained(this)));
cert_verifier_with_trust_anchors->InitializeOnIOThread(
std::move(cert_verifier));
cert_verifier = std::move(cert_verifier_with_trust_anchors);
#endif // BUILDFLAG(IS_CHROMEOS)
}
builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier(
@@ -2635,39 +2637,27 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
builder.set_network_quality_estimator(
network_service_->network_quality_estimator());
}
trust_token_store_ = std::make_unique<PendingTrustTokenStore>();
if (session_cleanup_cookie_store) {
std::unique_ptr<net::CookieMonster> cookie_store =
std::make_unique<net::CookieMonster>(session_cleanup_cookie_store.get(),
net_log);
if (params_->persist_session_cookies) {
cookie_store->SetPersistSessionCookies(true);
}
builder.SetCookieStore(std::move(cookie_store));
base::FilePath trust_token_path;
if (GetFullDataFilePath(
params_->file_paths,
&network::mojom::NetworkContextFilePaths::trust_token_database_name,
trust_token_path)) {
SQLiteTrustTokenPersister::CreateForFilePath(
base::ThreadPool::CreateSequencedTaskRunner(
{base::MayBlock(), kTrustTokenDatabaseTaskPriority,
base::TaskShutdownBehavior::BLOCK_SHUTDOWN}),
trust_token_path, kTrustTokenWriteBufferingWindow,
base::BindOnce(&NetworkContext::FinishConstructingTrustTokenStore,
weak_factory_.GetWeakPtr()));
} else {
trust_token_store_->OnStoreReady(std::make_unique<TrustTokenStore>(
std::make_unique<InMemoryTrustTokenPersister>(),
std::make_unique<ExpiryInspectingRecordExpiryDelegate>(
network_service()->trust_token_key_commitments())));
}
trust_token_store_ = std::make_unique<PendingTrustTokenStore>();
base::FilePath trust_token_path;
if (GetFullDataFilePath(
params_->file_paths,
&network::mojom::NetworkContextFilePaths::trust_token_database_name,
trust_token_path)) {
SQLiteTrustTokenPersister::CreateForFilePath(
base::ThreadPool::CreateSequencedTaskRunner(
{base::MayBlock(), kTrustTokenDatabaseTaskPriority,
base::TaskShutdownBehavior::BLOCK_SHUTDOWN}),
trust_token_path, kTrustTokenWriteBufferingWindow,
base::BindOnce(&NetworkContext::FinishConstructingTrustTokenStore,
weak_factory_.GetWeakPtr()));
} else {
trust_token_store_->OnStoreReady(std::make_unique<TrustTokenStore>(
std::make_unique<InMemoryTrustTokenPersister>(),
std::make_unique<ExpiryInspectingRecordExpiryDelegate>(
network_service()->trust_token_key_commitments())));
}
std::unique_ptr<net::StaticHttpUserAgentSettings> user_agent_settings =
std::make_unique<net::StaticHttpUserAgentSettings>(
params_->accept_language, params_->user_agent);
@@ -2767,6 +2757,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
scoped_refptr<PrefRegistrySimple> pref_registry(new PrefRegistrySimple());
HttpServerPropertiesPrefDelegate::RegisterPrefs(pref_registry.get());
NetworkQualitiesPrefDelegate::RegisterPrefs(pref_registry.get());
KnownLegacyScopeDomainsPrefDelegate::RegisterPrefs(pref_registry.get());
pref_service = pref_service_factory.Create(pref_registry.get());
builder.SetHttpServerProperties(std::make_unique<net::HttpServerProperties>(
@@ -2778,6 +2769,19 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
pref_service.get(), network_service_->network_quality_estimator());
}
if (session_cleanup_cookie_store) {
std::unique_ptr<net::CookieMonster> cookie_store =
std::make_unique<net::CookieMonster>(
session_cleanup_cookie_store.get(), net_log,
std::make_unique<KnownLegacyScopeDomainsPrefDelegate>(
pref_service.get()));
if (params_->persist_session_cookies) {
cookie_store->SetPersistSessionCookies(true);
}
builder.SetCookieStore(std::move(cookie_store));
}
base::FilePath transport_security_persister_file_name;
if (GetFullDataFilePath(params_->file_paths,
&network::mojom::NetworkContextFilePaths::
@@ -3007,12 +3011,11 @@ NetworkContext::MakeSessionCleanupCookieStore() const {
#if BUILDFLAG(IS_WIN)
const bool enable_exclusive_access =
params_->enable_locking_cookie_database.value_or(
base::FeatureList::IsEnabled(
features::kEnableLockCookieDatabaseByDefault));
network_service()->exclusive_cookie_database_locking();
#else
const bool enable_exclusive_access = false;
#endif // BUILDFLAG(IS_WIN)
scoped_refptr<net::SQLitePersistentCookieStore> sqlite_store(
new net::SQLitePersistentCookieStore(
cookie_path, client_task_runner, background_task_runner,
@@ -3075,8 +3078,17 @@ GURL NetworkContext::GetHSTSRedirectForPreconnect(const GURL& original_url) {
return original_url;
}
// TODO(crbug.com/40725781); This currently doesn't allow for preconnect
// upgrades when kHstsTopLevelNavigationsOnly is enabled. Revisit this
// decision after analyzing Net.PreconnectHSTSUpgradesUrl metric.
//
// When kHstsTopLevelNavigationsOnly is enabled only top-level navigations
// will be eligable for HSTS upgrades (not sub-resource requests).
// Unfortunately we don't know at this point if this request is for a
// top-level navigation so we need to disallow HSTS upgrades for every
// preconnect.
if (!url_request_context_->transport_security_state()->ShouldUpgradeToSSL(
original_url.host())) {
original_url.host(), /*is_top_level_nav=*/false)) {
RecordHSTSPreconnectUpgradeReason(
HSTSRedirectUpgradeReason::kNotUpgradedNoHSTSPin);
return original_url;
@@ -3153,12 +3165,6 @@ void NetworkContext::OnVerifyCertForSignedExchangeComplete(
.Run(result, *pending_cert_verify->result.get(), pkp_bypassed);
}
#if BUILDFLAG(IS_CHROMEOS)
void NetworkContext::TrustAnchorUsed() {
client_->OnTrustAnchorUsed();
}
#endif // BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_DIRECTORY_TRANSFER_REQUIRED)
void NetworkContext::EnsureMounted(network::TransferableDirectory* directory) {
if (directory->NeedsMount()) {
@@ -3335,6 +3341,9 @@ void NetworkContext::RevokeNetworkForNonces(
websocket_factory_->RemoveIfNonceMatches(nonce);
}
#endif // BUILDFLAG(ENABLE_WEBSOCKETS)
for (const auto& transport : web_transports_) {
transport->CloseIfNonceMatches(nonce);
}
}
if (callback) {
File diff suppressed because it is too large Load Diff
@@ -684,16 +684,16 @@ enum WebFeature {
kExecCommandOnInputOrTextarea = 1027,
kV8History_ScrollRestoration_AttributeGetter = 1028,
kV8History_ScrollRestoration_AttributeSetter = 1029,
kSVG1DOMFilter = 1030,
kObsoleteSVG1DOMFilter = 1030,
kOfflineAudioContextStartRendering = 1031,
kOfflineAudioContextSuspend = 1032,
kOfflineAudioContextResume = 1033,
kSVG1DOMPaintServer = 1035,
kObsoleteSVG1DOMPaintServer = 1035,
kSVGSVGElementFragmentSVGView = 1036,
kSVGSVGElementFragmentSVGViewElement = 1037,
kPresentationConnectionClose = 1038,
kSVG1DOMShape = 1039,
kSVG1DOMText = 1040,
kObsoleteSVG1DOMText = 1040,
kRTCPeerConnectionConstructorConstraints = 1041,
kRTCPeerConnectionConstructorCompliant = 1042,
kRTCPeerConnectionCreateOfferLegacyFailureCallback = 1044,
@@ -1397,18 +1397,18 @@ enum WebFeature {
kMediaStreamConstraintsMediaStreamSourceVideo = 1944,
kMediaStreamConstraintsRenderToAssociatedSink = 1945,
kMediaStreamConstraintsHotwordEnabled = 1946,
kMediaStreamConstraintsGoogEchoCancellation = 1947,
kMediaStreamConstraintsGoogExperimentalEchoCancellation = 1948,
kMediaStreamConstraintsGoogAutoGainControl = 1949,
kMediaStreamConstraintsGoogExperimentalAutoGainControl = 1950,
kMediaStreamConstraintsGoogNoiseSuppression = 1951,
kMediaStreamConstraintsGoogHighpassFilter = 1952,
kMediaStreamConstraintsGoogTypingNoiseDetection = 1953,
kMediaStreamConstraintsGoogExperimentalNoiseSuppression = 1954,
kMediaStreamConstraintsGoogBeamforming = 1955,
kMediaStreamConstraintsGoogArrayGeometry = 1956,
kMediaStreamConstraintsGoogAudioMirroring = 1957,
kMediaStreamConstraintsGoogDAEchoCancellation = 1958,
kOBSOLETE_MediaStreamConstraintsGoogEchoCancellation = 1947,
kOBSOLETE_MediaStreamConstraintsGoogExperimentalEchoCancellation = 1948,
kMediaStreamConstraintsAutoGainControl = 1949,
kOBSOLETE_MediaStreamConstraintsGoogExperimentalAutoGainControl = 1950,
kMediaStreamConstraintsNoiseSuppression = 1951,
kOBSOLETE_MediaStreamConstraintsGoogHighpassFilter = 1952,
kOBSOLETE_MediaStreamConstraintsGoogTypingNoiseDetection = 1953,
kOBSOLETE_MediaStreamConstraintsGoogExperimentalNoiseSuppression = 1954,
kOBSOLETE_MediaStreamConstraintsGoogBeamforming = 1955,
kOBSOLETE_MediaStreamConstraintsGoogArrayGeometry = 1956,
kOBSOLETE_MediaStreamConstraintsGoogAudioMirroring = 1957,
kOBSOLETE_MediaStreamConstraintsGoogDAEchoCancellation = 1958,
kMediaStreamConstraintsGoogNoiseReduction = 1959,
// The above items are available in M59 branch.
@@ -3936,7 +3936,7 @@ enum WebFeature {
kFedCmRpContext = 4580,
kEventTimingArtificialPointerupOrClick = 4581,
kAbortSignalAny = 4582,
kFedCmIdpSigninStatusApi = 4583,
kOBSOLETE_FedCmIdpSigninStatusApi = 4583,
kFedCmIdpSigninStatusJsApi = 4584,
kExecCommand = 4585,
kWebGPUQueueSubmit = 4586,
@@ -4004,11 +4004,11 @@ enum WebFeature {
kV8RTCEncodedAudioFrame_SetMetadata_Method = 4645,
kV8FetchLaterResult_Activated_AttributeGetter = 4646,
kV8Window_FetchLater_Method = 4647,
kFetchLaterInvokeStateDeferred = 4648,
kFetchLaterInvokeStateScheduled = 4649,
kFetchLaterInvokeStateTerminated = 4650,
kOBSOLETE_FetchLaterInvokeStateDeferred = 4648,
kOBSOLETE_FetchLaterInvokeStateScheduled = 4649,
kOBSOLETE_FetchLaterInvokeStateTerminated = 4650,
kFetchLaterInvokeStateAborted = 4651,
kFetchLaterInvokeStateActivated = 4652,
kOBSOLETE_FetchLaterInvokeStateActivated = 4652,
kFetchLaterErrorUnknownBodyLength = 4653,
kFetchLaterErrorQuotaExceeded = 4654,
kV8FileSystemHandle_GetCloudIdentifiers_Method = 4655,
@@ -4156,7 +4156,7 @@ enum WebFeature {
kStorageAccessAPI_hasUnpartitionedCookieAccess = 4790,
kStorageAccessAPI_requestStorageAccess_BeyondCookies_cookies = 4791,
kVisualViewportScrollEndFired = 4792,
kAttributionReportingCrossAppWebSupportHeader = 4793,
kOBSOLETE_AttributionReportingCrossAppWebSupportHeader = 4793,
kV8Element_AriaActiveDescendantElement_AttributeGetter = 4794,
kV8Element_AriaActiveDescendantElement_AttributeSetter = 4795,
kV8Element_AriaControlsElements_AttributeGetter = 4796,
@@ -4347,7 +4347,7 @@ enum WebFeature {
kV8ModelGenericSession_Destroy_Method = 4973,
kUsedDeviceScaleAdjustment = 4974,
kOBSOLETE_DisableThirdPartyStoragePartitioning2 = 4975,
kLinkRelPayment = 4976,
kLinkRelFacilitatedPayment = 4976,
kOBSOLETE_V8GPUAdapter_RequestAdapterInfo_Method = 4977,
kOBSOLETE_V8ModelGenericSession_Destroy_Method = 4978,
kOBSOLETE_V8AITextSession_Execute_Method = 4979,
@@ -4539,7 +4539,7 @@ enum WebFeature {
kV8AILanguageModel_TokensLeft_AttributeGetter = 5155,
kSvgContextFillOrStroke = 5156,
kARIAActionsAttribute = 5157,
kResolveToConfigValueCoercedToTrue = 5158,
kOBSOLETE_ResolveToConfigValueCoercedToTrue = 5158,
kServiceWorkerStaticRouter_RaceNetworkAndFetchHandlerImprovement = 5159,
kHasCapUnits = 5160,
kHasRcapUnits = 5161,
@@ -4624,14 +4624,76 @@ enum WebFeature {
kCanvasTextDirectionSet = 5238,
kCanvasTextDirectionSetInherit = 5239,
kTopicsAPIImg = 5240,
kMediaSessionEnterPictureInPicture = 5241,
kV8AILanguageDetector_Detect_Method = 5242,
kCharsetAutoDetection = 5243,
kCharsetAutoDetectionISO2022JP = 5244,
kRequestOTRMainFrame = 5245,
kMixedContentOnLocalhost = 5246,
kMixedFrameEmbeddedByLocalhost = 5247,
kV8AILanguageModelCapabilities_MaxTemperature_AttributeGetter = 5248,
kAboutSrcdocToBeControlledByServiceWorker = 5249,
kDisplayNoneComputedInContentVisibilityAutoLockedSubtree = 5250,
kV8AITranslator_SourceLanguage_AttributeGetter = 5251,
kV8AITranslator_TargetLanguage_AttributeGetter = 5252,
kV8AITranslator_Destroy_Method = 5253,
kV8AITranslator_Translate_Method = 5254,
kV8AITranslator_TranslateStreaming_Method = 5255,
kV8AITranslatorFactory_Create_Method = 5256,
kV8AILanguageDetectorFactory_Create_Method = 5257,
kV8AILanguageDetector_Destroy_Method = 5258,
kFetchLaterInvokeStatePending = 5259,
kFetchLaterInvokeStateSent = 5260,
kCSPWithUnsafeHashes = 5261,
kV8AIRewriter_SharedContext_AttributeGetter = 5262,
kV8AIRewriter_Tone_AttributeGetter = 5263,
kV8AIRewriter_Format_AttributeGetter = 5264,
kV8AIRewriter_Length_AttributeGetter = 5265,
kV8AIRewriter_ExpectedInputLanguages_AttributeGetter = 5266,
kV8AIRewriter_ExpectedContextLanguages_AttributeGetter = 5267,
kV8AIRewriter_OutputLanguage_AttributeGetter = 5268,
kV8AIWriter_SharedContext_AttributeGetter = 5269,
kV8AIWriter_Tone_AttributeGetter = 5270,
kV8AIWriter_Format_AttributeGetter = 5271,
kV8AIWriter_Length_AttributeGetter = 5272,
kV8AIWriter_ExpectedInputLanguages_AttributeGetter = 5273,
kV8AIWriter_ExpectedContextLanguages_AttributeGetter = 5274,
kV8AIWriter_OutputLanguage_AttributeGetter = 5275,
kGridAutoFlowColumnDense = 5276,
kGridAutoFlowRowDense = 5277,
kSchedulerPostTaskAbortBeforeRunning = 5278,
kSchedulerPostTaskAsyncAbort = 5279,
kSchedulerPostTaskSelfAbort = 5280,
kV8Window_Window_AttributeGetter = 5281,
kV8Window_Self_AttributeGetter = 5282,
kV8Window_Self_AttributeSetter = 5283,
kV8Window_Location_AttributeGetter = 5284,
kV8Window_Location_AttributeSetter = 5285,
kV8Window_Frames_AttributeGetter = 5286,
kV8Window_Frames_AttributeSetter = 5287,
kV8Window_Length_AttributeGetter = 5288,
kV8Window_Length_AttributeSetter = 5289,
kV8Window_Top_AttributeGetter = 5290,
kV8Window_Opener_AttributeGetter = 5291,
kV8Window_Opener_AttributeSetter = 5292,
kV8Window_Parent_AttributeGetter = 5293,
kV8Window_Parent_AttributeSetter = 5294,
kV8Window_Blur_Method = 5295,
kV8Window_Close_Method = 5296,
kV8Window_Focus_Method = 5297,
kV8Window_PostMessage_Method = 5298,
kWindowProxyIndexedGetter = 5300,
kWindowProxyNamedGetter = 5301,
kPrivateNetworkAccessInsecureResourceNotKnownPrivate = 5319,
// Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots. Also don't add extra
// spaces or comments in this file. Comments belong next to the usage of
// these constants in code.
// Also, run update_use_counter_feature_enum.py in
// chromium/src/tools/metrics/histograms/ to update the UMA mapping.
// Also, run
// chromium/src/tools/metrics/histograms/update_use_counter_feature_enum.py
// to update the UMA mapping.
};
// LINT.ThenChange(//tools/metrics/histograms/enums.xml:FeatureObserver)
// LINT.ThenChange(//tools/metrics/histograms/metadata/blink/enums.xml:FeatureObserver)
@@ -3,7 +3,7 @@
// found in the LICENSE file.
// https://drafts.csswg.org/css-fonts-4/#om-fontfeaturevalues
[Exposed(Window ExposeCSSFontFeatureValuesRule)]
interface CSSFontFeatureValuesRule : CSSRule {
attribute CSSOMString fontFamily;
@@ -0,0 +1,9 @@
// Copyright 2025 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-mixins-1/#cssfunctiondeclarations
[Exposed=Window, ImplementedAs=CSSFunctionDeclarationsRule, RuntimeEnabled=CSSFunctions]
interface CSSFunctionDeclarations : CSSRule {
[SameObject, PutForwards=cssText] readonly attribute CSSFunctionDescriptors style;
};
@@ -0,0 +1,9 @@
// Copyright 2025 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-mixins-1/#cssfunctiondescriptors
[Exposed=Window, RuntimeEnabled=CSSFunctions]
interface CSSFunctionDescriptors : CSSStyleDeclaration {
[SetterCallWith=ExecutionContext, RaisesException=Setter] attribute CSSOMString result;
};
@@ -0,0 +1,17 @@
// Copyright 2025 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
dictionary FunctionParameter {
required CSSOMString name;
required CSSOMString type;
CSSOMString defaultValue;
};
// https://drafts.csswg.org/css-mixins-1/#cssfunctionrule
[Exposed=Window, RuntimeEnabled=CSSFunctions]
interface CSSFunctionRule : CSSGroupingRule {
readonly attribute CSSOMString name;
sequence<FunctionParameter> getParameters();
readonly attribute CSSOMString returnType;
};
@@ -26,7 +26,10 @@
readonly attribute boolean aborted;
[CallWith=ScriptState] readonly attribute any reason;
[MeasureAs=AbortSignalThrowIfAborted] void throwIfAborted();
[
CallWith=Isolate,
MeasureAs=AbortSignalThrowIfAborted
] void throwIfAborted();
attribute EventHandler onabort;
};
@@ -11,5 +11,5 @@ interface ChildNodePart : Part {
readonly attribute Node previousSibling;
readonly attribute Node nextSibling;
readonly attribute FrozenArray<Node> children;
[RaisesException] void replaceChildren((Node or DOMString or TrustedScript)... nodes);
[RaisesException] void replaceChildren((Node or DOMString)... nodes);
};
@@ -5,5 +5,4 @@
[RuntimeEnabled=HTMLInterestTargetAttribute]
interface mixin InterestInvokerElement {
[CEReactions,Reflect=interesttarget] attribute Element? interestTargetElement;
[CEReactions,Reflect=interestaction] attribute DOMString interestAction;
};
@@ -7,11 +7,9 @@
Exposed=Window
] interface InterestEvent : Event {
constructor(DOMString type, optional InterestEventInit eventInitDict = {});
readonly attribute Element? invoker;
readonly attribute DOMString action;
readonly attribute Element? source;
};
dictionary InterestEventInit : EventInit {
Element? invoker = null;
DOMString action = "";
Element? source = null;
};
@@ -32,6 +32,7 @@
#include <algorithm>
#include <memory>
#include <utility>
#include <vector>
#include "base/command_line.h"
#include "base/debug/crash_logging.h"
@@ -67,7 +68,6 @@
#include "third_party/blink/public/platform/web_runtime_features.h"
#include "third_party/blink/public/platform/web_text_input_info.h"
#include "third_party/blink/public/platform/web_url_request.h"
#include "third_party/blink/public/platform/web_vector.h"
#include "third_party/blink/public/web/web_autofill_client.h"
#include "third_party/blink/public/web/web_console_message.h"
#include "third_party/blink/public/web/web_element.h"
@@ -2537,11 +2537,11 @@ void WebViewImpl::SetPageLifecycleStateInternal(
if (restoring_from_bfcache) {
DCHECK(page_restore_params);
// Update the history offset and length value, as pages that are kept in
// Update the history index and length value, as pages that are kept in
// the back-forward cache do not get notified about updates on these
// values, so the currently saved value might be stale.
SetHistoryOffsetAndLength(page_restore_params->pending_history_list_offset,
page_restore_params->current_history_list_length);
SetHistoryIndexAndLength(page_restore_params->pending_history_list_index,
page_restore_params->current_history_list_length);
}
if (eviction_changed)
HookBackForwardCacheEviction(new_state->eviction_enabled);
@@ -3579,38 +3579,38 @@ void WebViewImpl::UpdateRendererPreferences(
MaybePreloadSystemFonts(GetPage());
}
void WebViewImpl::SetHistoryOffsetAndLength(int32_t history_offset,
int32_t history_length) {
// -1 <= history_offset < history_length <= kMaxSessionHistoryEntries.
DCHECK_LE(-1, history_offset);
DCHECK_LT(history_offset, history_length);
void WebViewImpl::SetHistoryIndexAndLength(int32_t history_index,
int32_t history_length) {
// -1 <= history_index < history_length <= kMaxSessionHistoryEntries.
DCHECK_LE(-1, history_index);
DCHECK_LT(history_index, history_length);
DCHECK_LE(history_length, kMaxSessionHistoryEntries);
history_list_offset_ = history_offset;
history_list_index_ = history_index;
history_list_length_ = history_length;
}
void WebViewImpl::SetHistoryListFromNavigation(
int32_t history_offset,
int32_t history_index,
std::optional<int32_t> history_length) {
if (!history_length.has_value()) {
history_list_offset_ = history_offset;
history_list_index_ = history_index;
return;
}
SetHistoryOffsetAndLength(history_offset, *history_length);
SetHistoryIndexAndLength(history_index, *history_length);
}
void WebViewImpl::IncreaseHistoryListFromNavigation() {
// Advance our offset in session history, applying the length limit.
// Advance our index in session history, applying the length limit.
// There is now no forward history.
history_list_offset_ =
std::min(history_list_offset_ + 1, kMaxSessionHistoryEntries - 1);
history_list_length_ = history_list_offset_ + 1;
history_list_index_ =
std::min(history_list_index_ + 1, kMaxSessionHistoryEntries - 1);
history_list_length_ = history_list_index_ + 1;
}
int32_t WebViewImpl::HistoryBackListCount() const {
return std::max(history_list_offset_, 0);
return std::max(history_list_index_, 0);
}
int32_t WebViewImpl::HistoryForwardListCount() const {
@@ -4101,7 +4101,7 @@ void WebViewImpl::DraggableRegionsChanged() {
return;
}
WebVector<WebDraggableRegion> web_regions =
std::vector<WebDraggableRegion> web_regions =
MainFrameImpl()->GetDocument().DraggableRegions();
// If |supports_draggable_regions_| is false, the web view should only send
@@ -32,7 +32,7 @@ dictionary RequestInit {
// available in secure contexts, this has to be enforced after the fact
// because the SecureContext IDL attribute doesn't affect dictionary members.
[RuntimeEnabled=PrivateStateTokens] PrivateToken privateToken;
[RuntimeEnabled=AttributionReportingInterface] AttributionReportingRequestOptions attributionReporting;
[RuntimeEnabled=AttributionReporting] AttributionReportingRequestOptions attributionReporting;
// TODO(domfarolino): add support for RequestInit window member.
//any window; // can only be set to null
};
@@ -13,5 +13,6 @@
readonly attribute unsigned long? columnNumber;
readonly attribute DOMString disposition;
readonly attribute DOMString? message;
[RuntimeEnabled=PotentialPermissionsPolicyReporting] readonly attribute DOMString? allowAttribute;
[CallWith=ScriptState] object toJSON();
};
@@ -36,11 +36,11 @@
] interface Window : WindowProperties {
// the current browsing context
// FIXME: The spec uses the WindowProxy type for this and many other attributes.
[LegacyUnforgeable, CrossOrigin, CachedAccessor=kWindowProxy] readonly attribute Window window;
[Replaceable, CrossOrigin, CachedAccessor=kWindowProxy] readonly attribute Window self;
[LegacyUnforgeable, CrossOrigin, CachedAccessor=kWindowProxy, Measure] readonly attribute Window window;
[Replaceable, CrossOrigin, CachedAccessor=kWindowProxy, Measure] readonly attribute Window self;
[LegacyUnforgeable, CachedAccessor=kWindowDocument] readonly attribute Document document;
attribute DOMString name;
[PutForwards=href, LegacyUnforgeable, CrossOrigin=(Getter,Setter)] readonly attribute Location location;
[PutForwards=href, LegacyUnforgeable, CrossOrigin=(Getter,Setter), Measure] readonly attribute Location location;
[CallWith=ScriptState] readonly attribute CustomElementRegistry customElements;
readonly attribute History history;
[Replaceable] readonly attribute Navigation navigation;
@@ -51,19 +51,19 @@
[Replaceable, MeasureAs=BarPropStatusbar] readonly attribute BarProp statusbar;
[Replaceable, MeasureAs=BarPropToolbar] readonly attribute BarProp toolbar;
attribute DOMString status;
[CrossOrigin, CallWith=Isolate] void close();
[CrossOrigin, CallWith=Isolate, Measure] void close();
[MeasureAs=WindowClosed, CrossOrigin] readonly attribute boolean closed;
void stop();
[CrossOrigin, CallWith=Isolate] void focus();
[CrossOrigin] void blur();
[CrossOrigin, CallWith=Isolate, Measure] void focus();
[CrossOrigin, Measure] void blur();
// other browsing contexts
[Replaceable, CrossOrigin, CachedAccessor=kWindowProxy] readonly attribute Window frames;
[Replaceable, CrossOrigin] readonly attribute unsigned long length;
[LegacyUnforgeable, CrossOrigin] readonly attribute Window? top;
[Replaceable, CrossOrigin, CachedAccessor=kWindowProxy, Measure] readonly attribute Window frames;
[Replaceable, CrossOrigin, Measure] readonly attribute unsigned long length;
[LegacyUnforgeable, CrossOrigin, Measure] readonly attribute Window? top;
// FIXME: opener should be of type any.
[CrossOrigin, ImplementedAs=openerForBindings, CallWith=Isolate, RaisesException=Setter] attribute any opener;
[Replaceable, CrossOrigin] readonly attribute Window? parent;
[CrossOrigin, ImplementedAs=openerForBindings, CallWith=Isolate, RaisesException=Setter, Measure] attribute any opener;
[Replaceable, CrossOrigin, Measure] readonly attribute Window? parent;
[CheckSecurity=ReturnValue] readonly attribute Element? frameElement;
[CallWith=Isolate, RaisesException] Window? open(optional USVString url="", optional DOMString target = "_blank", optional [LegacyNullToEmptyString] DOMString features = "");
@@ -90,9 +90,9 @@
[Measure, CallWith=ScriptState] DOMString? prompt(optional DOMString message = "", optional DOMString defaultValue = "");
[Measure, CallWith=ScriptState] void print();
[CrossOrigin, CallWith=Isolate, RaisesException] void postMessage(any message, USVString targetOrigin, optional sequence<object> transfer = []);
[CrossOrigin, CallWith=Isolate, RaisesException, Measure] void postMessage(any message, USVString targetOrigin, optional sequence<object> transfer = []);
[CrossOrigin, CallWith=Isolate, RaisesException] void postMessage(any message, optional WindowPostMessageOptions options = {});
[CrossOrigin, CallWith=Isolate, RaisesException, Measure] void postMessage(any message, optional WindowPostMessageOptions options = {});
// WindowOrWorkerGlobalScope mixin
// https://html.spec.whatwg.org/C/#windoworworkerglobalscope-mixin
@@ -43,6 +43,6 @@ typedef (Uint8ClampedArray or Uint16Array or Float32Array) ImageDataArray;
readonly attribute unsigned long width;
readonly attribute unsigned long height;
readonly attribute PredefinedColorSpace colorSpace;
[RuntimeEnabled=CanvasFloatingPoint] readonly attribute ImageDataStorageFormat storageFormat;
[RuntimeEnabled=ImageDataPixelFormat] readonly attribute ImageDataStorageFormat storageFormat;
readonly attribute ImageDataArray data;
};
@@ -19,5 +19,5 @@ enum ImageDataStorageFormat {
dictionary ImageDataSettings {
PredefinedColorSpace colorSpace;
[RuntimeEnabled=CanvasFloatingPoint] ImageDataStorageFormat storageFormat = "uint8";
[RuntimeEnabled=ImageDataPixelFormat] ImageDataStorageFormat storageFormat = "uint8";
};
@@ -2,20 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
enum ImageColorSpace {
"srgb", // default
"rec2020",
"display-p3",
};
enum ImagePixelFormat {
"uint8", // default
"uint16",
};
dictionary ImageEncodeOptions {
DOMString type = "image/png";
unrestricted double quality = 1.0;
ImageColorSpace colorSpace = "srgb";
ImagePixelFormat pixelFormat = "uint8";
};
@@ -44,9 +44,9 @@ interface TextMetrics {
readonly attribute double fontBoundingBoxDescent;
readonly attribute double actualBoundingBoxAscent;
readonly attribute double actualBoundingBoxDescent;
[RuntimeEnabled=TextMetricsBaselines, MeasureAs="WebDXFeature::kCanvasTextBaselines"] readonly attribute double hangingBaseline;
[RuntimeEnabled=TextMetricsBaselines, MeasureAs="WebDXFeature::kCanvasTextBaselines"] readonly attribute double alphabeticBaseline;
[RuntimeEnabled=TextMetricsBaselines, MeasureAs="WebDXFeature::kCanvasTextBaselines"] readonly attribute double ideographicBaseline;
[RuntimeEnabled=TextMetricsBaselines] readonly attribute double hangingBaseline;
[RuntimeEnabled=TextMetricsBaselines] readonly attribute double alphabeticBaseline;
[RuntimeEnabled=TextMetricsBaselines] readonly attribute double ideographicBaseline;
[RuntimeEnabled=ExtendedTextMetrics] readonly attribute double emHeightAscent;
[RuntimeEnabled=ExtendedTextMetrics] readonly attribute double emHeightDescent;
@@ -113,4 +113,3 @@ enum SelectionMode { "select", "start", "end", "preserve" };
};
HTMLInputElement includes PopoverInvokerElement;
HTMLInputElement includes InterestInvokerElement;
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[RuntimeEnabled=AttributionReportingInterface]
[RuntimeEnabled=AttributionReporting]
interface mixin HTMLAttributionSrcElementUtils {
[CEReactions, Reflect, SecureContext] attribute USVString attributionSrc;
};
@@ -44,6 +44,9 @@
// https://w3c.github.io/webappsec-subresource-integrity/#HTMLScriptElement
[Reflect] attribute DOMString integrity;
// https://mikewest.github.io/inline-integrity/
[Reflect, RuntimeEnabled=SignatureBasedInlineIntegrity] attribute DOMString signature;
// https://html.spec.whatwg.org/multipage/scripting.html#dom-script-supports
[Measure] static boolean supports(DOMString type);
@@ -33,6 +33,7 @@
#include "third_party/blink/renderer/core/workers/worklet_global_scope.h"
#include "third_party/blink/renderer/platform/bindings/origin_trial_features.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/instrumentation/resource_coordinator/document_resource_coordinator.h"
#include "third_party/blink/renderer/platform/runtime_feature_state/runtime_feature_state_override_context.h"
#include "third_party/blink/renderer/platform/weborigin/security_origin.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
@@ -29,18 +29,18 @@
Exposed=Window
] interface SVGComponentTransferFunctionElement : SVGElement {
// Component Transfer Types
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_TABLE = 2;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE = 3;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_LINEAR = 4;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_GAMMA = 5;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_TABLE = 2;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE = 3;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_LINEAR = 4;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_GAMMA = 5;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedEnumeration type;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumberList tableValues;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber slope;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber intercept;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber amplitude;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber exponent;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber offset;
readonly attribute SVGAnimatedEnumeration type;
readonly attribute SVGAnimatedNumberList tableValues;
readonly attribute SVGAnimatedNumber slope;
readonly attribute SVGAnimatedNumber intercept;
readonly attribute SVGAnimatedNumber amplitude;
readonly attribute SVGAnimatedNumber exponent;
readonly attribute SVGAnimatedNumber offset;
};
@@ -30,27 +30,27 @@
] interface SVGFEBlendElement : SVGElement {
// Blend Mode Types
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FEBLEND_MODE_UNKNOWN = 0;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FEBLEND_MODE_NORMAL = 1;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FEBLEND_MODE_MULTIPLY = 2;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FEBLEND_MODE_SCREEN = 3;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FEBLEND_MODE_DARKEN = 4;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FEBLEND_MODE_LIGHTEN = 5;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FEBLEND_MODE_OVERLAY = 6;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FEBLEND_MODE_COLOR_DODGE = 7;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FEBLEND_MODE_COLOR_BURN = 8;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FEBLEND_MODE_HARD_LIGHT = 9;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FEBLEND_MODE_SOFT_LIGHT = 10;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FEBLEND_MODE_DIFFERENCE = 11;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FEBLEND_MODE_EXCLUSION = 12;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FEBLEND_MODE_HUE = 13;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FEBLEND_MODE_SATURATION = 14;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FEBLEND_MODE_COLOR = 15;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FEBLEND_MODE_LUMINOSITY = 16;
const unsigned short SVG_FEBLEND_MODE_UNKNOWN = 0;
const unsigned short SVG_FEBLEND_MODE_NORMAL = 1;
const unsigned short SVG_FEBLEND_MODE_MULTIPLY = 2;
const unsigned short SVG_FEBLEND_MODE_SCREEN = 3;
const unsigned short SVG_FEBLEND_MODE_DARKEN = 4;
const unsigned short SVG_FEBLEND_MODE_LIGHTEN = 5;
const unsigned short SVG_FEBLEND_MODE_OVERLAY = 6;
const unsigned short SVG_FEBLEND_MODE_COLOR_DODGE = 7;
const unsigned short SVG_FEBLEND_MODE_COLOR_BURN = 8;
const unsigned short SVG_FEBLEND_MODE_HARD_LIGHT = 9;
const unsigned short SVG_FEBLEND_MODE_SOFT_LIGHT = 10;
const unsigned short SVG_FEBLEND_MODE_DIFFERENCE = 11;
const unsigned short SVG_FEBLEND_MODE_EXCLUSION = 12;
const unsigned short SVG_FEBLEND_MODE_HUE = 13;
const unsigned short SVG_FEBLEND_MODE_SATURATION = 14;
const unsigned short SVG_FEBLEND_MODE_COLOR = 15;
const unsigned short SVG_FEBLEND_MODE_LUMINOSITY = 16;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in2;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedEnumeration mode;
readonly attribute SVGAnimatedString in1;
readonly attribute SVGAnimatedString in2;
readonly attribute SVGAnimatedEnumeration mode;
};
SVGFEBlendElement includes SVGFilterPrimitiveStandardAttributes;
@@ -29,15 +29,15 @@
Exposed=Window
] interface SVGFEColorMatrixElement : SVGElement {
// Color Matrix Types
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOLORMATRIX_TYPE_UNKNOWN = 0;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOLORMATRIX_TYPE_MATRIX = 1;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOLORMATRIX_TYPE_SATURATE = 2;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOLORMATRIX_TYPE_HUEROTATE = 3;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4;
const unsigned short SVG_FECOLORMATRIX_TYPE_UNKNOWN = 0;
const unsigned short SVG_FECOLORMATRIX_TYPE_MATRIX = 1;
const unsigned short SVG_FECOLORMATRIX_TYPE_SATURATE = 2;
const unsigned short SVG_FECOLORMATRIX_TYPE_HUEROTATE = 3;
const unsigned short SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedEnumeration type;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumberList values;
readonly attribute SVGAnimatedString in1;
readonly attribute SVGAnimatedEnumeration type;
readonly attribute SVGAnimatedNumberList values;
};
SVGFEColorMatrixElement includes SVGFilterPrimitiveStandardAttributes;
@@ -28,7 +28,7 @@
[
Exposed=Window
] interface SVGFEComponentTransferElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
readonly attribute SVGAnimatedString in1;
};
SVGFEComponentTransferElement includes SVGFilterPrimitiveStandardAttributes;
@@ -29,21 +29,21 @@
Exposed=Window
] interface SVGFECompositeElement : SVGElement {
// Composite Operators
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOMPOSITE_OPERATOR_UNKNOWN = 0;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOMPOSITE_OPERATOR_OVER = 1;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOMPOSITE_OPERATOR_IN = 2;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOMPOSITE_OPERATOR_OUT = 3;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOMPOSITE_OPERATOR_ATOP = 4;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOMPOSITE_OPERATOR_XOR = 5;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_FECOMPOSITE_OPERATOR_ARITHMETIC = 6;
const unsigned short SVG_FECOMPOSITE_OPERATOR_UNKNOWN = 0;
const unsigned short SVG_FECOMPOSITE_OPERATOR_OVER = 1;
const unsigned short SVG_FECOMPOSITE_OPERATOR_IN = 2;
const unsigned short SVG_FECOMPOSITE_OPERATOR_OUT = 3;
const unsigned short SVG_FECOMPOSITE_OPERATOR_ATOP = 4;
const unsigned short SVG_FECOMPOSITE_OPERATOR_XOR = 5;
const unsigned short SVG_FECOMPOSITE_OPERATOR_ARITHMETIC = 6;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in2;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
[ImplementedAs=svgOperator, MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedEnumeration operator;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber k1;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber k2;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber k3;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber k4;
readonly attribute SVGAnimatedString in2;
readonly attribute SVGAnimatedString in1;
[ImplementedAs=svgOperator] readonly attribute SVGAnimatedEnumeration operator;
readonly attribute SVGAnimatedNumber k1;
readonly attribute SVGAnimatedNumber k2;
readonly attribute SVGAnimatedNumber k3;
readonly attribute SVGAnimatedNumber k4;
};
SVGFECompositeElement includes SVGFilterPrimitiveStandardAttributes;
@@ -29,22 +29,22 @@
Exposed=Window
] interface SVGFEConvolveMatrixElement : SVGElement {
// Edge Mode Values
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_EDGEMODE_UNKNOWN = 0;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_EDGEMODE_DUPLICATE = 1;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_EDGEMODE_WRAP = 2;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_EDGEMODE_NONE = 3;
const unsigned short SVG_EDGEMODE_UNKNOWN = 0;
const unsigned short SVG_EDGEMODE_DUPLICATE = 1;
const unsigned short SVG_EDGEMODE_WRAP = 2;
const unsigned short SVG_EDGEMODE_NONE = 3;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedInteger orderX;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedInteger orderY;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumberList kernelMatrix;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber divisor;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber bias;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedInteger targetX;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedInteger targetY;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedEnumeration edgeMode;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber kernelUnitLengthX;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber kernelUnitLengthY;
readonly attribute SVGAnimatedString in1;
readonly attribute SVGAnimatedInteger orderX;
readonly attribute SVGAnimatedInteger orderY;
readonly attribute SVGAnimatedNumberList kernelMatrix;
readonly attribute SVGAnimatedNumber divisor;
readonly attribute SVGAnimatedNumber bias;
readonly attribute SVGAnimatedInteger targetX;
readonly attribute SVGAnimatedInteger targetY;
readonly attribute SVGAnimatedEnumeration edgeMode;
readonly attribute SVGAnimatedNumber kernelUnitLengthX;
readonly attribute SVGAnimatedNumber kernelUnitLengthY;
[Measure] readonly attribute SVGAnimatedBoolean preserveAlpha;
};
@@ -28,11 +28,11 @@
[
Exposed=Window
] interface SVGFEDiffuseLightingElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber surfaceScale;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber diffuseConstant;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber kernelUnitLengthX;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber kernelUnitLengthY;
readonly attribute SVGAnimatedString in1;
readonly attribute SVGAnimatedNumber surfaceScale;
readonly attribute SVGAnimatedNumber diffuseConstant;
readonly attribute SVGAnimatedNumber kernelUnitLengthX;
readonly attribute SVGAnimatedNumber kernelUnitLengthY;
};
SVGFEDiffuseLightingElement includes SVGFilterPrimitiveStandardAttributes;
@@ -29,17 +29,17 @@
Exposed=Window
] interface SVGFEDisplacementMapElement : SVGElement {
// Channel Selectors
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_CHANNEL_UNKNOWN = 0;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_CHANNEL_R = 1;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_CHANNEL_G = 2;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_CHANNEL_B = 3;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_CHANNEL_A = 4;
const unsigned short SVG_CHANNEL_UNKNOWN = 0;
const unsigned short SVG_CHANNEL_R = 1;
const unsigned short SVG_CHANNEL_G = 2;
const unsigned short SVG_CHANNEL_B = 3;
const unsigned short SVG_CHANNEL_A = 4;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in2;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber scale;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedEnumeration xChannelSelector;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedEnumeration yChannelSelector;
readonly attribute SVGAnimatedString in1;
readonly attribute SVGAnimatedString in2;
readonly attribute SVGAnimatedNumber scale;
readonly attribute SVGAnimatedEnumeration xChannelSelector;
readonly attribute SVGAnimatedEnumeration yChannelSelector;
};
SVGFEDisplacementMapElement includes SVGFilterPrimitiveStandardAttributes;
@@ -28,6 +28,6 @@
[
Exposed=Window
] interface SVGFEDistantLightElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber azimuth;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber elevation;
readonly attribute SVGAnimatedNumber azimuth;
readonly attribute SVGAnimatedNumber elevation;
};
@@ -22,13 +22,13 @@
[
Exposed=Window
] interface SVGFEDropShadowElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber dx;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber dy;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber stdDeviationX;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber stdDeviationY;
readonly attribute SVGAnimatedString in1;
readonly attribute SVGAnimatedNumber dx;
readonly attribute SVGAnimatedNumber dy;
readonly attribute SVGAnimatedNumber stdDeviationX;
readonly attribute SVGAnimatedNumber stdDeviationY;
[MeasureAs=SVG1DOMFilter] void setStdDeviation(float stdDeviationX, float stdDeviationY);
void setStdDeviation(float stdDeviationX, float stdDeviationY);
};
SVGFEDropShadowElement includes SVGFilterPrimitiveStandardAttributes;
@@ -28,11 +28,11 @@
[
Exposed=Window
] interface SVGFEGaussianBlurElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber stdDeviationX;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber stdDeviationY;
readonly attribute SVGAnimatedString in1;
readonly attribute SVGAnimatedNumber stdDeviationX;
readonly attribute SVGAnimatedNumber stdDeviationY;
[MeasureAs=SVG1DOMFilter] void setStdDeviation(float stdDeviationX, float stdDeviationY);
void setStdDeviation(float stdDeviationX, float stdDeviationY);
};
SVGFEGaussianBlurElement includes SVGFilterPrimitiveStandardAttributes;
@@ -28,7 +28,7 @@
[
Exposed=Window
] interface SVGFEImageElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
};
SVGFEImageElement includes SVGFilterPrimitiveStandardAttributes;
@@ -28,5 +28,5 @@
[
Exposed=Window
] interface SVGFEMergeNodeElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
readonly attribute SVGAnimatedString in1;
};
@@ -29,14 +29,14 @@
Exposed=Window
] interface SVGFEMorphologyElement : SVGElement {
// Morphology Operators
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_MORPHOLOGY_OPERATOR_UNKNOWN = 0;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_MORPHOLOGY_OPERATOR_ERODE = 1;
[MeasureAs=SVG1DOMFilter] const unsigned short SVG_MORPHOLOGY_OPERATOR_DILATE = 2;
const unsigned short SVG_MORPHOLOGY_OPERATOR_UNKNOWN = 0;
const unsigned short SVG_MORPHOLOGY_OPERATOR_ERODE = 1;
const unsigned short SVG_MORPHOLOGY_OPERATOR_DILATE = 2;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
[ImplementedAs=svgOperator, MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedEnumeration operator;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber radiusX;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber radiusY;
readonly attribute SVGAnimatedString in1;
[ImplementedAs=svgOperator] readonly attribute SVGAnimatedEnumeration operator;
readonly attribute SVGAnimatedNumber radiusX;
readonly attribute SVGAnimatedNumber radiusY;
};
SVGFEMorphologyElement includes SVGFilterPrimitiveStandardAttributes;
@@ -28,9 +28,9 @@
[
Exposed=Window
] interface SVGFEOffsetElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedString in1;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber dx;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber dy;
readonly attribute SVGAnimatedString in1;
readonly attribute SVGAnimatedNumber dx;
readonly attribute SVGAnimatedNumber dy;
};
SVGFEOffsetElement includes SVGFilterPrimitiveStandardAttributes;
@@ -28,7 +28,7 @@
[
Exposed=Window
] interface SVGFEPointLightElement : SVGElement {
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber x;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber y;
[MeasureAs=SVG1DOMFilter] readonly attribute SVGAnimatedNumber z;
readonly attribute SVGAnimatedNumber x;
readonly attribute SVGAnimatedNumber y;
readonly attribute SVGAnimatedNumber z;
};

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