[M120][Tizen][Onscreen] Fix build errors for TV profile
[platform/framework/web/chromium-efl.git] / chrome / browser / chrome_content_browser_client.h
1 // Copyright 2012 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_
6 #define CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_
7
8 #include <stddef.h>
9
10 #include <memory>
11 #include <set>
12 #include <string>
13 #include <vector>
14
15 #include "base/containers/flat_map.h"
16 #include "base/functional/callback.h"
17 #include "base/gtest_prod_util.h"
18 #include "base/memory/scoped_refptr.h"
19 #include "base/memory/weak_ptr.h"
20 #include "base/strings/string_piece_forward.h"
21 #include "base/task/sequenced_task_runner.h"
22 #include "base/time/time.h"
23 #include "base/timer/timer.h"
24 #include "base/values.h"
25 #include "build/build_config.h"
26 #include "build/chromeos_buildflags.h"
27 #include "chrome/browser/startup_data.h"
28 #include "components/file_access/scoped_file_access.h"
29 #include "components/safe_browsing/buildflags.h"
30 #include "components/safe_browsing/content/browser/web_api_handshake_checker.h"
31 #include "content/public/browser/child_process_security_policy.h"
32 #include "content/public/browser/content_browser_client.h"
33 #include "content/public/browser/web_contents.h"
34 #include "content/public/common/alternative_error_page_override_info.mojom-forward.h"
35 #include "extensions/buildflags/buildflags.h"
36 #include "media/media_buildflags.h"
37 #include "mojo/public/cpp/bindings/pending_receiver.h"
38 #include "mojo/public/cpp/bindings/pending_remote.h"
39 #include "services/metrics/public/cpp/ukm_source_id.h"
40 #include "third_party/abseil-cpp/absl/types/optional.h"
41
42 class ChromeContentBrowserClientParts;
43 class PrefRegistrySimple;
44 class ScopedKeepAlive;
45
46 namespace base {
47 class CommandLine;
48 }  // namespace base
49
50 namespace blink {
51 namespace mojom {
52 class WindowFeatures;
53 }  // namespace mojom
54 namespace web_pref {
55 struct WebPreferences;
56 }  // namespace web_pref
57 class StorageKey;
58 class URLLoaderThrottle;
59 }  // namespace blink
60
61 namespace blocked_content {
62 class PopupNavigationDelegate;
63 }  // namespace blocked_content
64
65 namespace content {
66 class BrowserContext;
67 class RenderFrameHost;
68 enum class SmsFetchFailureType;
69 struct ServiceWorkerVersionBaseInfo;
70 }  // namespace content
71
72 namespace net {
73 class IsolationInfo;
74 class SiteForCookies;
75 }  // namespace net
76
77 namespace permissions {
78 class BluetoothDelegateImpl;
79 }  // namespace permissions
80
81 namespace safe_browsing {
82 class RealTimeUrlLookupServiceBase;
83 class SafeBrowsingService;
84 class UrlCheckerDelegate;
85 }  // namespace safe_browsing
86
87 namespace sandbox {
88 class SandboxCompiler;
89 }  // namespace sandbox
90
91 namespace ui {
92 class NativeTheme;
93 }  // namespace ui
94
95 namespace url {
96 class Origin;
97 }  // namespace url
98
99 namespace user_prefs {
100 class PrefRegistrySyncable;
101 }  // namespace user_prefs
102
103 namespace version_info {
104 enum class Channel;
105 }  // namespace version_info
106
107 class ChromeDirectSocketsDelegate;
108 class ChromeHidDelegate;
109 class ChromePrivateNetworkDeviceDelegate;
110 class ChromeSerialDelegate;
111 class ChromeUsbDelegate;
112 class ChromeWebAuthenticationDelegate;
113 struct NavigateParams;
114
115 #if BUILDFLAG(ENABLE_VR)
116 namespace vr {
117 class ChromeXrIntegrationClient;
118 }
119 #endif
120
121 class ChromeContentBrowserClient : public content::ContentBrowserClient {
122  public:
123   using PopupNavigationDelegateFactory =
124       std::unique_ptr<blocked_content::PopupNavigationDelegate> (*)(
125           NavigateParams);
126   using ClipboardPasteData = content::ClipboardPasteData;
127
128   static PopupNavigationDelegateFactory&
129   GetPopupNavigationDelegateFactoryForTesting();
130
131   ChromeContentBrowserClient();
132
133   ChromeContentBrowserClient(const ChromeContentBrowserClient&) = delete;
134   ChromeContentBrowserClient& operator=(const ChromeContentBrowserClient&) =
135       delete;
136
137   ~ChromeContentBrowserClient() override;
138
139   // TODO(https://crbug.com/787567): This file is about calls from content/ out
140   // to chrome/ to get values or notify about events, but both of these
141   // functions are from chrome/ to chrome/ and don't involve content/ at all.
142   // That suggests they belong somewhere else at the chrome/ layer.
143   static void RegisterLocalStatePrefs(PrefRegistrySimple* registry);
144   static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
145
146   // Notification that the application locale has changed. This allows us to
147   // update our I/O thread cache of this value.
148   static void SetApplicationLocale(const std::string& locale);
149
150   // content::ContentBrowserClient:
151   std::unique_ptr<content::BrowserMainParts> CreateBrowserMainParts(
152       bool is_integration_test) override;
153   void PostAfterStartupTask(
154       const base::Location& from_here,
155       const scoped_refptr<base::SequencedTaskRunner>& task_runner,
156       base::OnceClosure task) override;
157   bool IsBrowserStartupComplete() override;
158   void SetBrowserStartupIsCompleteForTesting() override;
159   bool IsShuttingDown() override;
160   content::StoragePartitionConfig GetStoragePartitionConfigForSite(
161       content::BrowserContext* browser_context,
162       const GURL& site) override;
163   std::unique_ptr<content::WebContentsViewDelegate> GetWebContentsViewDelegate(
164       content::WebContents* web_contents) override;
165   void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
166   bool AllowGpuLaunchRetryOnIOThread() override;
167   GURL GetEffectiveURL(content::BrowserContext* browser_context,
168                        const GURL& url) override;
169   bool ShouldCompareEffectiveURLsForSiteInstanceSelection(
170       content::BrowserContext* browser_context,
171       content::SiteInstance* candidate_site_instance,
172       bool is_outermost_main_frame,
173       const GURL& candidate_url,
174       const GURL& destination_url) override;
175   bool ShouldUseMobileFlingCurve() override;
176   bool ShouldUseProcessPerSite(content::BrowserContext* browser_context,
177                                const GURL& site_url) override;
178   bool ShouldUseSpareRenderProcessHost(content::BrowserContext* browser_context,
179                                        const GURL& site_url) override;
180   bool DoesSiteRequireDedicatedProcess(content::BrowserContext* browser_context,
181                                        const GURL& effective_site_url) override;
182   bool DoesWebUIUrlRequireProcessLock(const GURL& url) override;
183   bool ShouldTreatURLSchemeAsFirstPartyWhenTopLevel(
184       base::StringPiece scheme,
185       bool is_embedded_origin_secure) override;
186   bool ShouldIgnoreSameSiteCookieRestrictionsWhenTopLevel(
187       base::StringPiece scheme,
188       bool is_embedded_origin_secure) override;
189   std::string GetSiteDisplayNameForCdmProcess(
190       content::BrowserContext* browser_context,
191       const GURL& site_url) override;
192   void OverrideURLLoaderFactoryParams(
193       content::BrowserContext* browser_context,
194       const url::Origin& origin,
195       bool is_for_isolated_world,
196       network::mojom::URLLoaderFactoryParams* factory_params) override;
197   void GetAdditionalWebUISchemes(
198       std::vector<std::string>* additional_schemes) override;
199   void GetAdditionalViewSourceSchemes(
200       std::vector<std::string>* additional_schemes) override;
201   network::mojom::IPAddressSpace DetermineAddressSpaceFromURL(
202       const GURL& url) override;
203   bool LogWebUIUrl(const GURL& web_ui_url) override;
204   bool IsWebUIAllowedToMakeNetworkRequests(const url::Origin& origin) override;
205   bool IsHandledURL(const GURL& url) override;
206   bool HasCustomSchemeHandler(content::BrowserContext* browser_context,
207                               const std::string& scheme) override;
208   bool CanCommitURL(content::RenderProcessHost* process_host,
209                     const GURL& url) override;
210   void OverrideNavigationParams(
211       absl::optional<GURL> source_process_site_url,
212       ui::PageTransition* transition,
213       bool* is_renderer_initiated,
214       content::Referrer* referrer,
215       absl::optional<url::Origin>* initiator_origin) override;
216   bool ShouldStayInParentProcessForNTP(const GURL& url,
217                                        const GURL& parent_site_url) override;
218   bool IsSuitableHost(content::RenderProcessHost* process_host,
219                       const GURL& site_url) override;
220   bool MayReuseHost(content::RenderProcessHost* process_host) override;
221   size_t GetProcessCountToIgnoreForLimit() override;
222   absl::optional<blink::ParsedPermissionsPolicy>
223   GetPermissionsPolicyForIsolatedWebApp(
224       content::BrowserContext* browser_context,
225       const url::Origin& app_origin) override;
226   bool ShouldTryToUseExistingProcessHost(
227       content::BrowserContext* browser_context,
228       const GURL& url) override;
229   bool ShouldEmbeddedFramesTryToReuseExistingProcess(
230       content::RenderFrameHost* outermost_main_frame) override;
231   void SiteInstanceGotProcess(content::SiteInstance* site_instance) override;
232   bool ShouldSwapBrowsingInstancesForNavigation(
233       content::SiteInstance* site_instance,
234       const GURL& current_effective_url,
235       const GURL& destination_effective_url) override;
236   bool ShouldIsolateErrorPage(bool in_main_frame) override;
237   std::vector<url::Origin> GetOriginsRequiringDedicatedProcess() override;
238   bool ShouldEnableStrictSiteIsolation() override;
239   bool ShouldDisableSiteIsolation(
240       content::SiteIsolationMode site_isolation_mode) override;
241   std::vector<std::string> GetAdditionalSiteIsolationModes() override;
242   void PersistIsolatedOrigin(
243       content::BrowserContext* context,
244       const url::Origin& origin,
245       content::ChildProcessSecurityPolicy::IsolatedOriginSource source)
246       override;
247   bool ShouldUrlUseApplicationIsolationLevel(
248       content::BrowserContext* browser_context,
249       const GURL& url) override;
250   bool IsIsolatedContextAllowedForUrl(content::BrowserContext* browser_context,
251                                       const GURL& lock_url) override;
252   bool IsGetAllScreensMediaAllowed(content::BrowserContext* context,
253                                    const url::Origin& origin) override;
254   bool IsFileAccessAllowed(const base::FilePath& path,
255                            const base::FilePath& absolute_path,
256                            const base::FilePath& profile_path) override;
257   void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
258                                       int child_process_id) override;
259   std::string GetApplicationClientGUIDForQuarantineCheck() override;
260   download::QuarantineConnectionCallback GetQuarantineConnectionCallback()
261       override;
262   std::string GetApplicationLocale() override;
263   std::string GetAcceptLangs(content::BrowserContext* context) override;
264   gfx::ImageSkia GetDefaultFavicon() override;
265   bool IsDataSaverEnabled(content::BrowserContext* context) override;
266   void UpdateRendererPreferencesForWorker(
267       content::BrowserContext* browser_context,
268       blink::RendererPreferences* out_prefs) override;
269   content::AllowServiceWorkerResult AllowServiceWorker(
270       const GURL& scope,
271       const net::SiteForCookies& site_for_cookies,
272       const absl::optional<url::Origin>& top_frame_origin,
273       const GURL& script_url,
274       content::BrowserContext* context) override;
275   bool MayDeleteServiceWorkerRegistration(
276       const GURL& scope,
277       content::BrowserContext* browser_context) override;
278   bool ShouldTryToUpdateServiceWorkerRegistration(
279       const GURL& scope,
280       content::BrowserContext* browser_context) override;
281   void UpdateEnabledBlinkRuntimeFeaturesInIsolatedWorker(
282       content::BrowserContext* context,
283       const GURL& script_url,
284       std::vector<std::string>& out_forced_enabled_runtime_features) override;
285   bool AllowSharedWorker(const GURL& worker_url,
286                          const net::SiteForCookies& site_for_cookies,
287                          const absl::optional<url::Origin>& top_frame_origin,
288                          const std::string& name,
289                          const blink::StorageKey& storage_key,
290                          content::BrowserContext* context,
291                          int render_process_id,
292                          int render_frame_id) override;
293   bool DoesSchemeAllowCrossOriginSharedWorker(
294       const std::string& scheme) override;
295   bool AllowSignedExchange(content::BrowserContext* browser_context) override;
296   bool AllowCompressionDictionaryTransport(
297       content::BrowserContext* context) override;
298   void RequestFilesAccess(
299       const std::vector<base::FilePath>& files,
300       const GURL& destination_url,
301       base::OnceCallback<void(file_access::ScopedFileAccess)>
302           continuation_callback) override;
303   void AllowWorkerFileSystem(
304       const GURL& url,
305       content::BrowserContext* browser_context,
306       const std::vector<content::GlobalRenderFrameHostId>& render_frames,
307       base::OnceCallback<void(bool)> callback) override;
308   bool AllowWorkerIndexedDB(const GURL& url,
309                             content::BrowserContext* browser_context,
310                             const std::vector<content::GlobalRenderFrameHostId>&
311                                 render_frames) override;
312   bool AllowWorkerCacheStorage(
313       const GURL& url,
314       content::BrowserContext* browser_context,
315       const std::vector<content::GlobalRenderFrameHostId>& render_frames)
316       override;
317   bool AllowWorkerWebLocks(const GURL& url,
318                            content::BrowserContext* browser_context,
319                            const std::vector<content::GlobalRenderFrameHostId>&
320                                render_frames) override;
321   AllowWebBluetoothResult AllowWebBluetooth(
322       content::BrowserContext* browser_context,
323       const url::Origin& requesting_origin,
324       const url::Origin& embedding_origin) override;
325   std::string GetWebBluetoothBlocklist() override;
326   bool IsInterestGroupAPIAllowed(content::RenderFrameHost* render_frame_host,
327                                  InterestGroupApiOperation operation,
328                                  const url::Origin& top_frame_origin,
329                                  const url::Origin& api_origin) override;
330   bool IsPrivacySandboxReportingDestinationAttested(
331       content::BrowserContext* browser_context,
332       const url::Origin& destination_origin,
333       content::PrivacySandboxInvokingAPI invoking_api) override;
334   void OnAuctionComplete(content::RenderFrameHost* render_frame_host,
335                          content::InterestGroupManager::InterestGroupDataKey
336                              winner_data_key) override;
337   bool IsAttributionReportingOperationAllowed(
338       content::BrowserContext* browser_context,
339       AttributionReportingOperation operation,
340       content::RenderFrameHost* rfh,
341       const url::Origin* impression_origin,
342       const url::Origin* conversion_origin,
343       const url::Origin* reporting_origin) override;
344   bool IsSharedStorageAllowed(content::BrowserContext* browser_context,
345                               content::RenderFrameHost* rfh,
346                               const url::Origin& top_frame_origin,
347                               const url::Origin& accessing_origin) override;
348   bool IsSharedStorageSelectURLAllowed(
349       content::BrowserContext* browser_context,
350       const url::Origin& top_frame_origin,
351       const url::Origin& accessing_origin) override;
352   bool IsPrivateAggregationAllowed(
353       content::BrowserContext* browser_context,
354       const url::Origin& top_frame_origin,
355       const url::Origin& reporting_origin) override;
356   bool IsPrivateAggregationDebugModeAllowed(
357       content::BrowserContext* browser_context,
358       const url::Origin& top_frame_origin,
359       const url::Origin& reporting_origin) override;
360   bool IsCookieDeprecationLabelAllowed(
361       content::BrowserContext* browser_context) override;
362   bool IsCookieDeprecationLabelAllowedForContext(
363       content::BrowserContext* browser_context,
364       const url::Origin& top_frame_origin,
365       const url::Origin& context_origin) override;
366 #if BUILDFLAG(IS_CHROMEOS)
367   void OnTrustAnchorUsed(content::BrowserContext* browser_context) override;
368 #endif
369   bool CanSendSCTAuditingReport(
370       content::BrowserContext* browser_context) override;
371   void OnNewSCTAuditingReportSent(
372       content::BrowserContext* browser_context) override;
373   scoped_refptr<network::SharedURLLoaderFactory>
374   GetSystemSharedURLLoaderFactory() override;
375   network::mojom::NetworkContext* GetSystemNetworkContext() override;
376   std::string GetGeolocationApiKey() override;
377
378 #if BUILDFLAG(IS_MAC)
379   device::GeolocationManager* GetGeolocationManager() override;
380 #endif
381
382 #if BUILDFLAG(IS_ANDROID)
383   bool ShouldUseGmsCoreGeolocationProvider() override;
384 #endif
385   content::GeneratedCodeCacheSettings GetGeneratedCodeCacheSettings(
386       content::BrowserContext* context) override;
387   void AllowCertificateError(
388       content::WebContents* web_contents,
389       int cert_error,
390       const net::SSLInfo& ssl_info,
391       const GURL& request_url,
392       bool is_primary_main_frame_request,
393       bool strict_enforcement,
394       base::OnceCallback<void(content::CertificateRequestResultType)> callback)
395       override;
396 #if !BUILDFLAG(IS_ANDROID)
397   bool ShouldDenyRequestOnCertificateError(const GURL main_page_url) override;
398 #endif
399   base::OnceClosure SelectClientCertificate(
400       content::BrowserContext* browser_context,
401       content::WebContents* web_contents,
402       net::SSLCertRequestInfo* cert_request_info,
403       net::ClientCertIdentityList client_certs,
404       std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
405   content::MediaObserver* GetMediaObserver() override;
406   content::FeatureObserverClient* GetFeatureObserverClient() override;
407   bool CanCreateWindow(content::RenderFrameHost* opener,
408                        const GURL& opener_url,
409                        const GURL& opener_top_level_frame_url,
410                        const url::Origin& source_origin,
411                        content::mojom::WindowContainerType container_type,
412                        const GURL& target_url,
413                        const content::Referrer& referrer,
414                        const std::string& frame_name,
415                        WindowOpenDisposition disposition,
416                        const blink::mojom::WindowFeatures& features,
417                        bool user_gesture,
418                        bool opener_suppressed,
419                        bool* no_javascript_access) override;
420   content::SpeechRecognitionManagerDelegate*
421   CreateSpeechRecognitionManagerDelegate() override;
422 #if BUILDFLAG(IS_CHROMEOS_ASH)
423   content::TtsControllerDelegate* GetTtsControllerDelegate() override;
424 #endif
425   void MaybeOverrideManifest(content::RenderFrameHost* render_frame_host,
426                              blink::mojom::ManifestPtr& manifest) override;
427   content::TtsPlatform* GetTtsPlatform() override;
428   void OverrideWebkitPrefs(content::WebContents* web_contents,
429                            blink::web_pref::WebPreferences* prefs) override;
430   bool OverrideWebPreferencesAfterNavigation(
431       content::WebContents* web_contents,
432       blink::web_pref::WebPreferences* prefs) override;
433   void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) override;
434   base::FilePath GetDefaultDownloadDirectory() override;
435   std::string GetDefaultDownloadName() override;
436   base::FilePath GetShaderDiskCacheDirectory() override;
437   base::FilePath GetGrShaderDiskCacheDirectory() override;
438   base::FilePath GetGraphiteDawnDiskCacheDirectory() override;
439   base::FilePath GetNetLogDefaultDirectory() override;
440   base::FilePath GetFirstPartySetsDirectory() override;
441   absl::optional<base::FilePath> GetLocalTracesDirectory() override;
442   void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override;
443   content::BrowserPpapiHost* GetExternalBrowserPpapiHost(
444       int plugin_process_id) override;
445   bool AllowPepperSocketAPI(
446       content::BrowserContext* browser_context,
447       const GURL& url,
448       bool private_api,
449       const content::SocketPermissionRequest* params) override;
450   bool IsPepperVpnProviderAPIAllowed(content::BrowserContext* browser_context,
451                                      const GURL& url) override;
452   std::unique_ptr<content::VpnServiceProxy> GetVpnServiceProxy(
453       content::BrowserContext* browser_context) override;
454   std::unique_ptr<ui::SelectFilePolicy> CreateSelectFilePolicy(
455       content::WebContents* web_contents) override;
456   void GetAdditionalAllowedSchemesForFileSystem(
457       std::vector<std::string>* additional_schemes) override;
458   void GetSchemesBypassingSecureContextCheckAllowlist(
459       std::set<std::string>* schemes) override;
460   void GetURLRequestAutoMountHandlers(
461       std::vector<storage::URLRequestAutoMountHandler>* handlers) override;
462   void GetAdditionalFileSystemBackends(
463       content::BrowserContext* browser_context,
464       const base::FilePath& storage_partition_path,
465       std::vector<std::unique_ptr<storage::FileSystemBackend>>*
466           additional_backends) override;
467   std::unique_ptr<content::DevToolsManagerDelegate>
468   CreateDevToolsManagerDelegate() override;
469   void UpdateDevToolsBackgroundServiceExpiration(
470       content::BrowserContext* browser_context,
471       int service,
472       base::Time expiration_time) override;
473   base::flat_map<int, base::Time> GetDevToolsBackgroundServiceExpirations(
474       content::BrowserContext* browser_context) override;
475   content::TracingDelegate* GetTracingDelegate() override;
476   bool IsPluginAllowedToCallRequestOSFileHandle(
477       content::BrowserContext* browser_context,
478       const GURL& url) override;
479   bool IsPluginAllowedToUseDevChannelAPIs(
480       content::BrowserContext* browser_context,
481       const GURL& url) override;
482   void OverridePageVisibilityState(
483       content::RenderFrameHost* render_frame_host,
484       content::PageVisibilityState* visibility_state) override;
485 #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
486   void GetAdditionalMappedFilesForChildProcess(
487       const base::CommandLine& command_line,
488       int child_process_id,
489       content::PosixFileDescriptorInfo* mappings) override;
490 #endif  // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
491 #if BUILDFLAG(IS_CHROMEOS_LACROS)
492   void GetAdditionalMappedFilesForZygote(
493       base::CommandLine* command_line,
494       content::PosixFileDescriptorInfo* mappings) override;
495 #endif  // BUILDFLAG(IS_CHROMEOS_LACROS)
496 #if BUILDFLAG(IS_WIN)
497   bool PreSpawnChild(sandbox::TargetConfig* config,
498                      sandbox::mojom::Sandbox sandbox_type,
499                      ChildSpawnFlags flags) override;
500   std::wstring GetAppContainerSidForSandboxType(
501       sandbox::mojom::Sandbox sandbox_type,
502       AppContainerFlags flags) override;
503   bool IsRendererAppContainerDisabled() override;
504   std::wstring GetLPACCapabilityNameForNetworkService() override;
505   bool IsUtilityCetCompatible(const std::string& utility_sub_type) override;
506   bool IsRendererCodeIntegrityEnabled() override;
507   void SessionEnding(absl::optional<DWORD> control_type) override;
508   bool ShouldEnableAudioProcessHighPriority() override;
509 #endif
510   void ExposeInterfacesToRenderer(
511       service_manager::BinderRegistry* registry,
512       blink::AssociatedInterfaceRegistry* associated_registry,
513       content::RenderProcessHost* render_process_host) override;
514   void BindMediaServiceReceiver(content::RenderFrameHost* render_frame_host,
515                                 mojo::GenericPendingReceiver receiver) override;
516   void RegisterBrowserInterfaceBindersForFrame(
517       content::RenderFrameHost* render_frame_host,
518       mojo::BinderMapWithContext<content::RenderFrameHost*>* map) override;
519   void RegisterWebUIInterfaceBrokers(
520       content::WebUIBrowserInterfaceBrokerRegistry& registry) override;
521   void RegisterMojoBinderPoliciesForSameOriginPrerendering(
522       content::MojoBinderPolicyMap& policy_map) override;
523   void RegisterBrowserInterfaceBindersForServiceWorker(
524       content::BrowserContext* browser_context,
525       const content::ServiceWorkerVersionBaseInfo& service_worker_version_info,
526       mojo::BinderMapWithContext<const content::ServiceWorkerVersionBaseInfo&>*
527           map) override;
528   void RegisterAssociatedInterfaceBindersForServiceWorker(
529       const content::ServiceWorkerVersionBaseInfo& service_worker_version_info,
530       blink::AssociatedInterfaceRegistry& associated_registry) override;
531   void RegisterAssociatedInterfaceBindersForRenderFrameHost(
532       content::RenderFrameHost& render_frame_host,
533       blink::AssociatedInterfaceRegistry& associated_registry) override;
534   void BindGpuHostReceiver(mojo::GenericPendingReceiver receiver) override;
535   void BindUtilityHostReceiver(mojo::GenericPendingReceiver receiver) override;
536   void BindHostReceiverForRenderer(
537       content::RenderProcessHost* render_process_host,
538       mojo::GenericPendingReceiver receiver) override;
539   void OpenURL(
540       content::SiteInstance* site_instance,
541       const content::OpenURLParams& params,
542       base::OnceCallback<void(content::WebContents*)> callback) override;
543   content::ControllerPresentationServiceDelegate*
544   GetControllerPresentationServiceDelegate(
545       content::WebContents* web_contents) override;
546   content::ReceiverPresentationServiceDelegate*
547   GetReceiverPresentationServiceDelegate(
548       content::WebContents* web_contents) override;
549   void AddPresentationObserver(content::PresentationObserver* observer,
550                                content::WebContents* web_contents) override;
551   void RemovePresentationObserver(content::PresentationObserver* observer,
552                                   content::WebContents* web_contents) override;
553   std::vector<std::unique_ptr<content::NavigationThrottle>>
554   CreateThrottlesForNavigation(content::NavigationHandle* handle) override;
555   std::vector<std::unique_ptr<content::CommitDeferringCondition>>
556   CreateCommitDeferringConditionsForNavigation(
557       content::NavigationHandle* navigation_handle,
558       content::CommitDeferringCondition::NavigationType type) override;
559   std::unique_ptr<content::NavigationUIData> GetNavigationUIData(
560       content::NavigationHandle* navigation_handle) override;
561   std::unique_ptr<media::ScreenEnumerator> CreateScreenEnumerator()
562       const override;
563   bool EnforceSystemAudioEchoCancellation() override;
564 #if BUILDFLAG(ENABLE_MEDIA_REMOTING)
565   void CreateMediaRemoter(
566       content::RenderFrameHost* render_frame_host,
567       mojo::PendingRemote<media::mojom::RemotingSource> source,
568       mojo::PendingReceiver<media::mojom::Remoter> receiver) final;
569 #endif  // BUILDFLAG(ENABLE_MEDIA_REMOTING)
570   base::FilePath GetLoggingFileName(
571       const base::CommandLine& command_line) override;
572   std::vector<std::unique_ptr<blink::URLLoaderThrottle>>
573   CreateURLLoaderThrottles(
574       const network::ResourceRequest& request,
575       content::BrowserContext* browser_context,
576       const base::RepeatingCallback<content::WebContents*()>& wc_getter,
577       content::NavigationUIData* navigation_ui_data,
578       int frame_tree_node_id) override;
579   std::vector<std::unique_ptr<blink::URLLoaderThrottle>>
580   CreateURLLoaderThrottlesForKeepAlive(
581       const network::ResourceRequest& request,
582       content::BrowserContext* browser_context,
583       const base::RepeatingCallback<content::WebContents*()>& wc_getter,
584       int frame_tree_node_id) override;
585   void RegisterNonNetworkNavigationURLLoaderFactories(
586       int frame_tree_node_id,
587       ukm::SourceIdObj ukm_source_id,
588       NonNetworkURLLoaderFactoryMap* factories) override;
589   void RegisterNonNetworkWorkerMainResourceURLLoaderFactories(
590       content::BrowserContext* browser_context,
591       NonNetworkURLLoaderFactoryMap* factories) override;
592   void RegisterNonNetworkServiceWorkerUpdateURLLoaderFactories(
593       content::BrowserContext* browser_context,
594       NonNetworkURLLoaderFactoryMap* factories) override;
595   void RegisterNonNetworkSubresourceURLLoaderFactories(
596       int render_process_id,
597       int render_frame_id,
598       const absl::optional<url::Origin>& request_initiator_origin,
599       NonNetworkURLLoaderFactoryMap* factories) override;
600   bool WillCreateURLLoaderFactory(
601       content::BrowserContext* browser_context,
602       content::RenderFrameHost* frame,
603       int render_process_id,
604       URLLoaderFactoryType type,
605       const url::Origin& request_initiator,
606       absl::optional<int64_t> navigation_id,
607       ukm::SourceIdObj ukm_source_id,
608       mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
609       mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
610           header_client,
611       bool* bypass_redirect_checks,
612       bool* disable_secure_dns,
613       network::mojom::URLLoaderFactoryOverridePtr* factory_override,
614       scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner)
615       override;
616   std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>>
617   WillCreateURLLoaderRequestInterceptors(
618       content::NavigationUIData* navigation_ui_data,
619       int frame_tree_node_id,
620       int64_t navigation_id,
621       scoped_refptr<base::SequencedTaskRunner> navigation_response_task_runner)
622       override;
623   content::ContentBrowserClient::URLLoaderRequestHandler
624   CreateURLLoaderHandlerForServiceWorkerNavigationPreload(
625       int frame_tree_node_id,
626       const network::ResourceRequest& resource_request) override;
627   bool WillInterceptWebSocket(content::RenderFrameHost* frame) override;
628   void CreateWebSocket(
629       content::RenderFrameHost* frame,
630       WebSocketFactory factory,
631       const GURL& url,
632       const net::SiteForCookies& site_for_cookies,
633       const absl::optional<std::string>& user_agent,
634       mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
635           handshake_client) override;
636   void WillCreateWebTransport(
637       int process_id,
638       int frame_routing_id,
639       const GURL& url,
640       const url::Origin& initiator_origin,
641       mojo::PendingRemote<network::mojom::WebTransportHandshakeClient>
642           handshake_client,
643       WillCreateWebTransportCallback callback) override;
644
645   bool WillCreateRestrictedCookieManager(
646       network::mojom::RestrictedCookieManagerRole role,
647       content::BrowserContext* browser_context,
648       const url::Origin& origin,
649       const net::IsolationInfo& isolation_info,
650       bool is_service_worker,
651       int process_id,
652       int routing_id,
653       mojo::PendingReceiver<network::mojom::RestrictedCookieManager>* receiver)
654       override;
655   void OnNetworkServiceCreated(
656       network::mojom::NetworkService* network_service) override;
657   void ConfigureNetworkContextParams(
658       content::BrowserContext* context,
659       bool in_memory,
660       const base::FilePath& relative_partition_path,
661       network::mojom::NetworkContextParams* network_context_params,
662       cert_verifier::mojom::CertVerifierCreationParams*
663           cert_verifier_creation_params) override;
664   std::vector<base::FilePath> GetNetworkContextsParentDirectory() override;
665   base::Value::Dict GetNetLogConstants() override;
666   bool AllowRenderingMhtmlOverHttp(
667       content::NavigationUIData* navigation_ui_data) override;
668   bool ShouldForceDownloadResource(content::BrowserContext* browser_context,
669                                    const GURL& url,
670                                    const std::string& mime_type) override;
671   content::BluetoothDelegate* GetBluetoothDelegate() override;
672   content::UsbDelegate* GetUsbDelegate() override;
673   content::PrivateNetworkDeviceDelegate* GetPrivateNetworkDeviceDelegate()
674       override;
675 #if !BUILDFLAG(IS_ANDROID)
676   void CreateDeviceInfoService(
677       content::RenderFrameHost* render_frame_host,
678       mojo::PendingReceiver<blink::mojom::DeviceAPIService> receiver) override;
679   void CreateManagedConfigurationService(
680       content::RenderFrameHost* render_frame_host,
681       mojo::PendingReceiver<blink::mojom::ManagedConfigurationService> receiver)
682       override;
683   content::SerialDelegate* GetSerialDelegate() override;
684   content::HidDelegate* GetHidDelegate() override;
685   content::DirectSocketsDelegate* GetDirectSocketsDelegate() override;
686   content::WebAuthenticationDelegate* GetWebAuthenticationDelegate() override;
687   std::unique_ptr<content::AuthenticatorRequestClientDelegate>
688   GetWebAuthenticationRequestDelegate(
689       content::RenderFrameHost* render_frame_host) override;
690 #endif
691 #if BUILDFLAG(IS_CHROMEOS)
692   content::SmartCardDelegate* GetSmartCardDelegate(
693       content::BrowserContext* browser_context) override;
694 #endif
695   bool ShowPaymentHandlerWindow(
696       content::BrowserContext* browser_context,
697       const GURL& url,
698       base::OnceCallback<void(bool, int, int)> callback) override;
699   std::unique_ptr<net::ClientCertStore> CreateClientCertStore(
700       content::BrowserContext* browser_context) override;
701   std::unique_ptr<content::LoginDelegate> CreateLoginDelegate(
702       const net::AuthChallengeInfo& auth_info,
703       content::WebContents* web_contents,
704       const content::GlobalRequestID& request_id,
705       bool is_request_for_primary_main_frame,
706       const GURL& url,
707       scoped_refptr<net::HttpResponseHeaders> response_headers,
708       bool first_auth_attempt,
709       LoginAuthRequiredCallback auth_required_callback) override;
710   bool HandleExternalProtocol(
711       const GURL& url,
712       content::WebContents::Getter web_contents_getter,
713       int frame_tree_node_id,
714       content::NavigationUIData* navigation_data,
715       bool is_primary_main_frame,
716       bool is_in_fenced_frame_tree,
717       network::mojom::WebSandboxFlags sandbox_flags,
718       ui::PageTransition page_transition,
719       bool has_user_gesture,
720       const absl::optional<url::Origin>& initiating_origin,
721       content::RenderFrameHost* initiator_document,
722       mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory)
723       override;
724   std::unique_ptr<content::VideoOverlayWindow>
725   CreateWindowForVideoPictureInPicture(
726       content::VideoPictureInPictureWindowController* controller) override;
727   void RegisterRendererPreferenceWatcher(
728       content::BrowserContext* browser_context,
729       mojo::PendingRemote<blink::mojom::RendererPreferenceWatcher> watcher)
730       override;
731   bool CanAcceptUntrustedExchangesIfNeeded() override;
732   void OnNetworkServiceDataUseUpdate(
733       content::GlobalRenderFrameHostId render_frame_host_id,
734       int32_t network_traffic_annotation_id_hash,
735       int64_t recv_bytes,
736       int64_t sent_bytes) override;
737   base::FilePath GetSandboxedStorageServiceDataDirectory() override;
738   bool ShouldSandboxAudioService() override;
739   bool ShouldSandboxNetworkService() override;
740   bool ShouldRunOutOfProcessSystemDnsResolution() override;
741
742   void LogWebFeatureForCurrentPage(content::RenderFrameHost* render_frame_host,
743                                    blink::mojom::WebFeature feature) override;
744
745   std::string GetProduct() override;
746   std::string GetUserAgent() override;
747   std::string GetUserAgentBasedOnPolicy(
748       content::BrowserContext* context) override;
749   blink::UserAgentMetadata GetUserAgentMetadata() override;
750
751   absl::optional<gfx::ImageSkia> GetProductLogo() override;
752
753   bool IsBuiltinComponent(content::BrowserContext* browser_context,
754                           const url::Origin& origin) override;
755
756   bool ShouldBlockRendererDebugURL(
757       const GURL& url,
758       content::BrowserContext* context,
759       content::RenderFrameHost* render_frame_host) override;
760
761   ui::AXMode GetAXModeForBrowserContext(
762       content::BrowserContext* browser_context) override;
763
764 #if BUILDFLAG(IS_ANDROID)
765   ContentBrowserClient::WideColorGamutHeuristic GetWideColorGamutHeuristic()
766       override;
767 #endif
768
769   base::flat_set<std::string> GetPluginMimeTypesWithExternalHandlers(
770       content::BrowserContext* browser_context) override;
771
772   void AugmentNavigationDownloadPolicy(
773       content::RenderFrameHost* frame_host,
774       bool user_gesture,
775       blink::NavigationDownloadPolicy* download_policy) override;
776
777   bool HandleTopicsWebApi(
778       const url::Origin& context_origin,
779       content::RenderFrameHost* main_frame,
780       browsing_topics::ApiCallerSource caller_source,
781       bool get_topics,
782       bool observe,
783       std::vector<blink::mojom::EpochTopicPtr>& topics) override;
784
785   int NumVersionsInTopicsEpochs(
786       content::RenderFrameHost* main_frame) const override;
787
788   bool IsBluetoothScanningBlocked(content::BrowserContext* browser_context,
789                                   const url::Origin& requesting_origin,
790                                   const url::Origin& embedding_origin) override;
791
792   void BlockBluetoothScanning(content::BrowserContext* browser_context,
793                               const url::Origin& requesting_origin,
794                               const url::Origin& embedding_origin) override;
795
796   void GetMediaDeviceIDSalt(
797       content::RenderFrameHost* rfh,
798       const net::SiteForCookies& site_for_cookies,
799       const blink::StorageKey& storage_key,
800       base::OnceCallback<void(bool, const std::string&)> callback) override;
801
802 #if !BUILDFLAG(IS_ANDROID)
803   base::OnceClosure FetchRemoteSms(
804       content::WebContents* web_contents,
805       const std::vector<url::Origin>& origin_list,
806       base::OnceCallback<void(absl::optional<std::vector<url::Origin>>,
807                               absl::optional<std::string>,
808                               absl::optional<content::SmsFetchFailureType>)>
809           callback) override;
810 #endif
811
812   bool IsClipboardPasteAllowed(
813       content::RenderFrameHost* render_frame_host) override;
814
815   void IsClipboardPasteContentAllowed(
816       content::WebContents* web_contents,
817       const GURL& url,
818       const ui::ClipboardFormatType& data_type,
819       ClipboardPasteData clipboard_paste_data,
820       IsClipboardPasteContentAllowedCallback callback) override;
821
822   bool IsClipboardCopyAllowed(content::BrowserContext* browser_context,
823                               const GURL& url,
824                               size_t data_size_in_bytes,
825                               std::u16string& replacement_data) override;
826
827 #if BUILDFLAG(ENABLE_VR)
828   content::XrIntegrationClient* GetXrIntegrationClient() override;
829 #endif
830
831   void BindBrowserControlInterface(mojo::ScopedMessagePipeHandle pipe) override;
832   bool ShouldInheritCrossOriginEmbedderPolicyImplicitly(
833       const GURL& url) override;
834   bool ShouldServiceWorkerInheritPolicyContainerFromCreator(
835       const GURL& url) override;
836   PrivateNetworkRequestPolicyOverride ShouldOverridePrivateNetworkRequestPolicy(
837       content::BrowserContext* browser_context,
838       const url::Origin& origin) override;
839   bool IsJitDisabledForSite(content::BrowserContext* browser_context,
840                             const GURL& site_url) override;
841   ukm::UkmService* GetUkmService() override;
842
843   blink::mojom::OriginTrialsSettingsPtr GetOriginTrialsSettings() override;
844
845   void OnKeepaliveRequestStarted(
846       content::BrowserContext* browser_context) override;
847   void OnKeepaliveRequestFinished() override;
848
849 #if BUILDFLAG(IS_MAC)
850   bool SetupEmbedderSandboxParameters(
851       sandbox::mojom::Sandbox sandbox_type,
852       sandbox::SandboxCompiler* compiler) override;
853 #endif  // BUILDFLAG(IS_MAC)
854
855   void GetHyphenationDictionary(
856       base::OnceCallback<void(const base::FilePath&)>) override;
857   bool HasErrorPage(int http_status_code) override;
858
859   StartupData* startup_data() { return &startup_data_; }
860
861   std::unique_ptr<content::IdentityRequestDialogController>
862   CreateIdentityRequestDialogController(
863       content::WebContents* web_contents) override;
864
865 #if !BUILDFLAG(IS_ANDROID)
866   base::TimeDelta GetKeepaliveTimerTimeout(content::BrowserContext* context);
867 #endif  // !BUILDFLAG(IS_ANDROID)
868
869   bool SuppressDifferentOriginSubframeJSDialogs(
870       content::BrowserContext* browser_context) override;
871
872   std::unique_ptr<content::AnchorElementPreconnectDelegate>
873   CreateAnchorElementPreconnectDelegate(
874       content::RenderFrameHost& render_frame_host) override;
875
876   std::unique_ptr<content::SpeculationHostDelegate>
877   CreateSpeculationHostDelegate(
878       content::RenderFrameHost& render_frame_host) override;
879
880   std::unique_ptr<content::PrefetchServiceDelegate>
881   CreatePrefetchServiceDelegate(
882       content::BrowserContext* browser_context) override;
883
884   std::unique_ptr<content::PrerenderWebContentsDelegate>
885   CreatePrerenderWebContentsDelegate() override;
886
887   void OnWebContentsCreated(content::WebContents* web_contents) override;
888
889   bool IsFindInPageDisabledForOrigin(const url::Origin& origin) override;
890   bool WillProvidePublicFirstPartySets() override;
891
892   bool ShouldPreconnectNavigation(
893       content::BrowserContext* browser_context) override;
894
895   bool ShouldDisableOriginAgentClusterDefault(
896       content::BrowserContext* browser_context) override;
897
898   content::mojom::AlternativeErrorPageOverrideInfoPtr
899   GetAlternativeErrorPageOverrideInfo(
900       const GURL& url,
901       content::RenderFrameHost* render_frame_host,
902       content::BrowserContext* browser_context,
903       int32_t error_code) override;
904
905   void OnSharedStorageWorkletHostCreated(
906       content::RenderFrameHost* rfh) override;
907
908   bool ShouldSendOutermostOriginToRenderer(
909       const url::Origin& outermost_origin) override;
910
911   bool IsFileSystemURLNavigationAllowed(
912       content::BrowserContext* browser_context,
913       const GURL& url) override;
914
915   bool AreIsolatedWebAppsEnabled(
916       content::BrowserContext* browser_context) override;
917
918   bool IsThirdPartyStoragePartitioningAllowed(
919       content::BrowserContext* browser_context,
920       const url::Origin& top_level_origin) override;
921
922   bool IsTransientActivationRequiredForShowFileOrDirectoryPicker(
923       content::WebContents* web_contents) override;
924
925   bool ShouldUseFirstPartyStorageKey(const url::Origin& origin) override;
926
927   std::unique_ptr<content::ResponsivenessCalculatorDelegate>
928   CreateResponsivenessCalculatorDelegate() override;
929
930   bool CanBackForwardCachedPageReceiveCookieChanges(
931       content::BrowserContext& browser_context,
932       const GURL& url,
933       const net::SiteForCookies& site_for_cookies,
934       const absl::optional<url::Origin>& top_frame_origin,
935       const net::CookieSettingOverrides overrides) override;
936
937   void GetCloudIdentifiers(
938       const storage::FileSystemURL& url,
939       content::FileSystemAccessPermissionContext::HandleType handle_type,
940       GetCloudIdentifiersCallback callback) override;
941
942   bool ShouldAllowBackForwardCacheForCacheControlNoStorePage(
943       content::BrowserContext* browser_context) override;
944
945   void SetIsMinimalMode(bool minimal) override;
946
947 #if !BUILDFLAG(IS_ANDROID)
948   void BindVideoEffectsManager(
949       const std::string& device_id,
950       content::BrowserContext* browser_context,
951       mojo::PendingReceiver<video_capture::mojom::VideoEffectsManager>
952           video_effects_manager) override;
953 #endif  // !BUILDFLAG(IS_ANDROID)
954
955  protected:
956   static bool HandleWebUI(GURL* url, content::BrowserContext* browser_context);
957   static bool HandleWebUIReverse(GURL* url,
958                                  content::BrowserContext* browser_context);
959   virtual const ui::NativeTheme* GetWebTheme() const;  // For testing.
960
961   // Used by subclasses (e.g. implemented by downstream embedders) to add
962   // their own extra part objects.
963   // TODO: This should receive unique_ptr<ChromeContentBrowserClientParts>.
964   void AddExtraPart(ChromeContentBrowserClientParts* part);
965
966  private:
967   friend class DisableWebRtcEncryptionFlagTest;
968   friend class InProcessBrowserTest;
969
970   FRIEND_TEST_ALL_PREFIXES(ChromeSiteIsolationPolicyTest,
971                            IsolatedOriginsContainChromeOrigins);
972
973   // Initializes `network_contexts_parent_directory_` and
974   // `safe_browsing_service_` on the UI thread.
975   void InitOnUIThread();
976
977   // Copies disable WebRTC encryption switch depending on the channel.
978   static void MaybeCopyDisableWebRtcEncryptionSwitch(
979       base::CommandLine* to_command_line,
980       const base::CommandLine& from_command_line,
981       version_info::Channel channel);
982
983   void FileSystemAccessed(
984       const GURL& url,
985       const std::vector<content::GlobalRenderFrameHostId>& render_frames,
986       base::OnceCallback<void(bool)> callback,
987       bool allow);
988
989 #if BUILDFLAG(ENABLE_EXTENSIONS)
990   void GuestPermissionRequestHelper(
991       const GURL& url,
992       const std::vector<content::GlobalRenderFrameHostId>& render_frames,
993       base::OnceCallback<void(bool)> callback,
994       bool allow);
995 #endif
996
997   // Returns the existing UrlCheckerDelegate object if it is already created.
998   // Otherwise, creates a new one and returns it. Updates the
999   // |allowlist_domains| in the UrlCheckerDelegate object before returning. It
1000   // returns nullptr if |safe_browsing_enabled_for_profile| is false, because it
1001   // should bypass safe browsing check when safe browsing is disabled. Set
1002   // |should_check_on_sb_disabled| to true if you still want to perform safe
1003   // browsing check when safe browsing is disabled(e.g. for enterprise real time
1004   // URL check).
1005   scoped_refptr<safe_browsing::UrlCheckerDelegate>
1006   GetSafeBrowsingUrlCheckerDelegate(
1007       bool safe_browsing_enabled_for_profile,
1008       bool should_check_on_sb_disabled,
1009       const std::vector<std::string>& allowlist_domains);
1010
1011   // Returns a RealTimeUrlLookupServiceBase object used for real time URL check.
1012   // Returns an enterprise version if |is_enterprise_lookup_enabled| is true.
1013   // Returns a consumer version if |is_enterprise_lookup_enabled| is false and
1014   // |is_consumer_lookup_enabled| is true. Returns nullptr if both are false.
1015   safe_browsing::RealTimeUrlLookupServiceBase* GetUrlLookupService(
1016       content::BrowserContext* browser_context,
1017       bool is_enterprise_lookup_enabled,
1018       bool is_consumer_lookup_enabled);
1019
1020   // Try to upload an enterprise legacy tech event to the enterprise management
1021   // server for admins.
1022   void ReportLegacyTechEvent(content::RenderFrameHost* render_frame_host,
1023                              const std::string type,
1024                              const GURL& url,
1025                              const std::string& filename,
1026                              uint64_t line,
1027                              uint64_t column) override;
1028
1029   void SafeBrowsingWebApiHandshakeChecked(
1030       std::unique_ptr<safe_browsing::WebApiHandshakeChecker> checker,
1031       int process_id,
1032       int frame_routing_id,
1033       const GURL& url,
1034       const url::Origin& initiator_origin,
1035       mojo::PendingRemote<network::mojom::WebTransportHandshakeClient>
1036           handshake_client,
1037       WillCreateWebTransportCallback callback,
1038       safe_browsing::WebApiHandshakeChecker::CheckResult result);
1039   void MaybeInterceptWebTransport(
1040       int process_id,
1041       int frame_routing_id,
1042       const GURL& url,
1043       const url::Origin& initiator_origin,
1044       mojo::PendingRemote<network::mojom::WebTransportHandshakeClient>
1045           handshake_client,
1046       WillCreateWebTransportCallback callback);
1047
1048 #if BUILDFLAG(SAFE_BROWSING_AVAILABLE)
1049   std::unique_ptr<blink::URLLoaderThrottle>
1050   MaybeCreateSafeBrowsingURLLoaderThrottle(
1051       const network::ResourceRequest& request,
1052       content::BrowserContext* browser_context,
1053       const base::RepeatingCallback<content::WebContents*()>& wc_getter,
1054       int frame_tree_node_id,
1055       Profile* profile);
1056 #endif
1057
1058 #if !BUILDFLAG(IS_ANDROID)
1059   void OnKeepaliveTimerFired(
1060       std::unique_ptr<ScopedKeepAlive> keep_alive_handle);
1061 #endif
1062
1063   // True if the Gaia origin should be isolated in a dedicated process.
1064   static bool DoesGaiaOriginRequireDedicatedProcess();
1065
1066   // Vector of additional ChromeContentBrowserClientParts.
1067   // Parts are deleted in the reverse order they are added.
1068   std::vector<std::unique_ptr<ChromeContentBrowserClientParts>> extra_parts_;
1069
1070   scoped_refptr<safe_browsing::SafeBrowsingService> safe_browsing_service_;
1071   scoped_refptr<safe_browsing::UrlCheckerDelegate>
1072       safe_browsing_url_checker_delegate_;
1073
1074   StartupData startup_data_;
1075
1076 #if !BUILDFLAG(IS_ANDROID)
1077   std::unique_ptr<ChromeSerialDelegate> serial_delegate_;
1078   std::unique_ptr<ChromeHidDelegate> hid_delegate_;
1079   std::unique_ptr<ChromeDirectSocketsDelegate> direct_sockets_delegate_;
1080   std::unique_ptr<ChromeWebAuthenticationDelegate> web_authentication_delegate_;
1081 #endif
1082   std::unique_ptr<permissions::BluetoothDelegateImpl> bluetooth_delegate_;
1083   std::unique_ptr<ChromeUsbDelegate> usb_delegate_;
1084   std::unique_ptr<ChromePrivateNetworkDeviceDelegate>
1085       private_network_device_delegate_;
1086
1087 #if BUILDFLAG(IS_CHROMEOS)
1088   std::unique_ptr<content::SmartCardDelegate> smart_card_delegate_;
1089 #endif  // BUILDFLAG(IS_CHROMEOS)
1090
1091 #if BUILDFLAG(ENABLE_VR)
1092   std::unique_ptr<vr::ChromeXrIntegrationClient> xr_integration_client_;
1093 #endif
1094
1095   // Returned from GetNetworkContextsParentDirectory() but created on the UI
1096   // thread because it needs to access the Local State prefs.
1097   std::vector<base::FilePath> network_contexts_parent_directory_;
1098
1099 #if !BUILDFLAG(IS_ANDROID)
1100   uint64_t num_keepalive_requests_ = 0;
1101   base::OneShotTimer keepalive_timer_;
1102   base::TimeTicks keepalive_deadline_;
1103 #endif
1104
1105 #if BUILDFLAG(IS_MAC)
1106   std::string GetChildProcessSuffix(int child_flags) override;
1107 #endif  // BUILDFLAG(IS_MAC)
1108
1109   // Tracks whether the browser was started in "minimal" mode (as opposed to
1110   // full browser mode), where most subsystems are not initialized.
1111   bool is_minimal_mode_ = false;
1112
1113   base::WeakPtrFactory<ChromeContentBrowserClient> weak_factory_{this};
1114 };
1115
1116 #endif  // CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_