#include "content/public/browser/content_browser_client.h"
#include <optional>
#include <string_view>
#include <utility>
#include "base/check.h"
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/functional/callback_helpers.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/values.h"
#include "build/build_config.h"
#include "build/buildflag.h"
#include "build/chromeos_buildflags.h"
#include "content/browser/ai/echo_ai_manager_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/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"
#include "content/public/browser/navigation_throttle.h"
#include "content/public/browser/navigation_ui_data.h"
#include "content/public/browser/network_service_instance.h"
#include "content/public/browser/overlay_window.h"
#include "content/public/browser/page_navigator.h"
#include "content/public/browser/prefetch_service_delegate.h"
#include "content/public/browser/prerender_web_contents_delegate.h"
#include "content/public/browser/private_network_device_delegate.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/responsiveness_calculator_delegate.h"
#include "content/public/browser/sms_fetcher.h"
#include "content/public/browser/speculation_host_delegate.h"
#include "content/public/browser/tracing_delegate.h"
#include "content/public/browser/url_loader_request_interceptor.h"
#include "content/public/browser/vpn_service_proxy.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view_delegate.h"
#include "content/public/common/alternative_error_page_override_info.mojom.h"
#include "content/public/common/content_features.h"
#include "content/public/common/url_utils.h"
#include "media/audio/audio_manager.h"
#include "media/capture/content/screen_enumerator.h"
#include "media/mojo/mojom/media_service.mojom.h"
#include "mojo/public/cpp/bindings/message.h"
#include "net/base/isolation_info.h"
#include "net/cookies/site_for_cookies.h"
#include "net/ssl/client_cert_identity.h"
#include "net/ssl/client_cert_store.h"
#include "sandbox/policy/features.h"
#include "sandbox/policy/mojom/sandbox.mojom.h"
#include "services/cert_verifier/public/mojom/cert_verifier_service_factory.mojom.h"
#include "services/device/public/cpp/geolocation/location_provider.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "services/network/public/mojom/network_service.mojom.h"
#include "services/network/public/mojom/web_transport.mojom.h"
#include "storage/browser/quota/quota_manager.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/loader/url_loader_throttle.h"
#include "third_party/blink/public/common/renderer_preferences/renderer_preferences.h"
#include "third_party/blink/public/common/user_agent/user_agent_metadata.h"
#include "third_party/blink/public/mojom/browsing_topics/browsing_topics.mojom.h"
#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 "ui/gfx/image/image_skia.h"
#include "ui/shell_dialogs/select_file_policy.h"
#include "url/gurl.h"
#include "url/origin.h"
#if BUILDFLAG(IS_ANDROID)
#include "content/public/browser/tts_environment_android.h"
#else
#include "services/video_effects/public/mojom/video_effects_processor.mojom-forward.h"
#include "third_party/blink/public/mojom/installedapp/related_application.mojom.h"
#endif
AttributionReportType;
namespace content {
std::unique_ptr<BrowserMainParts> ContentBrowserClient::CreateBrowserMainParts(
bool ) { … }
void ContentBrowserClient::PostAfterStartupTask(
const base::Location& from_here,
const scoped_refptr<base::SequencedTaskRunner>& task_runner,
base::OnceClosure task) { … }
bool ContentBrowserClient::IsBrowserStartupComplete() { … }
void ContentBrowserClient::SetBrowserStartupIsCompleteForTesting() { … }
std::unique_ptr<WebContentsViewDelegate>
ContentBrowserClient::GetWebContentsViewDelegate(WebContents* web_contents) { … }
bool ContentBrowserClient::IsShuttingDown() { … }
void ContentBrowserClient::ThreadPoolWillTerminate() { … }
bool ContentBrowserClient::AllowGpuLaunchRetryOnIOThread() { … }
bool ContentBrowserClient::CanShutdownGpuProcessNowOnIOThread() { … }
GURL ContentBrowserClient::GetEffectiveURL(BrowserContext* browser_context,
const GURL& url) { … }
bool ContentBrowserClient::ShouldCompareEffectiveURLsForSiteInstanceSelection(
BrowserContext* browser_context,
content::SiteInstance* candidate_site_instance,
bool is_outermost_main_frame,
const GURL& candidate_url,
const GURL& destination_url) { … }
bool ContentBrowserClient::IsExplicitNavigation(ui::PageTransition transition) { … }
bool ContentBrowserClient::ShouldUseProcessPerSite(
BrowserContext* browser_context,
const GURL& site_url) { … }
bool ContentBrowserClient::ShouldAllowProcessPerSiteForMultipleMainFrames(
BrowserContext* context) { … }
std::optional<ContentBrowserClient::SpareProcessRefusedByEmbedderReason>
ContentBrowserClient::ShouldUseSpareRenderProcessHost(
BrowserContext* browser_context,
const GURL& site_url) { … }
bool ContentBrowserClient::DoesSiteRequireDedicatedProcess(
BrowserContext* browser_context,
const GURL& effective_site_url) { … }
bool ContentBrowserClient::ShouldAllowCrossProcessSandboxedFrameForPrecursor(
BrowserContext* browser_context,
const GURL& precursor,
const GURL& url) { … }
bool ContentBrowserClient::ShouldLockProcessToSite(
BrowserContext* browser_context,
const GURL& effective_url) { … }
bool ContentBrowserClient::ShouldEnforceNewCanCommitUrlChecks() { … }
bool ContentBrowserClient::DoesWebUIUrlRequireProcessLock(const GURL& url) { … }
bool ContentBrowserClient::ShouldTreatURLSchemeAsFirstPartyWhenTopLevel(
std::string_view scheme,
bool is_embedded_origin_secure) { … }
bool ContentBrowserClient::ShouldIgnoreSameSiteCookieRestrictionsWhenTopLevel(
std::string_view scheme,
bool is_embedded_origin_secure) { … }
std::string ContentBrowserClient::GetSiteDisplayNameForCdmProcess(
BrowserContext* browser_context,
const GURL& site_url) { … }
void ContentBrowserClient::OverrideURLLoaderFactoryParams(
BrowserContext* browser_context,
const url::Origin& origin,
bool is_for_isolated_world,
network::mojom::URLLoaderFactoryParams* factory_params) { … }
void ContentBrowserClient::GetAdditionalViewSourceSchemes(
std::vector<std::string>* additional_schemes) { … }
network::mojom::IPAddressSpace
ContentBrowserClient::DetermineAddressSpaceFromURL(const GURL& url) { … }
bool ContentBrowserClient::LogWebUIUrl(const GURL& web_ui_url) { … }
bool ContentBrowserClient::IsWebUIAllowedToMakeNetworkRequests(
const url::Origin& origin) { … }
bool ContentBrowserClient::IsHandledURL(const GURL& url) { … }
bool ContentBrowserClient::HasCustomSchemeHandler(
content::BrowserContext* browser_context,
const std::string& scheme) { … }
bool ContentBrowserClient::CanCommitURL(RenderProcessHost* process_host,
const GURL& site_url) { … }
bool ContentBrowserClient::ShouldStayInParentProcessForNTP(
const GURL& url,
const GURL& parent_site_url) { … }
bool ContentBrowserClient::IsSuitableHost(RenderProcessHost* process_host,
const GURL& site_url) { … }
bool ContentBrowserClient::MayReuseHost(RenderProcessHost* process_host) { … }
size_t ContentBrowserClient::GetProcessCountToIgnoreForLimit() { … }
std::optional<blink::ParsedPermissionsPolicy>
ContentBrowserClient::GetPermissionsPolicyForIsolatedWebApp(
WebContents* web_contents,
const url::Origin& app_origin) { … }
bool ContentBrowserClient::ShouldTryToUseExistingProcessHost(
BrowserContext* browser_context,
const GURL& url) { … }
bool ContentBrowserClient::ShouldEmbeddedFramesTryToReuseExistingProcess(
RenderFrameHost* outermost_main_frame) { … }
bool ContentBrowserClient::ShouldAllowNoLongerUsedProcessToExit() { … }
bool ContentBrowserClient::ShouldSwapBrowsingInstancesForNavigation(
SiteInstance* site_instance,
const GURL& current_effective_url,
const GURL& destination_effective_url) { … }
bool ContentBrowserClient::ShouldIsolateErrorPage(bool in_main_frame) { … }
std::unique_ptr<media::AudioManager> ContentBrowserClient::CreateAudioManager(
media::AudioLogFactory* audio_log_factory) { … }
std::unique_ptr<media::ScreenEnumerator>
ContentBrowserClient::CreateScreenEnumerator() const { … }
bool ContentBrowserClient::OverridesAudioManager() { … }
bool ContentBrowserClient::EnforceSystemAudioEchoCancellation() { … }
std::vector<url::Origin>
ContentBrowserClient::GetOriginsRequiringDedicatedProcess() { … }
bool ContentBrowserClient::ShouldEnableStrictSiteIsolation() { … }
bool ContentBrowserClient::ShouldDisableSiteIsolation(
SiteIsolationMode site_isolation_mode) { … }
std::vector<std::string>
ContentBrowserClient::GetAdditionalSiteIsolationModes() { … }
bool ContentBrowserClient::ShouldUrlUseApplicationIsolationLevel(
BrowserContext* browser_context,
const GURL& url) { … }
bool ContentBrowserClient::IsIsolatedContextAllowedForUrl(
BrowserContext* browser_context,
const GURL& lock_url) { … }
void ContentBrowserClient::CheckGetAllScreensMediaAllowed(
content::RenderFrameHost* render_frame_host,
base::OnceCallback<void(bool)> callback) { … }
size_t ContentBrowserClient::GetMaxRendererProcessCountOverride() { … }
bool ContentBrowserClient::IsFileAccessAllowed(
const base::FilePath& path,
const base::FilePath& absolute_path,
const base::FilePath& profile_path) { … }
bool ContentBrowserClient::ForceSniffingFileUrlsForHtml() { … }
std::string ContentBrowserClient::GetApplicationClientGUIDForQuarantineCheck() { … }
download::QuarantineConnectionCallback
ContentBrowserClient::GetQuarantineConnectionCallback() { … }
std::string ContentBrowserClient::GetApplicationLocale() { … }
std::string ContentBrowserClient::GetAcceptLangs(BrowserContext* context) { … }
gfx::ImageSkia ContentBrowserClient::GetDefaultFavicon() { … }
base::FilePath ContentBrowserClient::GetLoggingFileName(
const base::CommandLine& command_line) { … }
AllowServiceWorkerResult ContentBrowserClient::AllowServiceWorker(
const GURL& scope,
const net::SiteForCookies& site_for_cookies,
const std::optional<url::Origin>& top_frame_origin,
const GURL& script_url,
BrowserContext* context) { … }
bool ContentBrowserClient::MayDeleteServiceWorkerRegistration(
const GURL& scope,
BrowserContext* browser_context) { … }
bool ContentBrowserClient::ShouldTryToUpdateServiceWorkerRegistration(
const GURL& scope,
BrowserContext* browser_context) { … }
void ContentBrowserClient::UpdateEnabledBlinkRuntimeFeaturesInIsolatedWorker(
BrowserContext* context,
const GURL& script_url,
std::vector<std::string>& out_forced_enabled_runtime_features) { … }
bool ContentBrowserClient::AllowSharedWorker(
const GURL& worker_url,
const net::SiteForCookies& site_for_cookies,
const std::optional<url::Origin>& top_frame_origin,
const std::string& name,
const blink::StorageKey& storage_key,
const blink::mojom::SharedWorkerSameSiteCookies same_site_cookies,
BrowserContext* context,
int render_process_id,
int render_frame_id) { … }
bool ContentBrowserClient::DoesSchemeAllowCrossOriginSharedWorker(
const std::string& scheme) { … }
bool ContentBrowserClient::AllowSignedExchange(BrowserContext* context) { … }
bool ContentBrowserClient::AllowCompressionDictionaryTransport(
BrowserContext* context) { … }
bool ContentBrowserClient::OverrideWebPreferencesAfterNavigation(
WebContents* web_contents,
blink::web_pref::WebPreferences* prefs) { … }
bool ContentBrowserClient::IsDataSaverEnabled(BrowserContext* context) { … }
void ContentBrowserClient::UpdateRendererPreferencesForWorker(
BrowserContext* browser_context,
blink::RendererPreferences* out_prefs) { … }
void ContentBrowserClient::RequestFilesAccess(
const std::vector<base::FilePath>& files,
const GURL& destination_url,
base::OnceCallback<void(file_access::ScopedFileAccess)>
continuation_callback) { … }
void ContentBrowserClient::AllowWorkerFileSystem(
const GURL& url,
BrowserContext* browser_context,
const std::vector<GlobalRenderFrameHostId>& render_frames,
base::OnceCallback<void(bool)> callback) { … }
bool ContentBrowserClient::AllowWorkerIndexedDB(
const GURL& url,
BrowserContext* browser_context,
const std::vector<GlobalRenderFrameHostId>& render_frames) { … }
bool ContentBrowserClient::AllowWorkerCacheStorage(
const GURL& url,
BrowserContext* browser_context,
const std::vector<GlobalRenderFrameHostId>& render_frames) { … }
bool ContentBrowserClient::AllowWorkerWebLocks(
const GURL& url,
BrowserContext* browser_context,
const std::vector<GlobalRenderFrameHostId>& render_frames) { … }
ContentBrowserClient::AllowWebBluetoothResult
ContentBrowserClient::AllowWebBluetooth(
content::BrowserContext* browser_context,
const url::Origin& requesting_origin,
const url::Origin& embedding_origin) { … }
std::string ContentBrowserClient::GetWebBluetoothBlocklist() { … }
bool ContentBrowserClient::IsInterestGroupAPIAllowed(
content::RenderFrameHost* render_frame_host,
InterestGroupApiOperation operation,
const url::Origin& top_frame_origin,
const url::Origin& api_origin) { … }
bool ContentBrowserClient::IsPrivacySandboxReportingDestinationAttested(
content::BrowserContext* browser_context,
const url::Origin& destination_origin,
content::PrivacySandboxInvokingAPI invoking_api,
bool post_impression_reporting) { … }
void ContentBrowserClient::OnAuctionComplete(
RenderFrameHost* render_frame_host,
std::optional<content::InterestGroupManager::InterestGroupDataKey>
winner_data_key,
bool is_server_auction,
bool is_on_device_auction,
AuctionResult result) { … }
network::mojom::AttributionSupport ContentBrowserClient::GetAttributionSupport(
AttributionReportingOsApiState state,
bool client_os_disabled) { … }
bool ContentBrowserClient::IsAttributionReportingOperationAllowed(
content::BrowserContext* browser_context,
AttributionReportingOperation operation,
content::RenderFrameHost* rfh,
const url::Origin* source_origin,
const url::Origin* destination_origin,
const url::Origin* reporting_origin,
bool* can_bypass) { … }
ContentBrowserClient::AttributionReportingOsRegistrars
ContentBrowserClient::GetAttributionReportingOsRegistrars(
WebContents* web_contents) { … }
bool ContentBrowserClient::IsAttributionReportingAllowedForContext(
content::BrowserContext* browser_context,
content::RenderFrameHost* rfh,
const url::Origin& context_origin,
const url::Origin& reporting_origin) { … }
bool ContentBrowserClient::IsSharedStorageAllowed(
content::BrowserContext* browser_context,
content::RenderFrameHost* rfh,
const url::Origin& top_frame_origin,
const url::Origin& accessing_origin,
std::string* out_debug_message,
bool* out_block_is_site_setting_specific) { … }
bool ContentBrowserClient::IsSharedStorageSelectURLAllowed(
content::BrowserContext* browser_context,
const url::Origin& top_frame_origin,
const url::Origin& accessing_origin,
std::string* out_debug_message,
bool* out_block_is_site_setting_specific) { … }
bool ContentBrowserClient::IsPrivateAggregationAllowed(
content::BrowserContext* browser_context,
const url::Origin& top_frame_origin,
const url::Origin& reporting_origin,
bool* out_block_is_site_setting_specific) { … }
bool ContentBrowserClient::IsPrivateAggregationDebugModeAllowed(
content::BrowserContext* browser_context,
const url::Origin& top_frame_origin,
const url::Origin& reporting_origin) { … }
bool ContentBrowserClient::IsCookieDeprecationLabelAllowed(
content::BrowserContext* browser_context) { … }
bool ContentBrowserClient::IsCookieDeprecationLabelAllowedForContext(
content::BrowserContext* browser_context,
const url::Origin& top_frame_origin,
const url::Origin& context_origin) { … }
bool ContentBrowserClient::IsFullCookieAccessAllowed(
content::BrowserContext* browser_context,
content::WebContents* web_contents,
const GURL& url,
const blink::StorageKey& storage_key) { … }
bool ContentBrowserClient::CanSendSCTAuditingReport(
BrowserContext* browser_context) { … }
GeneratedCodeCacheSettings ContentBrowserClient::GetGeneratedCodeCacheSettings(
BrowserContext* context) { … }
std::string ContentBrowserClient::GetWebUIHostnameForCodeCacheMetrics(
const GURL& webui_url) const { … }
void ContentBrowserClient::AllowCertificateError(
WebContents* web_contents,
int cert_error,
const net::SSLInfo& ssl_info,
const GURL& request_url,
bool is_primary_main_frame_request,
bool strict_enforcement,
base::OnceCallback<void(CertificateRequestResultType)> callback) { … }
bool ContentBrowserClient::ShouldDenyRequestOnCertificateError(
const GURL main_frame_url) { … }
base::OnceClosure ContentBrowserClient::SelectClientCertificate(
BrowserContext* browser_context,
int process_id,
WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
net::ClientCertIdentityList client_certs,
std::unique_ptr<ClientCertificateDelegate> delegate) { … }
std::unique_ptr<device::LocationProvider>
ContentBrowserClient::OverrideSystemLocationProvider() { … }
scoped_refptr<network::SharedURLLoaderFactory>
ContentBrowserClient::GetSystemSharedURLLoaderFactory() { … }
network::mojom::NetworkContext*
ContentBrowserClient::GetSystemNetworkContext() { … }
std::string ContentBrowserClient::GetGeolocationApiKey() { … }
device::GeolocationSystemPermissionManager*
ContentBrowserClient::GetGeolocationSystemPermissionManager() { … }
#if BUILDFLAG(IS_ANDROID)
bool ContentBrowserClient::ShouldUseGmsCoreGeolocationProvider() {
return false;
}
#endif
StoragePartitionConfig ContentBrowserClient::GetStoragePartitionConfigForSite(
BrowserContext* browser_context,
const GURL& site) { … }
MediaObserver* ContentBrowserClient::GetMediaObserver() { … }
FeatureObserverClient* ContentBrowserClient::GetFeatureObserverClient() { … }
bool ContentBrowserClient::CanCreateWindow(
RenderFrameHost* opener,
const GURL& opener_url,
const GURL& opener_top_level_frame_url,
const url::Origin& source_origin,
content::mojom::WindowContainerType container_type,
const GURL& target_url,
const Referrer& referrer,
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
bool user_gesture,
bool opener_suppressed,
bool* no_javascript_access) { … }
SpeechRecognitionManagerDelegate*
ContentBrowserClient::CreateSpeechRecognitionManagerDelegate() { … }
#if BUILDFLAG(IS_CHROMEOS_ASH)
TtsControllerDelegate* ContentBrowserClient::GetTtsControllerDelegate() {
return nullptr;
}
#endif
TtsPlatform* ContentBrowserClient::GetTtsPlatform() { … }
#if !BUILDFLAG(IS_ANDROID)
DirectSocketsDelegate* ContentBrowserClient::GetDirectSocketsDelegate() { … }
#endif
base::FilePath ContentBrowserClient::GetDefaultDownloadDirectory() { … }
std::string ContentBrowserClient::GetDefaultDownloadName() { … }
base::FilePath ContentBrowserClient::GetShaderDiskCacheDirectory() { … }
base::FilePath ContentBrowserClient::GetGrShaderDiskCacheDirectory() { … }
base::FilePath ContentBrowserClient::GetGraphiteDawnDiskCacheDirectory() { … }
base::FilePath ContentBrowserClient::GetNetLogDefaultDirectory() { … }
base::FilePath ContentBrowserClient::GetFirstPartySetsDirectory() { … }
std::optional<base::FilePath> ContentBrowserClient::GetLocalTracesDirectory() { … }
BrowserPpapiHost* ContentBrowserClient::GetExternalBrowserPpapiHost(
int plugin_process_id) { … }
bool ContentBrowserClient::AllowPepperSocketAPI(
BrowserContext* browser_context,
const GURL& url,
bool private_api,
const SocketPermissionRequest* params) { … }
bool ContentBrowserClient::IsPepperVpnProviderAPIAllowed(
BrowserContext* browser_context,
const GURL& url) { … }
std::unique_ptr<VpnServiceProxy> ContentBrowserClient::GetVpnServiceProxy(
BrowserContext* browser_context) { … }
std::unique_ptr<ui::SelectFilePolicy>
ContentBrowserClient::CreateSelectFilePolicy(WebContents* web_contents) { … }
std::unique_ptr<content::DevToolsManagerDelegate>
ContentBrowserClient::CreateDevToolsManagerDelegate() { … }
void ContentBrowserClient::UpdateDevToolsBackgroundServiceExpiration(
BrowserContext* browser_context,
int service,
base::Time expiration_time) { … }
base::flat_map<int, base::Time>
ContentBrowserClient::GetDevToolsBackgroundServiceExpirations(
BrowserContext* browser_context) { … }
std::unique_ptr<TracingDelegate> ContentBrowserClient::CreateTracingDelegate() { … }
bool ContentBrowserClient::IsSystemWideTracingEnabled() { … }
bool ContentBrowserClient::IsPluginAllowedToCallRequestOSFileHandle(
BrowserContext* browser_context,
const GURL& url) { … }
bool ContentBrowserClient::IsPluginAllowedToUseDevChannelAPIs(
BrowserContext* browser_context,
const GURL& url) { … }
mojo::Remote<media::mojom::MediaService>
ContentBrowserClient::RunSecondaryMediaService() { … }
void ContentBrowserClient::RegisterAssociatedInterfaceBindersForRenderFrameHost(
RenderFrameHost& render_frame_host,
blink::AssociatedInterfaceRegistry& associated_registry) { … }
ControllerPresentationServiceDelegate*
ContentBrowserClient::GetControllerPresentationServiceDelegate(
WebContents* web_contents) { … }
ReceiverPresentationServiceDelegate*
ContentBrowserClient::GetReceiverPresentationServiceDelegate(
WebContents* web_contents) { … }
void ContentBrowserClient::AddPresentationObserver(
PresentationObserver* observer,
WebContents* web_contents) { … }
void ContentBrowserClient::RemovePresentationObserver(
PresentationObserver* observer,
WebContents* web_contents) { … }
bool ContentBrowserClient::AddPrivacySandboxAttestationsObserver(
PrivacySandboxAttestationsObserver* observer) { … }
void ContentBrowserClient::RemovePrivacySandboxAttestationsObserver(
PrivacySandboxAttestationsObserver* observer) { … }
void ContentBrowserClient::OpenURL(
content::SiteInstance* site_instance,
const content::OpenURLParams& params,
base::OnceCallback<void(content::WebContents*)> callback) { … }
std::vector<std::unique_ptr<NavigationThrottle>>
content::ContentBrowserClient::CreateThrottlesForNavigation(
NavigationHandle* navigation_handle) { … }
std::vector<std::unique_ptr<CommitDeferringCondition>>
ContentBrowserClient::CreateCommitDeferringConditionsForNavigation(
NavigationHandle* navigation_handle,
content::CommitDeferringCondition::NavigationType navigation_type) { … }
std::unique_ptr<NavigationUIData> ContentBrowserClient::GetNavigationUIData(
NavigationHandle* navigation_handle) { … }
#if BUILDFLAG(IS_WIN)
bool ContentBrowserClient::PreSpawnChild(sandbox::TargetConfig* config,
sandbox::mojom::Sandbox sandbox_type,
ChildSpawnFlags flags) {
return true;
}
bool ContentBrowserClient::IsUtilityCetCompatible(
const std::string& utility_sub_type) {
return true;
}
std::wstring ContentBrowserClient::GetAppContainerSidForSandboxType(
sandbox::mojom::Sandbox sandbox_type,
AppContainerFlags flags) {
return std::wstring(
L"S-1-15-2-3251537155-1984446955-2931258699-841473695-1938553385-"
L"924012148-129201922");
}
bool ContentBrowserClient::IsAppContainerDisabled(
sandbox::mojom::Sandbox sandbox_type) {
return false;
}
std::wstring ContentBrowserClient::GetLPACCapabilityNameForNetworkService() {
return std::wstring(L"lpacContentNetworkService");
}
bool ContentBrowserClient::IsRendererCodeIntegrityEnabled() {
return false;
}
bool ContentBrowserClient::IsPdfFontProxyEnabled() {
return false;
}
bool ContentBrowserClient::ShouldEnableAudioProcessHighPriority() {
return false;
}
bool ContentBrowserClient::ShouldUseSkiaFontManager(const GURL& site_url) {
return false;
}
#endif
std::vector<std::unique_ptr<blink::URLLoaderThrottle>>
ContentBrowserClient::CreateURLLoaderThrottles(
const network::ResourceRequest& request,
BrowserContext* browser_context,
const base::RepeatingCallback<WebContents*()>& wc_getter,
NavigationUIData* navigation_ui_data,
int frame_tree_node_id,
std::optional<int64_t> navigation_id) { … }
std::vector<std::unique_ptr<blink::URLLoaderThrottle>>
ContentBrowserClient::CreateURLLoaderThrottlesForKeepAlive(
const network::ResourceRequest& request,
BrowserContext* browser_context,
const base::RepeatingCallback<WebContents*()>& wc_getter,
int frame_tree_node_id) { … }
mojo::PendingRemote<network::mojom::URLLoaderFactory>
ContentBrowserClient::CreateNonNetworkNavigationURLLoaderFactory(
const std::string& scheme,
int frame_tree_node_id) { … }
void ContentBrowserClient::
RegisterNonNetworkWorkerMainResourceURLLoaderFactories(
BrowserContext* browser_context,
NonNetworkURLLoaderFactoryMap* factories) { … }
void ContentBrowserClient::
RegisterNonNetworkServiceWorkerUpdateURLLoaderFactories(
BrowserContext* browser_context,
NonNetworkURLLoaderFactoryMap* factories) { … }
void ContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories(
int render_process_id,
int render_frame_id,
const std::optional<url::Origin>& request_initiator_origin,
NonNetworkURLLoaderFactoryMap* factories) { … }
void ContentBrowserClient::WillCreateURLLoaderFactory(
BrowserContext* browser_context,
RenderFrameHost* frame,
int render_process_id,
URLLoaderFactoryType type,
const url::Origin& request_initiator,
const net::IsolationInfo& isolation_info,
std::optional<int64_t> navigation_id,
ukm::SourceIdObj ukm_source_id,
network::URLLoaderFactoryBuilder& factory_builder,
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
header_client,
bool* bypass_redirect_checks,
bool* disable_secure_dns,
network::mojom::URLLoaderFactoryOverridePtr* factory_override,
scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner) { … }
bool ContentBrowserClient::WillInterceptWebSocket(RenderFrameHost*) { … }
uint32_t ContentBrowserClient::GetWebSocketOptions(RenderFrameHost* frame) { … }
void ContentBrowserClient::CreateWebSocket(
RenderFrameHost* frame,
WebSocketFactory factory,
const GURL& url,
const net::SiteForCookies& site_for_cookies,
const std::optional<std::string>& user_agent,
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
handshake_client) { … }
void ContentBrowserClient::WillCreateWebTransport(
int process_id,
int frame_routing_id,
const GURL& url,
const url::Origin& initiator_origin,
mojo::PendingRemote<network::mojom::WebTransportHandshakeClient>
handshake_client,
WillCreateWebTransportCallback callback) { … }
bool ContentBrowserClient::WillCreateRestrictedCookieManager(
network::mojom::RestrictedCookieManagerRole role,
BrowserContext* browser_context,
const url::Origin& origin,
const net::IsolationInfo& isolation_info,
bool is_service_worker,
int process_id,
int frame_id,
mojo::PendingReceiver<network::mojom::RestrictedCookieManager>* receiver) { … }
std::vector<std::unique_ptr<URLLoaderRequestInterceptor>>
ContentBrowserClient::WillCreateURLLoaderRequestInterceptors(
content::NavigationUIData* navigation_ui_data,
int frame_tree_node_id,
int64_t navigation_id,
bool force_no_https_upgrade,
scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner) { … }
ContentBrowserClient::URLLoaderRequestHandler
ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload(
int frame_tree_node_id,
const network::ResourceRequest& resource_request) { … }
void ContentBrowserClient::OnNetworkServiceCreated(
network::mojom::NetworkService* network_service) { … }
void ContentBrowserClient::ConfigureNetworkContextParams(
BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path,
network::mojom::NetworkContextParams* network_context_params,
cert_verifier::mojom::CertVerifierCreationParams*
cert_verifier_creation_params) { … }
std::vector<base::FilePath>
ContentBrowserClient::GetNetworkContextsParentDirectory() { … }
base::Value::Dict ContentBrowserClient::GetNetLogConstants() { … }
#if BUILDFLAG(IS_ANDROID)
bool ContentBrowserClient::ShouldOverrideUrlLoading(
int frame_tree_node_id,
bool browser_initiated,
const GURL& gurl,
const std::string& request_method,
bool has_user_gesture,
bool is_redirect,
bool is_outermost_main_frame,
bool is_prerendering,
ui::PageTransition transition,
bool* ignore_navigation) {
return true;
}
#endif
bool ContentBrowserClient::ShouldAllowSameSiteRenderFrameHostChange(
const RenderFrameHost& rfh) { … }
bool ContentBrowserClient::AllowRenderingMhtmlOverHttp(
NavigationUIData* navigation_ui_data) { … }
bool ContentBrowserClient::ShouldForceDownloadResource(
content::BrowserContext* browser_context,
const GURL& url,
const std::string& mime_type) { … }
void ContentBrowserClient::CreateDeviceInfoService(
RenderFrameHost* render_frame_host,
mojo::PendingReceiver<blink::mojom::DeviceAPIService> receiver) { … }
void ContentBrowserClient::CreateManagedConfigurationService(
RenderFrameHost* render_frame_host,
mojo::PendingReceiver<blink::mojom::ManagedConfigurationService> receiver) { … }
void ContentBrowserClient::CreatePaymentCredential(
RenderFrameHost* render_frame_host,
mojo::PendingReceiver<payments::mojom::PaymentCredential> receiver) { … }
#if !BUILDFLAG(IS_ANDROID)
SerialDelegate* ContentBrowserClient::GetSerialDelegate() { … }
#endif
HidDelegate* ContentBrowserClient::GetHidDelegate() { … }
BluetoothDelegate* ContentBrowserClient::GetBluetoothDelegate() { … }
UsbDelegate* ContentBrowserClient::GetUsbDelegate() { … }
PrivateNetworkDeviceDelegate*
ContentBrowserClient::GetPrivateNetworkDeviceDelegate() { … }
FontAccessDelegate* ContentBrowserClient::GetFontAccessDelegate() { … }
#if BUILDFLAG(IS_CHROMEOS)
SmartCardDelegate* ContentBrowserClient::GetSmartCardDelegate() {
return nullptr;
}
#endif
bool ContentBrowserClient::ShowPaymentHandlerWindow(
content::BrowserContext* browser_context,
const GURL& url,
base::OnceCallback<void(bool, int, int)> callback) { … }
bool ContentBrowserClient::IsSecurityLevelAcceptableForWebAuthn(
content::RenderFrameHost* rfh,
const url::Origin& caller_origin) { … }
#if !BUILDFLAG(IS_ANDROID)
WebAuthenticationDelegate*
ContentBrowserClient::GetWebAuthenticationDelegate() { … }
std::unique_ptr<AuthenticatorRequestClientDelegate>
ContentBrowserClient::GetWebAuthenticationRequestDelegate(
RenderFrameHost* render_frame_host) { … }
#endif
std::unique_ptr<net::ClientCertStore>
ContentBrowserClient::CreateClientCertStore(BrowserContext* browser_context) { … }
std::unique_ptr<LoginDelegate> ContentBrowserClient::CreateLoginDelegate(
const net::AuthChallengeInfo& auth_info,
content::WebContents* web_contents,
BrowserContext* browser_context,
const GlobalRequestID& request_id,
bool is_request_for_primary_main_frame,
const GURL& url,
scoped_refptr<net::HttpResponseHeaders> response_headers,
bool first_auth_attempt,
LoginAuthRequiredCallback auth_required_callback) { … }
bool ContentBrowserClient::HandleExternalProtocol(
const GURL& url,
WebContents::Getter web_contents_getter,
int frame_tree_node_id,
NavigationUIData* navigation_data,
bool is_primary_main_frame,
bool is_in_fenced_frame_tree,
network::mojom::WebSandboxFlags sandbox_flags,
ui::PageTransition page_transition,
bool has_user_gesture,
const std::optional<url::Origin>& initiating_origin,
RenderFrameHost* initiator_document,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory) { … }
std::unique_ptr<VideoOverlayWindow>
ContentBrowserClient::CreateWindowForVideoPictureInPicture(
VideoPictureInPictureWindowController* controller) { … }
void ContentBrowserClient::RegisterRendererPreferenceWatcher(
BrowserContext* browser_context,
mojo::PendingRemote<blink::mojom::RendererPreferenceWatcher> watcher) { … }
bool ContentBrowserClient::CanAcceptUntrustedExchangesIfNeeded() { … }
void ContentBrowserClient::OnNetworkServiceDataUseUpdate(
GlobalRenderFrameHostId render_frame_host_id,
int32_t network_traffic_annotation_id_hash,
int64_t recv_bytes,
int64_t sent_bytes) { … }
base::FilePath ContentBrowserClient::GetSandboxedStorageServiceDataDirectory() { … }
bool ContentBrowserClient::ShouldSandboxAudioService() { … }
bool ContentBrowserClient::ShouldSandboxNetworkService() { … }
bool ContentBrowserClient::ShouldRunOutOfProcessSystemDnsResolution() { … }
std::string ContentBrowserClient::GetProduct() { … }
std::string ContentBrowserClient::GetUserAgent() { … }
std::string ContentBrowserClient::GetUserAgentBasedOnPolicy(
content::BrowserContext* content) { … }
blink::UserAgentMetadata ContentBrowserClient::GetUserAgentMetadata() { … }
std::optional<gfx::ImageSkia> ContentBrowserClient::GetProductLogo() { … }
bool ContentBrowserClient::IsBuiltinComponent(BrowserContext* browser_context,
const url::Origin& origin) { … }
bool ContentBrowserClient::ShouldBlockRendererDebugURL(
const GURL& url,
BrowserContext* context,
RenderFrameHost* render_frame_host) { … }
std::optional<base::TimeDelta>
ContentBrowserClient::GetSpareRendererDelayForSiteURL(const GURL& site_url) { … }
#if BUILDFLAG(IS_ANDROID)
ContentBrowserClient::WideColorGamutHeuristic
ContentBrowserClient::GetWideColorGamutHeuristic() {
return WideColorGamutHeuristic::kNone;
}
std::unique_ptr<TtsEnvironmentAndroid>
ContentBrowserClient::CreateTtsEnvironmentAndroid() {
return nullptr;
}
bool ContentBrowserClient::
ShouldObserveContainerViewLocationForDialogOverlays() {
return false;
}
#endif
base::flat_set<std::string>
ContentBrowserClient::GetPluginMimeTypesWithExternalHandlers(
BrowserContext* browser_context) { … }
void ContentBrowserClient::AugmentNavigationDownloadPolicy(
RenderFrameHost* frame_host,
bool user_gesture,
blink::NavigationDownloadPolicy* download_policy) { … }
bool ContentBrowserClient::HandleTopicsWebApi(
const url::Origin& context_origin,
content::RenderFrameHost* main_frame,
browsing_topics::ApiCallerSource caller_source,
bool get_topics,
bool observe,
std::vector<blink::mojom::EpochTopicPtr>& topics) { … }
int ContentBrowserClient::NumVersionsInTopicsEpochs(
content::RenderFrameHost* main_frame) const { … }
bool ContentBrowserClient::IsBluetoothScanningBlocked(
content::BrowserContext* browser_context,
const url::Origin& requesting_origin,
const url::Origin& embedding_origin) { … }
void ContentBrowserClient::BlockBluetoothScanning(
content::BrowserContext* browser_context,
const url::Origin& requesting_origin,
const url::Origin& embedding_origin) { … }
void ContentBrowserClient::GetMediaDeviceIDSalt(
content::RenderFrameHost* rfh,
const net::SiteForCookies& site_for_cookies,
const blink::StorageKey& storage_key,
base::OnceCallback<void(bool, const std::string&)> callback) { … }
base::OnceClosure ContentBrowserClient::FetchRemoteSms(
content::WebContents* web_contents,
const std::vector<url::Origin>& origin_list,
base::OnceCallback<void(std::optional<std::vector<url::Origin>>,
std::optional<std::string>,
std::optional<content::SmsFetchFailureType>)>
callback) { … }
void ContentBrowserClient::ReportLegacyTechEvent(
content::RenderFrameHost* render_frame_host,
const std::string type,
const GURL& url,
const GURL& frame_url,
const std::string& filename,
uint64_t line,
uint64_t column,
std::optional<LegacyTechCookieIssueDetails> cookie_issue_details) { … }
bool ContentBrowserClient::IsClipboardPasteAllowed(
content::RenderFrameHost* render_frame_host) { … }
void ContentBrowserClient::IsClipboardPasteAllowedByPolicy(
const ClipboardEndpoint& source,
const ClipboardEndpoint& destination,
const ClipboardMetadata& metadata,
ClipboardPasteData clipboard_paste_data,
IsClipboardPasteAllowedCallback callback) { … }
void ContentBrowserClient::IsClipboardCopyAllowedByPolicy(
const ClipboardEndpoint& source,
const ClipboardMetadata& metadata,
const ClipboardPasteData& data,
IsClipboardCopyAllowedCallback callback) { … }
#if BUILDFLAG(ENABLE_VR)
XrIntegrationClient* ContentBrowserClient::GetXrIntegrationClient() { … }
#endif
void ContentBrowserClient::BindBrowserControlInterface(
mojo::ScopedMessagePipeHandle pipe) { … }
bool ContentBrowserClient::ShouldInheritCrossOriginEmbedderPolicyImplicitly(
const GURL& url) { … }
bool ContentBrowserClient::ShouldServiceWorkerInheritPolicyContainerFromCreator(
const GURL& url) { … }
void ContentBrowserClient::GrantAdditionalRequestPrivilegesToWorkerProcess(
int child_id,
const GURL& script_url) { … }
ContentBrowserClient::PrivateNetworkRequestPolicyOverride
ContentBrowserClient::ShouldOverridePrivateNetworkRequestPolicy(
BrowserContext* browser_context,
const url::Origin& origin) { … }
bool ContentBrowserClient::IsJitDisabledForSite(BrowserContext* browser_context,
const GURL& site_url) { … }
bool ContentBrowserClient::AreV8OptimizationsDisabledForSite(
BrowserContext* browser_context,
const GURL& site_url) { … }
ukm::UkmService* ContentBrowserClient::GetUkmService() { … }
blink::mojom::OriginTrialsSettingsPtr
ContentBrowserClient::GetOriginTrialsSettings() { … }
void ContentBrowserClient::OnKeepaliveRequestStarted(BrowserContext*) { … }
void ContentBrowserClient::OnKeepaliveRequestFinished() { … }
#if BUILDFLAG(IS_MAC)
bool ContentBrowserClient::SetupEmbedderSandboxParameters(
sandbox::mojom::Sandbox sandbox_type,
sandbox::SandboxCompiler* compiler) {
return false;
}
#endif
void ContentBrowserClient::GetHyphenationDictionary(
base::OnceCallback<void(const base::FilePath&)>) { … }
bool ContentBrowserClient::HasErrorPage(int http_status_code) { … }
std::unique_ptr<IdentityRequestDialogController>
ContentBrowserClient::CreateIdentityRequestDialogController(
WebContents* web_contents) { … }
std::unique_ptr<DigitalIdentityProvider>
ContentBrowserClient::CreateDigitalIdentityProvider() { … }
bool ContentBrowserClient::SuppressDifferentOriginSubframeJSDialogs(
BrowserContext* browser_context) { … }
std::unique_ptr<AnchorElementPreconnectDelegate>
ContentBrowserClient::CreateAnchorElementPreconnectDelegate(
RenderFrameHost& render_frame_host) { … }
std::unique_ptr<SpeculationHostDelegate>
ContentBrowserClient::CreateSpeculationHostDelegate(
RenderFrameHost& render_frame_host) { … }
std::unique_ptr<PrefetchServiceDelegate>
ContentBrowserClient::CreatePrefetchServiceDelegate(
BrowserContext* browser_context) { … }
std::unique_ptr<PrerenderWebContentsDelegate>
ContentBrowserClient::CreatePrerenderWebContentsDelegate() { … }
bool ContentBrowserClient::IsFindInPageDisabledForOrigin(
const url::Origin& origin) { … }
void ContentBrowserClient::OnWebContentsCreated(WebContents* web_contents) { … }
bool ContentBrowserClient::ShouldDisableOriginAgentClusterDefault(
BrowserContext* browser_context) { … }
bool ContentBrowserClient::ShouldPreconnectNavigation(
RenderFrameHost* render_frame_host) { … }
bool ContentBrowserClient::IsFirstPartySetsEnabled() { … }
bool ContentBrowserClient::WillProvidePublicFirstPartySets() { … }
mojom::AlternativeErrorPageOverrideInfoPtr
ContentBrowserClient::GetAlternativeErrorPageOverrideInfo(
const GURL& url,
content::RenderFrameHost* render_frame_host,
content::BrowserContext* browser_context,
int32_t error_code) { … }
bool ContentBrowserClient::ShouldSendOutermostOriginToRenderer(
const url::Origin& outermost_origin) { … }
bool ContentBrowserClient::IsFileSystemURLNavigationAllowed(
content::BrowserContext* browser_context,
const GURL& url) { … }
#if BUILDFLAG(IS_MAC)
std::string ContentBrowserClient::GetChildProcessSuffix(int child_flags) {
NOTIMPLEMENTED();
return std::string();
}
#endif
bool ContentBrowserClient::AreIsolatedWebAppsEnabled(
BrowserContext* browser_context) { … }
bool ContentBrowserClient::IsThirdPartyStoragePartitioningAllowed(
content::BrowserContext*,
const url::Origin&) { … }
bool ContentBrowserClient::AreDeprecatedAutomaticBeaconCredentialsAllowed(
content::BrowserContext* browser_context,
const GURL& destination_url,
const url::Origin& top_frame_origin) { … }
bool ContentBrowserClient::
IsTransientActivationRequiredForShowFileOrDirectoryPicker(
WebContents* web_contents) { … }
bool ContentBrowserClient::ShouldUseFirstPartyStorageKey(
const url::Origin& origin) { … }
std::unique_ptr<ResponsivenessCalculatorDelegate>
ContentBrowserClient::CreateResponsivenessCalculatorDelegate() { … }
bool ContentBrowserClient::CanBackForwardCachedPageReceiveCookieChanges(
content::BrowserContext& browser_context,
const GURL& url,
const net::SiteForCookies& site_for_cookies,
const std::optional<url::Origin>& top_frame_origin,
const net::CookieSettingOverrides overrides) { … }
void ContentBrowserClient::GetCloudIdentifiers(
const storage::FileSystemURL& url,
FileSystemAccessPermissionContext::HandleType handle_type,
GetCloudIdentifiersCallback callback) { … }
bool ContentBrowserClient::
ShouldAllowBackForwardCacheForCacheControlNoStorePage(
content::BrowserContext* browser_context) { … }
bool ContentBrowserClient::UseOutermostMainFrameOrEmbedderForSubCaptureTargets()
const { … }
#if !BUILDFLAG(IS_ANDROID)
void ContentBrowserClient::BindVideoEffectsManager(
const std::string& device_id,
BrowserContext* browser_context,
mojo::PendingReceiver<media::mojom::VideoEffectsManager>
video_effects_manager) { … }
void ContentBrowserClient::BindVideoEffectsProcessor(
const std::string& device_id,
BrowserContext* browser_context,
mojo::PendingReceiver<video_effects::mojom::VideoEffectsProcessor>
video_effects_manager) { … }
#endif
void ContentBrowserClient::PreferenceRankAudioDeviceInfos(
BrowserContext* browser_context,
blink::WebMediaDeviceInfoArray& infos) { … }
void ContentBrowserClient::PreferenceRankVideoDeviceInfos(
BrowserContext* browser_context,
blink::WebMediaDeviceInfoArray& infos) { … }
network::mojom::IpProtectionProxyBypassPolicy
ContentBrowserClient::GetIpProtectionProxyBypassPolicy() { … }
void ContentBrowserClient::MaybePrewarmHttpDiskCache(
BrowserContext& browser_context,
const std::optional<url::Origin>& initiator_origin,
const GURL& navigation_url) { … }
void ContentBrowserClient::NotifyMultiCaptureStateChanged(
GlobalRenderFrameHostId capturer_rfh_id,
const std::string& label,
MultiCaptureChanged state) { … }
std::unique_ptr<DipsDelegate> ContentBrowserClient::CreateDipsDelegate() { … }
bool ContentBrowserClient::ShouldSuppressAXLoadComplete(RenderFrameHost* rfh) { … }
void ContentBrowserClient::BindAIManager(
BrowserContext* browser_context,
std::variant<RenderFrameHost*, base::SupportsUserData*> context,
mojo::PendingReceiver<blink::mojom::AIManager> receiver) { … }
#if !BUILDFLAG(IS_ANDROID)
void ContentBrowserClient::QueryInstalledWebAppsByManifestId(
const GURL& frame_url,
const GURL& manifest_id,
content::BrowserContext* browser_context,
base::OnceCallback<void(std::optional<blink::mojom::RelatedApplication>)>
callback) { … }
#endif
bool ContentBrowserClient::IsSaveableNavigation(
NavigationHandle* navigation_handle) { … }
}