blob: 59479aa31963425f43f2dfffd0e2bdbc4f70f383 [file] [log] [blame]
[email protected]8643e6d2012-01-18 20:26:101// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]d977f9c2011-03-14 16:10:262// 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_
[email protected]d977f9c2011-03-14 16:10:267
avie4d7b6f2015-12-26 00:59:188#include <stddef.h>
9
dcheng4af48582016-04-19 00:29:3510#include <memory>
[email protected]e461da2f2012-02-16 19:06:4011#include <set>
[email protected]c99c442e2011-08-24 11:37:3012#include <string>
[email protected]d9be47702012-05-16 03:41:2213#include <utility>
14#include <vector>
[email protected]c99c442e2011-08-24 11:37:3015
tzik070c8ffb2017-03-29 05:28:1216#include "base/callback.h"
Rayan Kanso411e84e2019-02-13 15:27:4017#include "base/containers/flat_map.h"
tfarina2176f4b2015-09-17 07:09:2618#include "base/macros.h"
yzshenefcb7c72017-06-16 23:12:3019#include "base/memory/ref_counted.h"
[email protected]2549f562014-07-24 02:55:3420#include "base/memory/weak_ptr.h"
Yutaka Hirano93e924742020-11-11 10:40:1321#include "base/timer/timer.h"
avie4d7b6f2015-12-26 00:59:1822#include "build/build_config.h"
Xi Han85079c22019-04-18 21:43:0523#include "chrome/browser/startup_data.h"
[email protected]87f3c082011-10-19 18:07:4424#include "content/public/browser/content_browser_client.h"
Hans Wennborg5ffd1392019-10-16 11:00:0225#include "content/public/browser/web_contents.h"
Scott Violetc8240b02018-03-08 22:03:5926#include "extensions/buildflags/buildflags.h"
Scott Violeta35f9a42018-03-22 22:00:4427#include "media/media_buildflags.h"
Miyoung Shin62622152019-08-27 05:13:0428#include "mojo/public/cpp/bindings/pending_receiver.h"
Julie Jeongeun Kimfb6f5302019-10-17 17:24:1029#include "mojo/public/cpp/bindings/pending_remote.h"
Scott Violet02e38b92018-03-27 23:42:1430#include "ppapi/buildflags/buildflags.h"
Yue Ru Sun03a6990a2020-10-24 18:04:3131#include "services/metrics/public/cpp/ukm_source_id.h"
Takuto Ikutaaa3b796c2019-02-06 02:54:5632#include "services/network/public/mojom/network_context.mojom-forward.h"
Hiroki Nakagawa41366152020-07-27 18:31:4033#include "third_party/blink/public/common/loader/previews_state.h"
[email protected]d977f9c2011-03-14 16:10:2634
[email protected]a48ab7112014-08-01 16:48:0335class ChromeContentBrowserClientParts;
Chris Palmerac7d75642017-11-22 20:12:5436class PrefRegistrySimple;
Yutaka Hirano93e924742020-11-11 10:40:1337class ScopedKeepAlive;
[email protected]a48ab7112014-08-01 16:48:0338
[email protected]2f3b1cc2014-03-17 23:07:1539namespace base {
40class CommandLine;
41}
42
scottmg8e6c6082017-02-13 23:15:4843namespace blink {
44namespace mojom {
45class WindowFeatures;
Donna Wu838ac362018-08-10 10:36:3346class WebUsbService;
Domenic Denicola3d8e4c8a2020-02-27 21:09:2847} // namespace mojom
Gyuyoung Kim1ac4ca782020-09-11 03:32:5148namespace web_pref {
49struct WebPreferences;
50} // namespace web_pref
Minggang Wangf6840ecf2019-07-29 05:15:0251class URLLoaderThrottle;
Domenic Denicola3d8e4c8a2020-02-27 21:09:2852} // namespace blink
scottmg8e6c6082017-02-13 23:15:4853
[email protected]9f9749a2012-03-02 19:37:0054namespace content {
bengre8a146f2016-03-10 01:20:2255class BrowserContext;
Olivier Yiptong935e6c42020-11-21 01:28:2356class FontAccessDelegate;
[email protected]9f9749a2012-03-02 19:37:0057class QuotaPermissionContext;
Domenic Denicola3d8e4c8a2020-02-27 21:09:2858} // namespace content
[email protected]9f9749a2012-03-02 19:37:0059
Ryan Sturmaa05092f2018-10-21 03:56:5460namespace data_reduction_proxy {
61class DataReductionProxyData;
62} // namespace data_reduction_proxy
63
64namespace previews {
65class PreviewsDecider;
66class PreviewsUserData;
67} // namespace previews
68
yzshenefcb7c72017-06-16 23:12:3069namespace safe_browsing {
Xinghui Lucf23c902020-06-10 17:38:2570class RealTimeUrlLookupServiceBase;
yzshenefcb7c72017-06-16 23:12:3071class SafeBrowsingService;
Yuzhu Shen44094e22017-07-18 22:52:3572class UrlCheckerDelegate;
Domenic Denicola3d8e4c8a2020-02-27 21:09:2873} // namespace safe_browsing
yzshenefcb7c72017-06-16 23:12:3074
Evan Liu054dc082020-09-30 14:09:4275namespace sandbox {
76class SeatbeltExecClient;
77} // namespace sandbox
78
Dan Beamf0a7e112019-06-07 18:40:5879namespace ui {
80class NativeTheme;
81}
82
83namespace url {
84class Origin;
85}
86
[email protected]443e9312013-05-06 06:17:3487namespace user_prefs {
[email protected]c753f142013-02-10 13:14:0488class PrefRegistrySyncable;
[email protected]443e9312013-05-06 06:17:3489}
[email protected]bca18382012-06-25 19:15:2390
sdefresne9fb67692015-08-03 18:48:2291namespace version_info {
92enum class Channel;
93}
94
Ovidio Henriquez3d729f62020-02-07 00:43:2995class ChromeBluetoothDelegate;
Olivier Yiptong935e6c42020-11-21 01:28:2396class ChromeFontAccessDelegate;
Matt Reynolds93616f9b2019-06-07 01:28:5297class ChromeHidDelegate;
Reilly Grant0d282322019-01-29 02:42:5898class ChromeSerialDelegate;
99
Alexander Cooperc8448702020-03-14 01:39:56100#if BUILDFLAG(ENABLE_VR)
101namespace vr {
102class ChromeXrIntegrationClient;
103}
104#endif
105
Yutaka Hirano968d6252018-12-04 05:09:31106// Returns the user agent of Chrome.
107std::string GetUserAgent();
108
Mike West6e4cbb32019-02-13 09:40:17109blink::UserAgentMetadata GetUserAgentMetadata();
110
Aaron Tagliaboschi19ad8d32020-05-12 20:10:44111blink::UserAgentBrandList GenerateBrandVersionList(
112 int seed,
113 base::Optional<std::string> brand,
Aaron Tagliaboschia06275dc2020-11-17 17:55:04114 std::string major_version,
115 base::Optional<std::string> maybe_greasey_brand);
Aaron Tagliaboschi19ad8d32020-05-12 20:10:44116
[email protected]d977f9c2011-03-14 16:10:26117class ChromeContentBrowserClient : public content::ContentBrowserClient {
118 public:
danakj5beedd02020-10-30 15:55:13119 ChromeContentBrowserClient();
Daniel Chenga542fca2014-10-21 09:51:29120 ~ChromeContentBrowserClient() override;
[email protected]e461da2f2012-02-16 19:06:40121
Chris Palmerac7d75642017-11-22 20:12:54122 // TODO(https://crbug.com/787567): This file is about calls from content/ out
123 // to chrome/ to get values or notify about events, but both of these
124 // functions are from chrome/ to chrome/ and don't involve content/ at all.
125 // That suggests they belong somewhere else at the chrome/ layer.
126 static void RegisterLocalStatePrefs(PrefRegistrySimple* registry);
[email protected]37ca3fe02013-07-05 15:32:44127 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
[email protected]bca18382012-06-25 19:15:23128
[email protected]eabbfb12013-04-05 23:28:35129 // Notification that the application locale has changed. This allows us to
130 // update our I/O thread cache of this value.
131 static void SetApplicationLocale(const std::string& locale);
132
Ahmed Fakhryd70bf37b2018-04-04 17:07:24133 // content::ContentBrowserClient:
Patrick Monette61dfef92019-05-30 23:06:27134 std::unique_ptr<content::BrowserMainParts> CreateBrowserMainParts(
mostynb01d8b10e2014-10-13 09:44:44135 const content::MainFunctionParams& parameters) override;
Gabriel Charettee926fc12019-12-16 19:00:02136 void PostAfterStartupTask(
137 const base::Location& from_here,
138 const scoped_refptr<base::SequencedTaskRunner>& task_runner,
139 base::OnceClosure task) override;
falkenb09d443f2016-04-07 12:36:12140 bool IsBrowserStartupComplete() override;
Gabriel Charettec8cca992017-08-10 18:21:49141 void SetBrowserStartupIsCompleteForTesting() override;
Daniel Chenga542fca2014-10-21 09:51:29142 std::string GetStoragePartitionIdForSite(
[email protected]d1198fd2012-08-13 22:50:19143 content::BrowserContext* browser_context,
mostynb01d8b10e2014-10-13 09:44:44144 const GURL& site) override;
John Abd-El-Malek9d57f9c2019-02-20 18:50:04145 bool IsShuttingDown() override;
Daniel Chenga542fca2014-10-21 09:51:29146 bool IsValidStoragePartitionId(content::BrowserContext* browser_context,
147 const std::string& partition_id) override;
Bret Sepulveda56652152020-06-24 14:47:13148 content::StoragePartitionConfig GetStoragePartitionConfigForSite(
[email protected]1bc28312012-11-08 08:31:53149 content::BrowserContext* browser_context,
Bret Sepulveda56652152020-06-24 14:47:13150 const GURL& site) override;
Daniel Chenga542fca2014-10-21 09:51:29151 content::WebContentsViewDelegate* GetWebContentsViewDelegate(
mostynb01d8b10e2014-10-13 09:44:44152 content::WebContents* web_contents) override;
Ken Rockot7c6275b2019-08-02 20:00:23153 void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
Bo Liu4ade6b1b22017-11-28 02:26:35154 bool AllowGpuLaunchRetryOnIOThread() override;
Daniel Chenga542fca2014-10-21 09:51:29155 GURL GetEffectiveURL(content::BrowserContext* browser_context,
Alex Moshchuka31c7882018-01-17 00:57:30156 const GURL& url) override;
Alexander Yashkin6aedc6e2018-08-15 08:58:45157 bool ShouldCompareEffectiveURLsForSiteInstanceSelection(
158 content::BrowserContext* browser_context,
159 content::SiteInstance* candidate_site_instance,
160 bool is_main_frame,
161 const GURL& candidate_url,
162 const GURL& destination_url) override;
Lucas Furukawa Gadani4909f3c2019-06-18 22:36:52163 bool ShouldUseMobileFlingCurve() override;
nickcc0d9142015-10-14 16:27:10164 bool ShouldUseProcessPerSite(content::BrowserContext* browser_context,
Aaron Colwellabb540b2020-05-05 19:15:59165 const GURL& site_url) override;
Lukasz Anforowicz32d27122018-04-09 21:48:33166 bool ShouldUseSpareRenderProcessHost(content::BrowserContext* browser_context,
167 const GURL& site_url) override;
Clark DuVall4e1f0a72019-08-07 22:41:42168 bool DoesSiteRequireDedicatedProcess(content::BrowserContext* browser_context,
169 const GURL& effective_site_url) override;
Aaron Colwell8812a972020-10-02 23:36:56170 bool ShouldLockProcessToSite(content::BrowserContext* browser_context,
171 const GURL& effective_site_url) override;
Nasko Oskov39023672020-05-06 17:31:14172 bool DoesWebUISchemeRequireProcessLock(base::StringPiece scheme) override;
Maks Orlovich0e23e312019-07-16 13:13:56173 bool ShouldTreatURLSchemeAsFirstPartyWhenTopLevel(
Lily Chen0db055b2019-11-15 20:29:02174 base::StringPiece scheme,
175 bool is_embedded_origin_secure) override;
176 bool ShouldIgnoreSameSiteCookieRestrictionsWhenTopLevel(
177 base::StringPiece scheme,
178 bool is_embedded_origin_secure) override;
Xiaohan Wang15a07af2020-05-28 23:24:55179 std::string GetSiteDisplayNameForCdmProcess(
180 content::BrowserContext* browser_context,
181 const GURL& site_url) override;
Lukasz Anforowicz7097890d2019-11-20 21:49:22182 void OverrideURLLoaderFactoryParams(
Lukasz Anforowicze00adef2019-12-06 23:07:02183 content::BrowserContext* browser_context,
Lukasz Anforowicz5f3352562019-11-14 16:53:59184 const url::Origin& origin,
Lukasz Anforowicze00adef2019-12-06 23:07:02185 bool is_for_isolated_world,
Lukasz Anforowicz7097890d2019-11-20 21:49:22186 network::mojom::URLLoaderFactoryParams* factory_params) override;
Daniel Chenga542fca2014-10-21 09:51:29187 void GetAdditionalWebUISchemes(
mostynb01d8b10e2014-10-13 09:44:44188 std::vector<std::string>* additional_schemes) override;
alexmos94875b3b2017-03-16 22:19:01189 void GetAdditionalViewSourceSchemes(
190 std::vector<std::string>* additional_schemes) override;
Lucas Furukawa Gadani4909f3c2019-06-18 22:36:52191 bool LogWebUIUrl(const GURL& web_ui_url) override;
John Abd-El-Malek04bfa8532018-07-12 05:28:22192 bool IsWebUIAllowedToMakeNetworkRequests(const url::Origin& origin) override;
Daniel Chenga542fca2014-10-21 09:51:29193 bool IsHandledURL(const GURL& url) override;
Frédéric Wang1eabba72020-10-23 15:36:55194 bool HasCustomSchemeHandler(content::BrowserContext* browser_context,
195 const std::string& scheme) override;
Daniel Chenga542fca2014-10-21 09:51:29196 bool CanCommitURL(content::RenderProcessHost* process_host,
197 const GURL& url) override;
Lukasz Anforowicz63f3b9432019-05-30 05:42:58198 void OverrideNavigationParams(
Scott Violet5ae6c42e2020-10-28 02:47:37199 content::WebContents* web_contents,
Lukasz Anforowicz63f3b9432019-05-30 05:42:58200 content::SiteInstance* site_instance,
201 ui::PageTransition* transition,
202 bool* is_renderer_initiated,
203 content::Referrer* referrer,
204 base::Optional<url::Origin>* initiator_origin) override;
Charles Reis29e9dd12017-09-28 00:59:15205 bool ShouldStayInParentProcessForNTP(
206 const GURL& url,
207 content::SiteInstance* parent_site_instance) override;
Daniel Chenga542fca2014-10-21 09:51:29208 bool IsSuitableHost(content::RenderProcessHost* process_host,
209 const GURL& site_url) override;
210 bool MayReuseHost(content::RenderProcessHost* process_host) override;
211 bool ShouldTryToUseExistingProcessHost(
212 content::BrowserContext* browser_context,
213 const GURL& url) override;
Alex Moshchuk9c9e3882018-11-02 19:57:03214 bool ShouldSubframesTryToReuseExistingProcess(
215 content::RenderFrameHost* main_frame) override;
Daniel Chenga542fca2014-10-21 09:51:29216 void SiteInstanceGotProcess(content::SiteInstance* site_instance) override;
217 void SiteInstanceDeleting(content::SiteInstance* site_instance) override;
218 bool ShouldSwapBrowsingInstancesForNavigation(
[email protected]e9841fbd2013-02-22 23:12:14219 content::SiteInstance* site_instance,
Aaron Colwell16b4985d2019-11-13 00:20:56220 const GURL& current_effective_url,
221 const GURL& destination_effective_url) override;
Nasko Oskovd83b5712018-05-04 04:50:57222 bool ShouldIsolateErrorPage(bool in_main_frame) override;
Daniel Chenga542fca2014-10-21 09:51:29223 bool ShouldAssignSiteForURL(const GURL& url) override;
Alex Moshchukd252c192017-07-17 22:03:48224 std::vector<url::Origin> GetOriginsRequiringDedicatedProcess() override;
Lukasz Anforowicz5e201abd2018-03-24 00:41:06225 bool ShouldEnableStrictSiteIsolation() override;
Aaron Colwell25617f72018-11-27 20:56:34226 bool ShouldDisableSiteIsolation() override;
Alex Moshchuk082b5f82019-03-14 01:34:16227 std::vector<std::string> GetAdditionalSiteIsolationModes() override;
Alex Moshchuke256d562019-04-26 21:43:57228 void PersistIsolatedOrigin(content::BrowserContext* context,
229 const url::Origin& origin) override;
Ken Rockot314714c2017-11-05 23:36:24230 bool IsFileAccessAllowed(const base::FilePath& path,
231 const base::FilePath& absolute_path,
232 const base::FilePath& profile_path) override;
Daniel Chenga542fca2014-10-21 09:51:29233 void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
234 int child_process_id) override;
Olivier Yiptong0daa93f2019-08-22 19:40:08235 std::string GetApplicationClientGUIDForQuarantineCheck() override;
Marijn Kruisselbrinkefe0bef62020-07-21 22:44:59236 download::QuarantineConnectionCallback GetQuarantineConnectionCallback()
237 override;
Daniel Chenga542fca2014-10-21 09:51:29238 std::string GetApplicationLocale() override;
239 std::string GetAcceptLangs(content::BrowserContext* context) override;
Dana Fried34d580002019-04-24 20:05:48240 gfx::ImageSkia GetDefaultFavicon() override;
bengre8a146f2016-03-10 01:20:22241 bool IsDataSaverEnabled(content::BrowserContext* context) override;
Kenichi Ishibashi46329872018-07-17 09:43:40242 void UpdateRendererPreferencesForWorker(
243 content::BrowserContext* browser_context,
Mario Sanchez Prada0bd8b8c2020-10-21 17:49:23244 blink::RendererPreferences* out_prefs) override;
Daniel Chenga542fca2014-10-21 09:51:29245 bool AllowAppCache(const GURL& manifest_url,
Christian Dullweber77740152020-05-12 09:54:17246
247 const GURL& site_for_cookies,
248 const base::Optional<url::Origin>& top_frame_origin,
Clark DuVall5690e742019-07-17 18:26:17249 content::BrowserContext* context) override;
John Abd-El-Malek70810942020-10-27 05:14:38250 content::AllowServiceWorkerResult AllowServiceWorker(
Matt Falkenhagen7b509e52019-08-15 23:11:41251 const GURL& scope,
Christian Dullweber2a2f2182019-09-25 15:44:54252 const GURL& site_for_cookies,
253 const base::Optional<url::Origin>& top_frame_origin,
Matt Falkenhagen7b509e52019-08-15 23:11:41254 const GURL& script_url,
Alexander Timin17edc742020-04-23 18:22:18255 content::BrowserContext* context) override;
Jochen Eisinger0ff7645c2017-11-28 08:11:26256 bool AllowSharedWorker(const GURL& worker_url,
Christian Dullweber2a2f2182019-09-25 15:44:54257 const GURL& site_for_cookies,
258 const base::Optional<url::Origin>& top_frame_origin,
Jochen Eisinger0ff7645c2017-11-28 08:11:26259 const std::string& name,
Hiroki Nakagawa018bb6d2017-11-30 03:31:37260 const url::Origin& constructor_origin,
Jochen Eisinger0ff7645c2017-11-28 08:11:26261 content::BrowserContext* context,
262 int render_process_id,
263 int render_frame_id) override;
Patrick Monette6cb099a2019-09-18 19:31:27264 bool DoesSchemeAllowCrossOriginSharedWorker(
265 const std::string& scheme) override;
Clark DuVallab63d142019-07-23 04:24:36266 bool AllowSignedExchange(content::BrowserContext* browser_context) override;
Daniel Chenga542fca2014-10-21 09:51:29267 void AllowWorkerFileSystem(
[email protected]5c5a88e2011-11-12 00:45:35268 const GURL& url,
John Abd-El-Malek2a18d98d2019-08-08 04:31:57269 content::BrowserContext* browser_context,
Lukasz Anforowicz09060bdf72018-08-23 15:53:17270 const std::vector<content::GlobalFrameRoutingId>& render_frames,
John Abd-El-Malek2a18d98d2019-08-08 04:31:57271 base::OnceCallback<void(bool)> callback) override;
Daniel Chenga542fca2014-10-21 09:51:29272 bool AllowWorkerIndexedDB(
[email protected]7c5ff9a2012-03-02 07:42:49273 const GURL& url,
John Abd-El-Malek2a18d98d2019-08-08 04:31:57274 content::BrowserContext* browser_context,
Lukasz Anforowicz09060bdf72018-08-23 15:53:17275 const std::vector<content::GlobalFrameRoutingId>& render_frames) override;
Ben Kelly6b2e61c2019-03-14 16:06:29276 bool AllowWorkerCacheStorage(
277 const GURL& url,
John Abd-El-Malek2a18d98d2019-08-08 04:31:57278 content::BrowserContext* browser_context,
Ben Kelly6b2e61c2019-03-14 16:06:29279 const std::vector<content::GlobalFrameRoutingId>& render_frames) override;
Joshua Bell1ebc8df2019-11-06 00:27:58280 bool AllowWorkerWebLocks(
281 const GURL& url,
282 content::BrowserContext* browser_context,
283 const std::vector<content::GlobalFrameRoutingId>& render_frames) override;
jyasskinc993ce8d2016-03-31 00:38:34284 AllowWebBluetoothResult AllowWebBluetooth(
285 content::BrowserContext* browser_context,
286 const url::Origin& requesting_origin,
287 const url::Origin& embedding_origin) override;
beaufort.francois01135bf2016-11-23 14:37:36288 std::string GetWebBluetoothBlocklist() override;
Charlie Harrison071ac922020-06-25 19:11:22289 bool AllowConversionMeasurement(
290 content::BrowserContext* browser_context) override;
John Abd-El-Malek21bca7c2018-10-26 22:13:33291#if defined(OS_CHROMEOS)
John Abd-El-Malek35bfaa52019-08-20 16:22:07292 void OnTrustAnchorUsed(content::BrowserContext* browser_context) override;
John Abd-El-Malek21bca7c2018-10-26 22:13:33293#endif
Reilly Grant19aaccd2018-07-16 22:06:37294 scoped_refptr<network::SharedURLLoaderFactory>
295 GetSystemSharedURLLoaderFactory() override;
Sean Gilhulyda1ee4b2018-11-13 21:56:09296 network::mojom::NetworkContext* GetSystemNetworkContext() override;
Andrew Moylan17329fc2017-09-25 07:43:30297 std::string GetGeolocationApiKey() override;
Ke He21ee87f2018-05-30 02:35:32298
299#if defined(OS_ANDROID)
300 bool ShouldUseGmsCoreGeolocationProvider() override;
301#endif
Yeolf3dc22ca2019-04-18 17:25:32302 scoped_refptr<content::QuotaPermissionContext> CreateQuotaPermissionContext()
303 override;
Mythri Alle0b8de0d2018-10-22 11:06:22304 content::GeneratedCodeCacheSettings GetGeneratedCodeCacheSettings(
305 content::BrowserContext* context) override;
Daniel Chenga542fca2014-10-21 09:51:29306 void AllowCertificateError(
clamy0d32d6d2015-11-24 11:16:26307 content::WebContents* web_contents,
[email protected]4cf611e32012-02-13 16:06:17308 int cert_error,
309 const net::SSLInfo& ssl_info,
310 const GURL& request_url,
John Abd-El-Malekc5b8df912019-05-07 17:02:23311 bool is_main_frame_request,
[email protected]d9be47702012-05-16 03:41:22312 bool strict_enforcement,
Erik Staaba65a6032019-11-27 22:23:26313 base::OnceCallback<void(content::CertificateRequestResultType)> callback)
314 override;
Katie D1882617e2020-05-06 20:06:01315#if !defined(OS_ANDROID)
316 bool ShouldDenyRequestOnCertificateError(const GURL main_page_url) override;
317#endif
Daniel McArdle85735f52019-06-25 03:27:06318 base::OnceClosure SelectClientCertificate(
davidben3b8455ae72015-03-11 19:42:19319 content::WebContents* web_contents,
[email protected]7a593db2012-02-13 21:19:40320 net::SSLCertRequestInfo* cert_request_info,
mattm436ccfe2017-06-19 20:24:08321 net::ClientCertIdentityList client_certs,
dcheng4af48582016-04-19 00:29:35322 std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
Daniel Chenga542fca2014-10-21 09:51:29323 content::MediaObserver* GetMediaObserver() override;
Adrienne Walker80d95f02020-02-07 22:37:04324 content::FeatureObserverClient* GetFeatureObserverClient() override;
Richard Knolld0eae962019-04-04 12:34:02325 content::PlatformNotificationService* GetPlatformNotificationService(
326 content::BrowserContext* browser_context) override;
csharrison95f01e922017-04-24 18:52:35327 bool CanCreateWindow(content::RenderFrameHost* opener,
nick5ae4d2d2017-01-06 01:18:35328 const GURL& opener_url,
Daniel Chenga542fca2014-10-21 09:51:29329 const GURL& opener_top_level_frame_url,
Nasko Oskove9f19782019-01-04 18:32:35330 const url::Origin& source_origin,
scottmgde42fb92017-02-10 17:56:03331 content::mojom::WindowContainerType container_type,
Daniel Chenga542fca2014-10-21 09:51:29332 const GURL& target_url,
333 const content::Referrer& referrer,
jochen67b271b2016-08-03 13:50:21334 const std::string& frame_name,
Daniel Chenga542fca2014-10-21 09:51:29335 WindowOpenDisposition disposition,
scottmg8e6c6082017-02-13 23:15:48336 const blink::mojom::WindowFeatures& features,
Daniel Chenga542fca2014-10-21 09:51:29337 bool user_gesture,
338 bool opener_suppressed,
Daniel Chenga542fca2014-10-21 09:51:29339 bool* no_javascript_access) override;
Daniel Chenga542fca2014-10-21 09:51:29340 content::SpeechRecognitionManagerDelegate*
zorkb548de082014-11-14 21:40:47341 CreateSpeechRecognitionManagerDelegate() override;
Scott Violet1644cf72020-06-24 04:51:55342#if defined(OS_CHROMEOS)
Katie D840d9532018-11-27 06:20:48343 content::TtsControllerDelegate* GetTtsControllerDelegate() override;
Scott Violet1644cf72020-06-24 04:51:55344#endif
Katie D4713ee42018-11-30 01:48:27345 content::TtsPlatform* GetTtsPlatform() override;
Daniel Chenga542fca2014-10-21 09:51:29346 void OverrideWebkitPrefs(content::RenderViewHost* rvh,
Gyuyoung Kim1ac4ca782020-09-11 03:32:51347 blink::web_pref::WebPreferences* prefs) override;
Rakina Zata Amni347b70902020-07-22 10:49:04348 bool OverrideWebPreferencesAfterNavigation(
349 content::WebContents* web_contents,
Gyuyoung Kim1ac4ca782020-09-11 03:32:51350 blink::web_pref::WebPreferences* prefs) override;
Daniel Chenga542fca2014-10-21 09:51:29351 void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) override;
Daniel Chenga542fca2014-10-21 09:51:29352 base::FilePath GetDefaultDownloadDirectory() override;
353 std::string GetDefaultDownloadName() override;
Dominik Röttsches47347832019-03-12 17:45:01354 base::FilePath GetFontLookupTableCacheDir() override;
jmadill57b52d42015-08-21 18:16:13355 base::FilePath GetShaderDiskCacheDirectory() override;
Khushal7ca0b782018-07-20 05:53:27356 base::FilePath GetGrShaderDiskCacheDirectory() override;
Daniel Chenga542fca2014-10-21 09:51:29357 void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override;
358 content::BrowserPpapiHost* GetExternalBrowserPpapiHost(
mostynb01d8b10e2014-10-13 09:44:44359 int plugin_process_id) override;
Daniel Chenga542fca2014-10-21 09:51:29360 bool AllowPepperSocketAPI(
[email protected]157cc902012-11-02 06:31:58361 content::BrowserContext* browser_context,
362 const GURL& url,
[email protected]dda54822013-06-15 01:26:39363 bool private_api,
mostynb01d8b10e2014-10-13 09:44:44364 const content::SocketPermissionRequest* params) override;
adrian.belgund54465ba2016-05-18 10:03:58365 bool IsPepperVpnProviderAPIAllowed(content::BrowserContext* browser_context,
366 const GURL& url) override;
adrian.belgun5b341c72016-06-22 22:24:08367 std::unique_ptr<content::VpnServiceProxy> GetVpnServiceProxy(
368 content::BrowserContext* browser_context) override;
Brett Wilson804e83c2017-08-18 22:57:33369 std::unique_ptr<ui::SelectFilePolicy> CreateSelectFilePolicy(
mostynb01d8b10e2014-10-13 09:44:44370 content::WebContents* web_contents) override;
Daniel Chenga542fca2014-10-21 09:51:29371 void GetAdditionalAllowedSchemesForFileSystem(
mostynb01d8b10e2014-10-13 09:44:44372 std::vector<std::string>* additional_schemes) override;
Ayu Ishiifbb1fad2020-06-22 20:15:07373 void GetSchemesBypassingSecureContextCheckAllowlist(
falkenad185092016-06-16 06:10:02374 std::set<std::string>* schemes) override;
Daniel Chenga542fca2014-10-21 09:51:29375 void GetURLRequestAutoMountHandlers(
mostynb01d8b10e2014-10-13 09:44:44376 std::vector<storage::URLRequestAutoMountHandler>* handlers) override;
Daniel Chenga542fca2014-10-21 09:51:29377 void GetAdditionalFileSystemBackends(
[email protected]0ff5eb52013-07-10 20:35:31378 content::BrowserContext* browser_context,
[email protected]02250952013-04-24 23:52:53379 const base::FilePath& storage_partition_path,
avid6d88b912017-01-13 00:16:00380 std::vector<std::unique_ptr<storage::FileSystemBackend>>*
381 additional_backends) override;
Daniel Chenga542fca2014-10-21 09:51:29382 content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override;
Rayan Kanso411e84e2019-02-13 15:27:40383 void UpdateDevToolsBackgroundServiceExpiration(
384 content::BrowserContext* browser_context,
385 int service,
386 base::Time expiration_time) override;
387 base::flat_map<int, base::Time> GetDevToolsBackgroundServiceExpirations(
388 content::BrowserContext* browser_context) override;
oysteinec563c582015-02-13 19:19:52389 content::TracingDelegate* GetTracingDelegate() override;
Daniel Chenga542fca2014-10-21 09:51:29390 bool IsPluginAllowedToCallRequestOSFileHandle(
[email protected]487974a2014-06-13 16:49:01391 content::BrowserContext* browser_context,
mostynb01d8b10e2014-10-13 09:44:44392 const GURL& url) override;
Daniel Chenga542fca2014-10-21 09:51:29393 bool IsPluginAllowedToUseDevChannelAPIs(
[email protected]aec5ed52014-06-20 07:51:42394 content::BrowserContext* browser_context,
mostynb01d8b10e2014-10-13 09:44:44395 const GURL& url) override;
mlamourif8c23a2002015-01-27 13:10:10396 void OverridePageVisibilityState(
397 content::RenderFrameHost* render_frame_host,
danakj0018a29a2018-12-01 01:03:43398 content::PageVisibilityState* visibility_state) override;
Avi Drissman2e458df2020-07-29 16:24:31399#if defined(OS_POSIX) && !defined(OS_MAC)
dchenge1bc7982014-10-30 00:32:40400 void GetAdditionalMappedFilesForChildProcess(
[email protected]2f3b1cc2014-03-17 23:07:15401 const base::CommandLine& command_line,
[email protected]40da3e0c2012-10-24 22:03:38402 int child_process_id,
brettw3c98c7d32017-07-25 01:44:20403 content::PosixFileDescriptorInfo* mappings) override;
Avi Drissman2e458df2020-07-29 16:24:31404#endif // defined(OS_POSIX) && !defined(OS_MAC)
[email protected]4a65826d2011-08-25 16:04:01405#if defined(OS_WIN)
Will Harris956e0ca2019-08-23 20:47:39406 bool PreSpawnRenderer(sandbox::TargetPolicy* policy,
407 RendererSpawnFlags flags) override;
Alex Gough9ab468a6c32019-12-10 19:10:22408 base::string16 GetAppContainerSidForSandboxType(
Robert Sesek7d0b49b2020-07-08 18:31:27409 sandbox::policy::SandboxType sandbox_type) override;
Will Harris956e0ca2019-08-23 20:47:39410 bool IsRendererCodeIntegrityEnabled() override;
[email protected]4a65826d2011-08-25 16:04:01411#endif
bend1dd50f52016-06-26 22:10:48412 void ExposeInterfacesToRenderer(
bena06f7d62017-04-04 20:48:52413 service_manager::BinderRegistry* registry,
Sam McNally52e50282017-11-29 00:54:02414 blink::AssociatedInterfaceRegistry* associated_registry,
leon.han0b618792016-06-16 01:53:51415 content::RenderProcessHost* render_process_host) override;
Robert Sesekc480a2e2020-04-09 17:26:11416 void BindMediaServiceReceiver(content::RenderFrameHost* render_frame_host,
417 mojo::GenericPendingReceiver receiver) override;
Oksana Zhuravlova4dd171e82019-08-16 20:54:00418 void RegisterBrowserInterfaceBindersForFrame(
Miyoung Shin70485f02019-12-05 05:21:03419 content::RenderFrameHost* render_frame_host,
Robert Sesek5a5fbb82020-05-04 16:18:28420 mojo::BinderMapWithContext<content::RenderFrameHost*>* map) override;
Julie Jeongeun Kimdb52a622019-09-18 00:20:20421 bool BindAssociatedReceiverFromFrame(
Ken Rockot0aad7ec2018-07-31 15:58:44422 content::RenderFrameHost* render_frame_host,
423 const std::string& interface_name,
424 mojo::ScopedInterfaceEndpointHandle* handle) override;
Steve Becker288faf02020-01-28 02:14:39425 void BindBadgeServiceReceiverFromServiceWorker(
426 content::RenderProcessHost* service_worker_process_host,
427 const GURL& service_worker_scope,
428 mojo::PendingReceiver<blink::mojom::BadgeService> receiver) override;
Ken Rockot251bc6e02019-09-17 21:46:33429 void BindGpuHostReceiver(mojo::GenericPendingReceiver receiver) override;
Lingqi Chif7ef80f62020-06-12 02:04:46430 void BindUtilityHostReceiver(mojo::GenericPendingReceiver receiver) override;
Ken Rockotc185b2a2019-08-01 22:19:48431 void BindHostReceiverForRenderer(
432 content::RenderProcessHost* render_process_host,
433 mojo::GenericPendingReceiver receiver) override;
danakja9fe91c2019-05-01 19:02:29434 void OpenURL(
435 content::SiteInstance* site_instance,
436 const content::OpenURLParams& params,
437 base::OnceCallback<void(content::WebContents*)> callback) override;
zhaobinf3704f82017-01-12 07:19:36438 content::ControllerPresentationServiceDelegate*
439 GetControllerPresentationServiceDelegate(
440 content::WebContents* web_contents) override;
441 content::ReceiverPresentationServiceDelegate*
442 GetReceiverPresentationServiceDelegate(
haibinlu9e605a92015-06-06 03:45:09443 content::WebContents* web_contents) override;
avid6d88b912017-01-13 00:16:00444 std::vector<std::unique_ptr<content::NavigationThrottle>>
445 CreateThrottlesForNavigation(content::NavigationHandle* handle) override;
clamy1e5574e2016-09-29 16:48:44446 std::unique_ptr<content::NavigationUIData> GetNavigationUIData(
447 content::NavigationHandle* navigation_handle) override;
Xiaohan Wanga4e41842018-06-26 18:45:10448 void GetHardwareSecureDecryptionCaps(
449 const std::string& key_system,
Xiaohan Wanga4e41842018-06-26 18:45:10450 base::flat_set<media::VideoCodec>* video_codecs,
Yuchen Liub33bfc12019-11-08 20:16:12451 base::flat_set<media::EncryptionScheme>* encryption_schemes) override;
miu54dca6c2016-11-17 10:59:38452#if BUILDFLAG(ENABLE_MEDIA_REMOTING)
Gyuyoung Kima4f9f942019-10-26 02:55:50453 void CreateMediaRemoter(
454 content::RenderFrameHost* render_frame_host,
455 mojo::PendingRemote<media::mojom::RemotingSource> source,
456 mojo::PendingReceiver<media::mojom::Remoter> receiver) final;
miu54dca6c2016-11-17 10:59:38457#endif // BUILDFLAG(ENABLE_MEDIA_REMOTING)
Michael Giuffrida6802ffe2017-09-29 03:40:25458 base::FilePath GetLoggingFileName(
459 const base::CommandLine& command_line) override;
Minggang Wangf6840ecf2019-07-29 05:15:02460 std::vector<std::unique_ptr<blink::URLLoaderThrottle>>
Clark DuVallfffa41e2019-06-25 20:27:19461 CreateURLLoaderThrottles(
462 const network::ResourceRequest& request,
463 content::BrowserContext* browser_context,
464 const base::RepeatingCallback<content::WebContents*()>& wc_getter,
465 content::NavigationUIData* navigation_ui_data,
466 int frame_tree_node_id) override;
Ken Rockot6414c4d92017-11-08 19:58:32467 void RegisterNonNetworkNavigationURLLoaderFactories(
John Abd-El-Malekea006302018-05-10 05:50:46468 int frame_tree_node_id,
Yue Ru Sun03a6990a2020-10-24 18:04:31469 ukm::SourceIdObj ukm_source_id,
Ken Rockot6414c4d92017-11-08 19:58:32470 NonNetworkURLLoaderFactoryMap* factories) override;
Hiroki Nakagawa1efa31d2019-10-01 22:36:34471 void RegisterNonNetworkWorkerMainResourceURLLoaderFactories(
472 content::BrowserContext* browser_context,
Lukasz Anforowicza782c5a2020-09-26 02:15:17473 NonNetworkURLLoaderFactoryMap* factories) override;
Ting Shao2dc60582019-07-15 04:43:36474 void RegisterNonNetworkServiceWorkerUpdateURLLoaderFactories(
475 content::BrowserContext* browser_context,
Lukasz Anforowicza782c5a2020-09-26 02:15:17476 NonNetworkURLLoaderFactoryMap* factories) override;
Ken Rockot6414c4d92017-11-08 19:58:32477 void RegisterNonNetworkSubresourceURLLoaderFactories(
John Abd-El-Malekea006302018-05-10 05:50:46478 int render_process_id,
479 int render_frame_id,
Ken Rockot6414c4d92017-11-08 19:58:32480 NonNetworkURLLoaderFactoryMap* factories) override;
Ken Rockota0dfaca12018-02-15 07:26:25481 bool WillCreateURLLoaderFactory(
Ken Rockot428b1d62018-06-06 17:12:21482 content::BrowserContext* browser_context,
Ken Rockota0dfaca12018-02-15 07:26:25483 content::RenderFrameHost* frame,
Kenichi Ishibashi09ee5e72018-11-27 07:12:38484 int render_process_id,
Karan Bhatia4a834b32019-08-16 22:26:44485 URLLoaderFactoryType type,
Lukasz Anforowicz762733652018-09-28 14:48:26486 const url::Origin& request_initiator,
Karan Bhatia303d0ac02019-12-05 03:01:00487 base::Optional<int64_t> navigation_id,
Yue Ru Sun03a6990a2020-10-24 18:04:31488 ukm::SourceIdObj ukm_source_id,
Dominic Farolino1be897a2019-07-20 08:11:42489 mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
Julie Jeongeun Kim47499a0c2019-08-28 07:23:18490 mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
491 header_client,
Yutaka Hirano499d13212019-12-04 11:03:33492 bool* bypass_redirect_checks,
dalyk0018c16f2020-01-08 20:20:08493 bool* disable_secure_dns,
Yutaka Hirano499d13212019-12-04 11:03:33494 network::mojom::URLLoaderFactoryOverridePtr* factory_override) override;
Jian Lide7b43792018-06-01 23:22:13495 std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>>
496 WillCreateURLLoaderRequestInterceptors(
497 content::NavigationUIData* navigation_ui_data,
Ryan Sturm27d93f412019-02-15 21:30:14498 int frame_tree_node_id,
499 const scoped_refptr<network::SharedURLLoaderFactory>&
500 network_loader_factory) override;
Yutaka Hirano8e0b4d432019-07-04 07:12:38501 bool WillInterceptWebSocket(content::RenderFrameHost* frame) override;
502 void CreateWebSocket(
Yutaka Hirano70fa25912018-06-06 05:26:54503 content::RenderFrameHost* frame,
Yutaka Hirano8e0b4d432019-07-04 07:12:38504 WebSocketFactory factory,
505 const GURL& url,
Maks Orlovichab27e242020-01-07 18:10:39506 const net::SiteForCookies& site_for_cookies,
Yutaka Hirano8e0b4d432019-07-04 07:12:38507 const base::Optional<std::string>& user_agent,
Julie Jeongeun Kim3e973f92019-08-22 08:02:40508 mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
509 handshake_client) override;
Maks Orlovich710d5e32019-07-09 20:16:45510 bool WillCreateRestrictedCookieManager(
Maks Orloviche7db7a22019-07-25 01:47:46511 network::mojom::RestrictedCookieManagerRole role,
Maks Orlovich710d5e32019-07-09 20:16:45512 content::BrowserContext* browser_context,
513 const url::Origin& origin,
Maks Orlovichab27e242020-01-07 18:10:39514 const net::SiteForCookies& site_for_cookies,
Maks Orlovich11001fa2019-10-01 20:41:40515 const url::Origin& top_frame_origin,
Maks Orlovich710d5e32019-07-09 20:16:45516 bool is_service_worker,
517 int process_id,
518 int routing_id,
Julie Jeongeun Kimd20f64b2019-08-26 04:13:03519 mojo::PendingReceiver<network::mojom::RestrictedCookieManager>* receiver)
520 override;
Matt Menkeae4fdb12018-06-02 06:32:54521 void OnNetworkServiceCreated(
522 network::mojom::NetworkService* network_service) override;
Matthew Denton8888ae52020-05-14 08:20:02523 void ConfigureNetworkContextParams(
Ken Rockota0dfaca12018-02-15 07:26:25524 content::BrowserContext* context,
525 bool in_memory,
Matthew Denton8888ae52020-05-14 08:20:02526 const base::FilePath& relative_partition_path,
527 network::mojom::NetworkContextParams* network_context_params,
528 network::mojom::CertVerifierCreationParams* cert_verifier_creation_params)
529 override;
Robert Sesek34f68f312019-01-14 20:25:11530 std::vector<base::FilePath> GetNetworkContextsParentDirectory() override;
John Abd-El-Malekc240cfc42020-07-08 12:22:44531 base::DictionaryValue GetNetLogConstants() override;
Min Qin75ed6df2017-12-01 20:39:15532 bool AllowRenderingMhtmlOverHttp(
Min Qin30a78a12017-12-06 01:29:13533 content::NavigationUIData* navigation_ui_data) override;
534 bool ShouldForceDownloadResource(const GURL& url,
535 const std::string& mime_type) override;
Donna Wu838ac362018-08-10 10:36:33536 void CreateWebUsbService(
Reilly Grantc31b8192017-12-15 19:54:34537 content::RenderFrameHost* render_frame_host,
Miyoung Shin62622152019-08-27 05:13:04538 mojo::PendingReceiver<blink::mojom::WebUsbService> receiver) override;
Ovidio Henriquez3d729f62020-02-07 00:43:29539 content::BluetoothDelegate* GetBluetoothDelegate() override;
Reilly Grant0d282322019-01-29 02:42:58540#if !defined(OS_ANDROID)
Anatoliy Potapchuk096e4d0a2020-12-01 16:49:21541 void CreateDeviceInfoService(
542 content::RenderFrameHost* render_frame_host,
543 mojo::PendingReceiver<blink::mojom::DeviceAPIService> receiver) override;
Reilly Grant0d282322019-01-29 02:42:58544 content::SerialDelegate* GetSerialDelegate() override;
Matt Reynolds93616f9b2019-06-07 01:28:52545 content::HidDelegate* GetHidDelegate() override;
Olivier Yiptong935e6c42020-11-21 01:28:23546 content::FontAccessDelegate* GetFontAccessDelegate() override;
Nina Satragno8c832df2019-07-29 15:59:39547 std::unique_ptr<content::AuthenticatorRequestClientDelegate>
548 GetWebAuthenticationRequestDelegate(
Adam Langley5f3963f12020-01-21 19:10:33549 content::RenderFrameHost* render_frame_host) override;
Nina Satragno8c832df2019-07-29 15:59:39550#endif
Anthony Vallee-Dubois8f5e7e12018-01-12 16:14:06551 bool ShowPaymentHandlerWindow(
552 content::BrowserContext* browser_context,
553 const GURL& url,
Anthony Vallee-Dubois98befeaa2018-01-18 16:31:32554 base::OnceCallback<void(bool, int, int)> callback) override;
Jun Cai9409ded2018-01-30 00:19:46555 std::unique_ptr<net::ClientCertStore> CreateClientCertStore(
David Benjaminf6a34092019-11-07 19:55:10556 content::BrowserContext* browser_context) override;
David Benjamineced01fc2019-02-27 18:29:02557 std::unique_ptr<content::LoginDelegate> CreateLoginDelegate(
Emily Starkf2c9bbd2019-04-09 17:08:58558 const net::AuthChallengeInfo& auth_info,
David Benjamineced01fc2019-02-27 18:29:02559 content::WebContents* web_contents,
Ken Rockot5f734e32018-06-13 01:41:03560 const content::GlobalRequestID& request_id,
Jun Cai8e165d22018-05-14 19:21:24561 bool is_request_for_main_frame,
Jun Caibc561f412018-02-28 18:41:39562 const GURL& url,
Ken Rockot5f734e32018-06-13 01:41:03563 scoped_refptr<net::HttpResponseHeaders> response_headers,
Jun Caibc561f412018-02-28 18:41:39564 bool first_auth_attempt,
Mark Pilgrim7cfcd112018-05-08 00:07:56565 LoginAuthRequiredCallback auth_required_callback) override;
John Abd-El-Maleka67add82018-03-09 18:22:01566 bool HandleExternalProtocol(
567 const GURL& url,
danakjf4b9e942019-11-29 15:43:04568 content::WebContents::OnceGetter web_contents_getter,
John Abd-El-Maleka67add82018-03-09 18:22:01569 int child_id,
570 content::NavigationUIData* navigation_data,
571 bool is_main_frame,
572 ui::PageTransition page_transition,
Tim Volodineb24393f32018-11-16 18:45:45573 bool has_user_gesture,
Emily Stark13b66bdf2019-10-04 17:11:45574 const base::Optional<url::Origin>& initiating_origin,
Julie Jeongeun Kimfb6f5302019-10-17 17:24:10575 mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory)
576 override;
Jennifer Apacible6010b0232018-04-12 23:35:28577 std::unique_ptr<content::OverlayWindow> CreateWindowForPictureInPicture(
578 content::PictureInPictureWindowController* controller) override;
Kunihiko Sakamoto19aa7082019-02-25 03:14:43579 void RegisterRendererPreferenceWatcher(
Makoto Shimazuc7502932018-08-15 02:12:56580 content::BrowserContext* browser_context,
Julie Jeongeun Kim6d8b7492019-08-20 19:24:11581 mojo::PendingRemote<blink::mojom::RendererPreferenceWatcher> watcher)
582 override;
Daniel Vogelheim6008f572018-09-24 14:35:14583 base::Optional<std::string> GetOriginPolicyErrorPage(
Domenic Denicolac3fedd42020-03-20 21:16:59584 network::OriginPolicyState error_reason,
Daniel Vogelheim7badd0d2019-02-04 14:42:18585 content::NavigationHandle* handle) override;
Takashi Toyoshima5af383aa2019-07-22 15:24:22586 bool CanAcceptUntrustedExchangesIfNeeded() override;
rajendrantfeea8592018-10-19 18:26:06587 void OnNetworkServiceDataUseUpdate(int32_t network_traffic_annotation_id_hash,
588 int64_t recv_bytes,
589 int64_t sent_bytes) override;
Ken Rockot4e284d32020-03-06 06:26:49590 base::FilePath GetSandboxedStorageServiceDataDirectory() override;
Guido Urdanetae02b5722020-07-22 05:58:21591 bool ShouldSandboxAudioService() override;
Hiroki Nakagawa41366152020-07-27 18:31:40592 blink::PreviewsState DetermineAllowedPreviews(
593 blink::PreviewsState initial_state,
Ryan Sturm647d1d92018-11-07 15:41:39594 content::NavigationHandle* navigation_handle,
595 const GURL& current_navigation_url) override;
Ryan Sturmaa05092f2018-10-21 03:56:54596
Hiroki Nakagawa41366152020-07-27 18:31:40597 blink::PreviewsState DetermineCommittedPreviews(
598 blink::PreviewsState initial_state,
Ryan Sturmaa05092f2018-10-21 03:56:54599 content::NavigationHandle* navigation_handle,
600 const net::HttpResponseHeaders* response_headers) override;
Robert Ogden30bbc9d2019-04-30 20:15:13601
Charlie Harrison650e11422018-12-04 00:37:26602 void LogWebFeatureForCurrentPage(content::RenderFrameHost* render_frame_host,
603 blink::mojom::WebFeature feature) override;
Ryan Sturmaa05092f2018-10-21 03:56:54604
Lucas Furukawa Gadani4909f3c2019-06-18 22:36:52605 std::string GetProduct() override;
606 std::string GetUserAgent() override;
607 blink::UserAgentMetadata GetUserAgentMetadata() override;
Yutaka Hirano968d6252018-12-04 05:09:31608
Lucas Furukawa Gadani4909f3c2019-06-18 22:36:52609 base::Optional<gfx::ImageSkia> GetProductLogo() override;
Austin Orione250d012019-05-29 02:56:27610
Sam McNallyd54e23f92019-01-16 04:42:39611 bool IsBuiltinComponent(content::BrowserContext* browser_context,
612 const url::Origin& origin) override;
613
Aaron Colwelle1908d982020-06-26 22:08:15614 bool ShouldBlockRendererDebugURL(const GURL& url,
615 content::BrowserContext* context) override;
Oleg Davydov2cc0167b2019-02-05 14:32:48616
Dominic Mazzoni21fb0282019-02-13 18:32:47617 ui::AXMode GetAXModeForBrowserContext(
618 content::BrowserContext* browser_context) override;
619
Eric Karld6cd75b2019-03-14 22:01:36620#if defined(OS_ANDROID)
621 ContentBrowserClient::WideColorGamutHeuristic GetWideColorGamutHeuristic()
Lucas Furukawa Gadani4909f3c2019-06-18 22:36:52622 override;
Eric Karld6cd75b2019-03-14 22:01:36623#endif
624
Ehsan Karamad466529d2019-05-24 03:24:43625 base::flat_set<std::string> GetPluginMimeTypesWithExternalHandlers(
Clark DuVall1df2052b2019-08-05 19:58:46626 content::BrowserContext* browser_context) override;
Ehsan Karamad91413d72019-03-22 16:37:48627
Yao Xiaod06607b2019-05-02 23:16:36628 void AugmentNavigationDownloadPolicy(
629 const content::WebContents* web_contents,
630 const content::RenderFrameHost* frame_host,
631 bool user_gesture,
Lucas Furukawa Gadani4909f3c2019-06-18 22:36:52632 content::NavigationDownloadPolicy* download_policy) override;
Yao Xiaod06607b2019-05-02 23:16:36633
Yao Xiaoebed8c12020-09-26 07:51:20634 std::string GetInterestCohortForJsApi(
635 content::BrowserContext* browser_context,
636 const url::Origin& requesting_origin,
637 const net::SiteForCookies& site_for_cookies) override;
638
Lucas Furukawa Gadani4909f3c2019-06-18 22:36:52639 bool IsBluetoothScanningBlocked(content::BrowserContext* browser_context,
640 const url::Origin& requesting_origin,
641 const url::Origin& embedding_origin) override;
Jun Cai732a05e32019-05-29 19:34:19642
Lucas Furukawa Gadani4909f3c2019-06-18 22:36:52643 void BlockBluetoothScanning(content::BrowserContext* browser_context,
644 const url::Origin& requesting_origin,
645 const url::Origin& embedding_origin) override;
Jun Cai732a05e32019-05-29 19:34:19646
Clark DuVall1635a6b02020-11-06 18:53:51647 bool ShouldLoadExtraIcuDataFile(std::string* split_name) override;
Tibor Goldschwendtbf1b96e2019-10-07 22:03:47648
Guido Urdaneta4030d6a32019-10-17 09:38:16649 bool ArePersistentMediaDeviceIDsAllowed(
650 content::BrowserContext* browser_context,
651 const GURL& scope,
652 const GURL& site_for_cookies,
653 const base::Optional<url::Origin>& top_frame_origin) override;
654
Hiroki Nakagawa41366152020-07-27 18:31:40655 blink::PreviewsState DetermineAllowedPreviewsWithoutHoldback(
656 blink::PreviewsState initial_state,
Robert Ogden30bbc9d2019-04-30 20:15:13657 content::NavigationHandle* navigation_handle,
658 const GURL& current_navigation_url);
659
Hiroki Nakagawa41366152020-07-27 18:31:40660 blink::PreviewsState DetermineCommittedPreviewsWithoutHoldback(
661 blink::PreviewsState initial_state,
Robert Ogden30bbc9d2019-04-30 20:15:13662 content::NavigationHandle* navigation_handle,
663 const net::HttpResponseHeaders* response_headers);
664
Ryan Sturmaa05092f2018-10-21 03:56:54665 // Determines the committed previews state for the passed in params.
Hiroki Nakagawa41366152020-07-27 18:31:40666 static blink::PreviewsState DetermineCommittedPreviewsForURL(
Ryan Sturmaa05092f2018-10-21 03:56:54667 const GURL& url,
668 data_reduction_proxy::DataReductionProxyData* drp_data,
669 previews::PreviewsUserData* previews_user_data,
670 const previews::PreviewsDecider* previews_decider,
Hiroki Nakagawa41366152020-07-27 18:31:40671 blink::PreviewsState initial_state,
Ryan Sturm737bd1d2019-02-28 01:38:05672 content::NavigationHandle* navigation_handle);
Ryan Sturmaa05092f2018-10-21 03:56:54673
Sam Goto5cf068e82019-11-04 23:08:44674#if !defined(OS_ANDROID)
675 void FetchRemoteSms(
676 content::BrowserContext* browser_context,
677 const url::Origin& origin,
678 base::OnceCallback<void(base::Optional<std::string>)> callback) override;
679#endif
680
Roger Tawa03ffdbd2020-01-16 18:12:54681 void IsClipboardPasteAllowed(
682 content::WebContents* web_contents,
683 const GURL& url,
684 const ui::ClipboardFormatType& data_type,
685 const std::string& data,
686 IsClipboardPasteAllowedCallback callback) override;
687
Lukasz Anforowicz4600ea32020-01-18 02:37:48688#if BUILDFLAG(ENABLE_PLUGINS)
689 bool ShouldAllowPluginCreation(
690 const url::Origin& embedder_origin,
691 const content::PepperPluginInfo& plugin_info) override;
692#endif
693
Alexander Cooperc8448702020-03-14 01:39:56694#if BUILDFLAG(ENABLE_VR)
695 content::XrIntegrationClient* GetXrIntegrationClient() override;
696#endif
697
Adrienne Walker297651292020-05-08 00:23:18698 bool IsOriginTrialRequiredForAppCache(
699 content::BrowserContext* browser_context) override;
Hidehiko Abe23e45e82020-08-25 08:41:48700 void BindBrowserControlInterface(mojo::ScopedMessagePipeHandle pipe) override;
Yutaka Hirano3e613662020-06-02 02:59:34701 bool ShouldInheritCrossOriginEmbedderPolicyImplicitly(
702 const GURL& url) override;
Titouan Rigoudycfc73552020-08-21 14:18:30703 bool ShouldAllowInsecurePrivateNetworkRequests(
Titouan Rigoudy9c2c0142020-08-19 17:57:12704 content::BrowserContext* browser_context,
705 const GURL& url) override;
John Abd-El-Malekdc026012020-06-15 23:28:56706 ukm::UkmService* GetUkmService() override;
Adrienne Walker297651292020-05-08 00:23:18707
Yutaka Hirano93e924742020-11-11 10:40:13708 void OnKeepaliveRequestStarted() override;
709 void OnKeepaliveRequestFinished() override;
710
Evan Liu054dc082020-09-30 14:09:42711#if defined(OS_MAC)
712 bool SetupEmbedderSandboxParameters(
713 sandbox::policy::SandboxType sandbox_type,
714 sandbox::SeatbeltExecClient* client) override;
715#endif // defined(OS_MAC)
716
Koji Ishii3cbd93a2020-10-16 13:48:02717 void GetHyphenationDictionary(
718 base::OnceCallback<void(const base::FilePath&)>) override;
Rakina Zata Amniba3eecb2020-11-02 10:12:28719 bool HasErrorPage(int http_status_code) override;
Koji Ishii3cbd93a2020-10-16 13:48:02720
danakj5beedd02020-10-30 15:55:13721 StartupData* startup_data() { return &startup_data_; }
722
Ken Buchanan7d688352020-12-05 05:45:57723 std::unique_ptr<content::IdentityRequestDialogController>
724 CreateIdentityRequestDialogController() override;
725
dbeam25472e0c2017-06-23 19:02:31726 protected:
727 static bool HandleWebUI(GURL* url, content::BrowserContext* browser_context);
728 static bool HandleWebUIReverse(GURL* url,
729 content::BrowserContext* browser_context);
Alison Maher7f366dc62020-03-03 19:46:00730 virtual const ui::NativeTheme* GetWebTheme() const; // For testing.
dbeam25472e0c2017-06-23 19:02:31731
Yngve N. Pettersen2a4565b2019-12-05 01:21:10732 // Used by subclasses (e.g. implemented by downstream embedders) to add
733 // their own extra part objects.
734 void AddExtraPart(ChromeContentBrowserClientParts* part) {
735 extra_parts_.push_back(part);
736 }
737
[email protected]e461da2f2012-02-16 19:06:40738 private:
[email protected]bfcf45662014-07-17 22:30:20739 friend class DisableWebRtcEncryptionFlagTest;
michaeln10e5fc352017-02-07 02:07:58740 friend class InProcessBrowserTest;
[email protected]bfcf45662014-07-17 22:30:20741
Robert Sesek466e43e2019-08-19 22:02:02742 // Initializes |network_contexts_parent_directory_| on the UI thread.
743 void InitNetworkContextsParentDirectory();
744
[email protected]30335fdf02014-02-26 19:51:27745 // Copies disable WebRTC encryption switch depending on the channel.
746 static void MaybeCopyDisableWebRtcEncryptionSwitch(
[email protected]2f3b1cc2014-03-17 23:07:15747 base::CommandLine* to_command_line,
748 const base::CommandLine& from_command_line,
sdefresne6e883e42015-07-30 08:05:54749 version_info::Channel channel);
[email protected]30335fdf02014-02-26 19:51:27750
[email protected]f917df22014-07-10 07:45:49751 void FileSystemAccessed(
[email protected]bfcf45662014-07-17 22:30:20752 const GURL& url,
Lukasz Anforowicz09060bdf72018-08-23 15:53:17753 const std::vector<content::GlobalFrameRoutingId>& render_frames,
John Abd-El-Malek2a18d98d2019-08-08 04:31:57754 base::OnceCallback<void(bool)> callback,
[email protected]bfcf45662014-07-17 22:30:20755 bool allow);
[email protected]f917df22014-07-10 07:45:49756
brettw00899e62016-11-12 02:10:17757#if BUILDFLAG(ENABLE_EXTENSIONS)
[email protected]bfcf45662014-07-17 22:30:20758 void GuestPermissionRequestHelper(
759 const GURL& url,
Lukasz Anforowicz09060bdf72018-08-23 15:53:17760 const std::vector<content::GlobalFrameRoutingId>& render_frames,
John Abd-El-Malek2a18d98d2019-08-08 04:31:57761 base::OnceCallback<void(bool)> callback,
[email protected]bfcf45662014-07-17 22:30:20762 bool allow);
[email protected]f917df22014-07-10 07:45:49763#endif
764
Xinghui Lucf23c902020-06-10 17:38:25765 // Returns the existing UrlCheckerDelegate object if it is already created.
766 // Otherwise, creates a new one and returns it. It returns nullptr if
767 // |safe_browsing_enabled_for_profile| is false, because it should bypass safe
768 // browsing check when safe browsing is disabled. Set
769 // |should_check_on_sb_disabled| to true if you still want to perform safe
770 // browsing check when safe browsing is disabled(e.g. for enterprise real time
771 // URL check).
Clark DuVall5497288d2019-07-17 00:17:56772 scoped_refptr<safe_browsing::UrlCheckerDelegate>
Xinghui Lucf23c902020-06-10 17:38:25773 GetSafeBrowsingUrlCheckerDelegate(bool safe_browsing_enabled_for_profile,
774 bool should_check_on_sb_disabled);
775
776 // Returns a RealTimeUrlLookupServiceBase object used for real time URL check.
777 // Returns an enterprise version if |is_enterprise_lookup_enabled| is true.
778 // Returns a consumer version if |is_enterprise_lookup_enabled| is false and
779 // |is_consumer_lookup_enabled| is true. Returns nullptr if both are false.
780 safe_browsing::RealTimeUrlLookupServiceBase* GetUrlLookupService(
781 content::BrowserContext* browser_context,
782 bool is_enterprise_lookup_enabled,
783 bool is_consumer_lookup_enabled);
Yuzhu Shen44094e22017-07-18 22:52:35784
Yutaka Hirano93e924742020-11-11 10:40:13785 void OnKeepaliveTimerFired(
786 std::unique_ptr<ScopedKeepAlive> keep_alive_handle);
787
[email protected]a48ab7112014-08-01 16:48:03788 // Vector of additional ChromeContentBrowserClientParts.
789 // Parts are deleted in the reverse order they are added.
790 std::vector<ChromeContentBrowserClientParts*> extra_parts_;
791
yzshenefcb7c72017-06-16 23:12:30792 scoped_refptr<safe_browsing::SafeBrowsingService> safe_browsing_service_;
Yuzhu Shen44094e22017-07-18 22:52:35793 scoped_refptr<safe_browsing::UrlCheckerDelegate>
794 safe_browsing_url_checker_delegate_;
yzshenefcb7c72017-06-16 23:12:30795
danakj5beedd02020-10-30 15:55:13796 StartupData startup_data_;
Xi Handdb1ab12018-08-27 22:18:54797
Reilly Grant0d282322019-01-29 02:42:58798#if !defined(OS_ANDROID)
799 std::unique_ptr<ChromeSerialDelegate> serial_delegate_;
Matt Reynolds93616f9b2019-06-07 01:28:52800 std::unique_ptr<ChromeHidDelegate> hid_delegate_;
Olivier Yiptong935e6c42020-11-21 01:28:23801 std::unique_ptr<ChromeFontAccessDelegate> font_access_delegate_;
Reilly Grant0d282322019-01-29 02:42:58802#endif
Ovidio Henriquez3d729f62020-02-07 00:43:29803 std::unique_ptr<ChromeBluetoothDelegate> bluetooth_delegate_;
Reilly Grant0d282322019-01-29 02:42:58804
Alexander Cooperc8448702020-03-14 01:39:56805#if BUILDFLAG(ENABLE_VR)
806 std::unique_ptr<vr::ChromeXrIntegrationClient> xr_integration_client_;
807#endif
808
Robert Sesek466e43e2019-08-19 22:02:02809 // Returned from GetNetworkContextsParentDirectory() but created on the UI
810 // thread because it needs to access the Local State prefs.
811 std::vector<base::FilePath> network_contexts_parent_directory_;
812
Yutaka Hirano93e924742020-11-11 10:40:13813#if !defined(OS_ANDROID)
814 uint64_t num_keepalive_requests_ = 0;
815 base::OneShotTimer keepalive_timer_;
816 base::TimeTicks last_keepalive_request_time_;
817#endif
818
Jeremy Roman495db682019-07-12 16:03:24819 base::WeakPtrFactory<ChromeContentBrowserClient> weak_factory_{this};
[email protected]30335fdf02014-02-26 19:51:27820
[email protected]e461da2f2012-02-16 19:06:40821 DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClient);
[email protected]d977f9c2011-03-14 16:10:26822};
823
[email protected]d977f9c2011-03-14 16:10:26824#endif // CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_