content_browser_client.h revision 03b57e008b61dfcb1fbad3aea950ae0e001748b0
1// Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 6#define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 7 8#include <map> 9#include <string> 10#include <utility> 11#include <vector> 12 13#include "base/callback_forward.h" 14#include "base/memory/linked_ptr.h" 15#include "base/memory/scoped_ptr.h" 16#include "base/memory/scoped_vector.h" 17#include "base/values.h" 18#include "content/public/browser/certificate_request_result_type.h" 19#include "content/public/browser/desktop_notification_delegate.h" 20#include "content/public/common/content_client.h" 21#include "content/public/common/resource_type.h" 22#include "content/public/common/socket_permission_request.h" 23#include "content/public/common/window_container_type.h" 24#include "net/base/mime_util.h" 25#include "net/cookies/canonical_cookie.h" 26#include "net/url_request/url_request_interceptor.h" 27#include "net/url_request/url_request_job_factory.h" 28#include "third_party/WebKit/public/platform/WebNotificationPermission.h" 29#include "ui/base/window_open_disposition.h" 30#include "webkit/browser/fileapi/file_system_context.h" 31 32#if defined(OS_POSIX) && !defined(OS_MACOSX) 33#include "base/posix/global_descriptors.h" 34#endif 35 36#if defined(OS_POSIX) 37#include "content/public/browser/file_descriptor_info.h" 38#endif 39 40class GURL; 41 42namespace base { 43class CommandLine; 44class DictionaryValue; 45class FilePath; 46} 47 48namespace blink { 49struct WebWindowFeatures; 50} 51 52namespace gfx { 53class ImageSkia; 54} 55 56namespace net { 57class CookieOptions; 58class CookieStore; 59class HttpNetworkSession; 60class NetLog; 61class SSLCertRequestInfo; 62class SSLInfo; 63class URLRequest; 64class URLRequestContext; 65class URLRequestContextGetter; 66class X509Certificate; 67} 68 69namespace sandbox { 70class TargetPolicy; 71} 72 73namespace ui { 74class SelectFilePolicy; 75} 76 77namespace storage { 78class ExternalMountPoints; 79class FileSystemBackend; 80} 81 82namespace content { 83 84class AccessTokenStore; 85class BrowserChildProcessHost; 86class BrowserContext; 87class BrowserMainParts; 88class BrowserPluginGuestDelegate; 89class BrowserPpapiHost; 90class BrowserURLHandler; 91class DesktopNotificationDelegate; 92class DevToolsManagerDelegate; 93class ExternalVideoSurfaceContainer; 94class LocationProvider; 95class MediaObserver; 96class QuotaPermissionContext; 97class RenderFrameHost; 98class RenderProcessHost; 99class RenderViewHost; 100class ResourceContext; 101class SiteInstance; 102class SpeechRecognitionManagerDelegate; 103class VibrationProvider; 104class WebContents; 105class WebContentsViewDelegate; 106struct MainFunctionParams; 107struct Referrer; 108struct ShowDesktopNotificationHostMsgParams; 109struct WebPreferences; 110 111// A mapping from the scheme name to the protocol handler that services its 112// content. 113typedef std::map< 114 std::string, linked_ptr<net::URLRequestJobFactory::ProtocolHandler> > 115 ProtocolHandlerMap; 116 117// A scoped vector of protocol interceptors. 118typedef ScopedVector<net::URLRequestInterceptor> 119 URLRequestInterceptorScopedVector; 120 121// Embedder API (or SPI) for participating in browser logic, to be implemented 122// by the client of the content browser. See ChromeContentBrowserClient for the 123// principal implementation. The methods are assumed to be called on the UI 124// thread unless otherwise specified. Use this "escape hatch" sparingly, to 125// avoid the embedder interface ballooning and becoming very specific to Chrome. 126// (Often, the call out to the client can happen in a different part of the code 127// that either already has a hook out to the embedder, or calls out to one of 128// the observer interfaces.) 129class CONTENT_EXPORT ContentBrowserClient { 130 public: 131 virtual ~ContentBrowserClient() {} 132 133 // Allows the embedder to set any number of custom BrowserMainParts 134 // implementations for the browser startup code. See comments in 135 // browser_main_parts.h. 136 virtual BrowserMainParts* CreateBrowserMainParts( 137 const MainFunctionParams& parameters); 138 139 // If content creates the WebContentsView implementation, it will ask the 140 // embedder to return an (optional) delegate to customize it. The view will 141 // own the delegate. 142 virtual WebContentsViewDelegate* GetWebContentsViewDelegate( 143 WebContents* web_contents); 144 145 // Notifies that a render process will be created. This is called before 146 // the content layer adds its own BrowserMessageFilters, so that the 147 // embedder's IPC filters have priority. 148 virtual void RenderProcessWillLaunch(RenderProcessHost* host) {} 149 150 // Notifies that a BrowserChildProcessHost has been created. 151 virtual void BrowserChildProcessHostCreated(BrowserChildProcessHost* host) {} 152 153 // Get the effective URL for the given actual URL, to allow an embedder to 154 // group different url schemes in the same SiteInstance. 155 virtual GURL GetEffectiveURL(BrowserContext* browser_context, 156 const GURL& url); 157 158 // Returns whether all instances of the specified effective URL should be 159 // rendered by the same process, rather than using process-per-site-instance. 160 virtual bool ShouldUseProcessPerSite(BrowserContext* browser_context, 161 const GURL& effective_url); 162 163 // Returns a list additional WebUI schemes, if any. These additional schemes 164 // act as aliases to the chrome: scheme. The additional schemes may or may 165 // not serve specific WebUI pages depending on the particular URLDataSource 166 // and its override of URLDataSource::ShouldServiceRequest. For all schemes 167 // returned here, view-source is allowed. 168 virtual void GetAdditionalWebUISchemes( 169 std::vector<std::string>* additional_schemes) {} 170 171 // Returns a list of webUI hosts to ignore the storage partition check in 172 // URLRequestChromeJob::CheckStoragePartitionMatches. 173 virtual void GetAdditionalWebUIHostsToIgnoreParititionCheck( 174 std::vector<std::string>* hosts) {} 175 176 // Creates the main net::URLRequestContextGetter. Should only be called once 177 // per ContentBrowserClient object. 178 // TODO(ajwong): Remove once http://crbug.com/159193 is resolved. 179 virtual net::URLRequestContextGetter* CreateRequestContext( 180 BrowserContext* browser_context, 181 ProtocolHandlerMap* protocol_handlers, 182 URLRequestInterceptorScopedVector request_interceptors); 183 184 // Creates the net::URLRequestContextGetter for a StoragePartition. Should 185 // only be called once per partition_path per ContentBrowserClient object. 186 // TODO(ajwong): Remove once http://crbug.com/159193 is resolved. 187 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( 188 BrowserContext* browser_context, 189 const base::FilePath& partition_path, 190 bool in_memory, 191 ProtocolHandlerMap* protocol_handlers, 192 URLRequestInterceptorScopedVector request_interceptors); 193 194 // Returns whether a specified URL is handled by the embedder's internal 195 // protocol handlers. 196 virtual bool IsHandledURL(const GURL& url); 197 198 // Returns whether the given process is allowed to commit |url|. This is a 199 // more conservative check than IsSuitableHost, since it is used after a 200 // navigation has committed to ensure that the process did not exceed its 201 // authority. 202 virtual bool CanCommitURL(RenderProcessHost* process_host, const GURL& url); 203 204 // Returns whether a URL should be allowed to open from a specific context. 205 // This also applies in cases where the new URL will open in another process. 206 virtual bool ShouldAllowOpenURL(SiteInstance* site_instance, const GURL& url); 207 208 // Returns whether a new view for a given |site_url| can be launched in a 209 // given |process_host|. 210 virtual bool IsSuitableHost(RenderProcessHost* process_host, 211 const GURL& site_url); 212 213 // Returns whether a new view for a new site instance can be added to a 214 // given |process_host|. 215 virtual bool MayReuseHost(RenderProcessHost* process_host); 216 217 // Returns whether a new process should be created or an existing one should 218 // be reused based on the URL we want to load. This should return false, 219 // unless there is a good reason otherwise. 220 virtual bool ShouldTryToUseExistingProcessHost( 221 BrowserContext* browser_context, const GURL& url); 222 223 // Called when a site instance is first associated with a process. 224 virtual void SiteInstanceGotProcess(SiteInstance* site_instance) {} 225 226 // Called from a site instance's destructor. 227 virtual void SiteInstanceDeleting(SiteInstance* site_instance) {} 228 229 // Returns true if for the navigation from |current_url| to |new_url| 230 // in |site_instance|, a new SiteInstance and BrowsingInstance should be 231 // created (even if we are in a process model that doesn't usually swap.) 232 // This forces a process swap and severs script connections with existing 233 // tabs. 234 virtual bool ShouldSwapBrowsingInstancesForNavigation( 235 SiteInstance* site_instance, 236 const GURL& current_url, 237 const GURL& new_url); 238 239 // Returns true if the given navigation redirect should cause a renderer 240 // process swap. 241 // This is called on the IO thread. 242 virtual bool ShouldSwapProcessesForRedirect(ResourceContext* resource_context, 243 const GURL& current_url, 244 const GURL& new_url); 245 246 // Returns true if the passed in URL should be assigned as the site of the 247 // current SiteInstance, if it does not yet have a site. 248 virtual bool ShouldAssignSiteForURL(const GURL& url); 249 250 // See CharacterEncoding's comment. 251 virtual std::string GetCanonicalEncodingNameByAliasName( 252 const std::string& alias_name); 253 254 // Allows the embedder to pass extra command line flags. 255 // switches::kProcessType will already be set at this point. 256 virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line, 257 int child_process_id) {} 258 259 // Returns the locale used by the application. 260 // This is called on the UI and IO threads. 261 virtual std::string GetApplicationLocale(); 262 263 // Returns the languages used in the Accept-Languages HTTP header. 264 // (Not called GetAcceptLanguages so it doesn't clash with win32). 265 virtual std::string GetAcceptLangs(BrowserContext* context); 266 267 // Returns the default favicon. The callee doesn't own the given bitmap. 268 virtual const gfx::ImageSkia* GetDefaultFavicon(); 269 270 // Allow the embedder to control if an AppCache can be used for the given url. 271 // This is called on the IO thread. 272 virtual bool AllowAppCache(const GURL& manifest_url, 273 const GURL& first_party, 274 ResourceContext* context); 275 276 // Allow the embedder to control if the given cookie can be read. 277 // This is called on the IO thread. 278 virtual bool AllowGetCookie(const GURL& url, 279 const GURL& first_party, 280 const net::CookieList& cookie_list, 281 ResourceContext* context, 282 int render_process_id, 283 int render_frame_id); 284 285 // Allow the embedder to control if the given cookie can be set. 286 // This is called on the IO thread. 287 virtual bool AllowSetCookie(const GURL& url, 288 const GURL& first_party, 289 const std::string& cookie_line, 290 ResourceContext* context, 291 int render_process_id, 292 int render_frame_id, 293 net::CookieOptions* options); 294 295 // This is called on the IO thread. 296 virtual bool AllowSaveLocalState(ResourceContext* context); 297 298 // Allow the embedder to control if access to web database by a shared worker 299 // is allowed. |render_frame| is a vector of pairs of 300 // RenderProcessID/RenderFrameID of RenderFrame that are using this worker. 301 // This is called on the IO thread. 302 virtual bool AllowWorkerDatabase( 303 const GURL& url, 304 const base::string16& name, 305 const base::string16& display_name, 306 unsigned long estimated_size, 307 ResourceContext* context, 308 const std::vector<std::pair<int, int> >& render_frames); 309 310 // Allow the embedder to control if access to file system by a shared worker 311 // is allowed. 312 // This is called on the IO thread. 313 virtual void AllowWorkerFileSystem( 314 const GURL& url, 315 ResourceContext* context, 316 const std::vector<std::pair<int, int> >& render_frames, 317 base::Callback<void(bool)> callback); 318 319 // Allow the embedder to control if access to IndexedDB by a shared worker 320 // is allowed. 321 // This is called on the IO thread. 322 virtual bool AllowWorkerIndexedDB( 323 const GURL& url, 324 const base::string16& name, 325 ResourceContext* context, 326 const std::vector<std::pair<int, int> >& render_frames); 327 328 // Allow the embedder to override the request context based on the URL for 329 // certain operations, like cookie access. Returns NULL to indicate the 330 // regular request context should be used. 331 // This is called on the IO thread. 332 virtual net::URLRequestContext* OverrideRequestContextForURL( 333 const GURL& url, ResourceContext* context); 334 335 // Allow the embedder to specify a string version of the storage partition 336 // config with a site. 337 virtual std::string GetStoragePartitionIdForSite( 338 BrowserContext* browser_context, 339 const GURL& site); 340 341 // Allows the embedder to provide a validation check for |partition_id|s. 342 // This domain of valid entries should match the range of outputs for 343 // GetStoragePartitionIdForChildProcess(). 344 virtual bool IsValidStoragePartitionId(BrowserContext* browser_context, 345 const std::string& partition_id); 346 347 // Allows the embedder to provide a storage parititon configuration for a 348 // site. A storage partition configuration includes a domain of the embedder's 349 // choice, an optional name within that domain, and whether the partition is 350 // in-memory only. 351 // 352 // If |can_be_default| is false, the caller is telling the embedder that the 353 // |site| is known to not be in the default partition. This is useful in 354 // some shutdown situations where the bookkeeping logic that maps sites to 355 // their partition configuration are no longer valid. 356 // 357 // The |partition_domain| is [a-z]* UTF-8 string, specifying the domain in 358 // which partitions live (similar to namespace). Within a domain, partitions 359 // can be uniquely identified by the combination of |partition_name| and 360 // |in_memory| values. When a partition is not to be persisted, the 361 // |in_memory| value must be set to true. 362 virtual void GetStoragePartitionConfigForSite( 363 BrowserContext* browser_context, 364 const GURL& site, 365 bool can_be_default, 366 std::string* partition_domain, 367 std::string* partition_name, 368 bool* in_memory); 369 370 // Create and return a new quota permission context. 371 virtual QuotaPermissionContext* CreateQuotaPermissionContext(); 372 373 // Informs the embedder that a certificate error has occured. If 374 // |overridable| is true and if |strict_enforcement| is false, the user 375 // can ignore the error and continue. The embedder can call the callback 376 // asynchronously. If |result| is not set to 377 // CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE, the request will be cancelled 378 // or denied immediately, and the callback won't be run. 379 virtual void AllowCertificateError(int render_process_id, 380 int render_frame_id, 381 int cert_error, 382 const net::SSLInfo& ssl_info, 383 const GURL& request_url, 384 ResourceType resource_type, 385 bool overridable, 386 bool strict_enforcement, 387 bool expired_previous_decision, 388 const base::Callback<void(bool)>& callback, 389 CertificateRequestResultType* result) {} 390 391 // Selects a SSL client certificate and returns it to the |callback|. If no 392 // certificate was selected NULL is returned to the |callback|. 393 virtual void SelectClientCertificate( 394 int render_process_id, 395 int render_frame_id, 396 const net::HttpNetworkSession* network_session, 397 net::SSLCertRequestInfo* cert_request_info, 398 const base::Callback<void(net::X509Certificate*)>& callback) {} 399 400 // Adds a new installable certificate or private key. 401 // Typically used to install an X.509 user certificate. 402 // Note that it's up to the embedder to verify that the data is 403 // well-formed. |cert_data| will be NULL if |cert_size| is 0. 404 virtual void AddCertificate(net::CertificateMimeType cert_type, 405 const void* cert_data, 406 size_t cert_size, 407 int render_process_id, 408 int render_frame_id) {} 409 410 // Returns a class to get notifications about media event. The embedder can 411 // return NULL if they're not interested. 412 virtual MediaObserver* GetMediaObserver(); 413 414 // Asks permission to show desktop notifications. |callback| needs to be run 415 // when the user approves the request. 416 virtual void RequestDesktopNotificationPermission( 417 const GURL& source_origin, 418 RenderFrameHost* render_frame_host, 419 const base::Callback<void(blink::WebNotificationPermission)>& callback) {} 420 421 // Checks if the given page has permission to show desktop notifications. 422 // This is called on the IO thread. 423 virtual blink::WebNotificationPermission 424 CheckDesktopNotificationPermission( 425 const GURL& source_url, 426 ResourceContext* context, 427 int render_process_id); 428 429 // Show a desktop notification. If |cancel_callback| is non-null, it's set to 430 // a callback which can be used to cancel the notification. 431 virtual void ShowDesktopNotification( 432 const ShowDesktopNotificationHostMsgParams& params, 433 RenderFrameHost* render_frame_host, 434 scoped_ptr<DesktopNotificationDelegate> delegate, 435 base::Closure* cancel_callback) {} 436 437 // The renderer is requesting permission to use Geolocation. When the answer 438 // to a permission request has been determined, |result_callback| should be 439 // called with the result. If |cancel_callback| is non-null, it's set to a 440 // callback which can be used to cancel the permission request. 441 virtual void RequestGeolocationPermission( 442 WebContents* web_contents, 443 int bridge_id, 444 const GURL& requesting_frame, 445 bool user_gesture, 446 base::Callback<void(bool)> result_callback, 447 base::Closure* cancel_callback); 448 449 // Invoked when the Geolocation API uses its permission. 450 virtual void DidUseGeolocationPermission(WebContents* web_contents, 451 const GURL& frame_url, 452 const GURL& main_frame_url) {} 453 454 // Requests a permission to use system exclusive messages in MIDI events. 455 // |result_callback| will be invoked when the request is resolved. If 456 // |cancel_callback| is non-null, it's set to a callback which can be used to 457 // cancel the permission request. 458 virtual void RequestMidiSysExPermission( 459 WebContents* web_contents, 460 int bridge_id, 461 const GURL& requesting_frame, 462 bool user_gesture, 463 base::Callback<void(bool)> result_callback, 464 base::Closure* cancel_callback); 465 466 // Request permission to access protected media identifier. |result_callback 467 // will tell whether it's permitted. If |cancel_callback| is non-null, it's 468 // set to a callback which can be used to cancel the permission request. 469 virtual void RequestProtectedMediaIdentifierPermission( 470 WebContents* web_contents, 471 const GURL& origin, 472 base::Callback<void(bool)> result_callback, 473 base::Closure* cancel_callback); 474 475 // Returns true if the given page is allowed to open a window of the given 476 // type. If true is returned, |no_javascript_access| will indicate whether 477 // the window that is created should be scriptable/in the same process. 478 // This is called on the IO thread. 479 virtual bool CanCreateWindow(const GURL& opener_url, 480 const GURL& opener_top_level_frame_url, 481 const GURL& source_origin, 482 WindowContainerType container_type, 483 const GURL& target_url, 484 const Referrer& referrer, 485 WindowOpenDisposition disposition, 486 const blink::WebWindowFeatures& features, 487 bool user_gesture, 488 bool opener_suppressed, 489 ResourceContext* context, 490 int render_process_id, 491 int opener_id, 492 bool* no_javascript_access); 493 494 // Notifies the embedder that the ResourceDispatcherHost has been created. 495 // This is when it can optionally add a delegate. 496 virtual void ResourceDispatcherHostCreated() {} 497 498 // Allows the embedder to return a delegate for the SpeechRecognitionManager. 499 // The delegate will be owned by the manager. It's valid to return NULL. 500 virtual SpeechRecognitionManagerDelegate* 501 GetSpeechRecognitionManagerDelegate(); 502 503 // Getters for common objects. 504 virtual net::NetLog* GetNetLog(); 505 506 // Creates a new AccessTokenStore for gelocation. 507 virtual AccessTokenStore* CreateAccessTokenStore(); 508 509 // Returns true if fast shutdown is possible. 510 virtual bool IsFastShutdownPossible(); 511 512 // Called by WebContents to override the WebKit preferences that are used by 513 // the renderer. The content layer will add its own settings, and then it's up 514 // to the embedder to update it if it wants. 515 virtual void OverrideWebkitPrefs(RenderViewHost* render_view_host, 516 const GURL& url, 517 WebPreferences* prefs) {} 518 519 // Notifies that BrowserURLHandler has been created, so that the embedder can 520 // optionally add their own handlers. 521 virtual void BrowserURLHandlerCreated(BrowserURLHandler* handler) {} 522 523 // Clears browser cache. 524 virtual void ClearCache(RenderViewHost* rvh) {} 525 526 // Clears browser cookies. 527 virtual void ClearCookies(RenderViewHost* rvh) {} 528 529 // Returns the default download directory. 530 // This can be called on any thread. 531 virtual base::FilePath GetDefaultDownloadDirectory(); 532 533 // Returns the default filename used in downloads when we have no idea what 534 // else we should do with the file. 535 virtual std::string GetDefaultDownloadName(); 536 537 // Notification that a pepper plugin has just been spawned. This allows the 538 // embedder to add filters onto the host to implement interfaces. 539 // This is called on the IO thread. 540 virtual void DidCreatePpapiPlugin(BrowserPpapiHost* browser_host) {} 541 542 // Gets the host for an external out-of-process plugin. 543 virtual BrowserPpapiHost* GetExternalBrowserPpapiHost( 544 int plugin_child_id); 545 546 // Returns true if the socket operation specified by |params| is allowed from 547 // the given |browser_context| and |url|. If |params| is NULL, this method 548 // checks the basic "socket" permission, which is for those operations that 549 // don't require a specific socket permission rule. 550 // |private_api| indicates whether this permission check is for the private 551 // Pepper socket API or the public one. 552 virtual bool AllowPepperSocketAPI(BrowserContext* browser_context, 553 const GURL& url, 554 bool private_api, 555 const SocketPermissionRequest* params); 556 557 // Returns an implementation of a file selecition policy. Can return NULL. 558 virtual ui::SelectFilePolicy* CreateSelectFilePolicy( 559 WebContents* web_contents); 560 561 // Returns additional allowed scheme set which can access files in 562 // FileSystem API. 563 virtual void GetAdditionalAllowedSchemesForFileSystem( 564 std::vector<std::string>* additional_schemes) {} 565 566 // Returns auto mount handlers for URL requests for FileSystem APIs. 567 virtual void GetURLRequestAutoMountHandlers( 568 std::vector<storage::URLRequestAutoMountHandler>* handlers) {} 569 570 // Returns additional file system backends for FileSystem API. 571 // |browser_context| is needed in the additional FileSystemBackends. 572 // It has mount points to create objects returned by additional 573 // FileSystemBackends, and SpecialStoragePolicy for permission granting. 574 virtual void GetAdditionalFileSystemBackends( 575 BrowserContext* browser_context, 576 const base::FilePath& storage_partition_path, 577 ScopedVector<storage::FileSystemBackend>* additional_backends) {} 578 579 // Allows an embedder to return its own LocationProvider implementation. 580 // Return NULL to use the default one for the platform to be created. 581 // FYI: Used by an external project; please don't remove. 582 // Contact Viatcheslav Ostapenko at sl.ostapenko@samsung.com for more 583 // information. 584 virtual LocationProvider* OverrideSystemLocationProvider(); 585 586 // Allows an embedder to return its own VibrationProvider implementation. 587 // Return NULL to use the default one for the platform to be created. 588 // FYI: Used by an external project; please don't remove. 589 // Contact Viatcheslav Ostapenko at sl.ostapenko@samsung.com for more 590 // information. 591 virtual VibrationProvider* OverrideVibrationProvider(); 592 593 // Creates a new DevToolsManagerDelegate. The caller owns the returned value. 594 // It's valid to return NULL. 595 virtual DevToolsManagerDelegate* GetDevToolsManagerDelegate(); 596 597 // Returns true if plugin referred to by the url can use 598 // pp::FileIO::RequestOSFileHandle. 599 virtual bool IsPluginAllowedToCallRequestOSFileHandle( 600 BrowserContext* browser_context, 601 const GURL& url); 602 603 // Returns true if dev channel APIs are available for plugins. 604 virtual bool IsPluginAllowedToUseDevChannelAPIs( 605 BrowserContext* browser_context, 606 const GURL& url); 607 608 // Returns a special cookie store to use for a given render process, or NULL 609 // if the default cookie store should be used 610 // This is called on the IO thread. 611 virtual net::CookieStore* OverrideCookieStoreForRenderProcess( 612 int render_process_id); 613 614#if defined(OS_POSIX) && !defined(OS_MACOSX) 615 // Populates |mappings| with all files that need to be mapped before launching 616 // a child process. 617 virtual void GetAdditionalMappedFilesForChildProcess( 618 const base::CommandLine& command_line, 619 int child_process_id, 620 std::vector<FileDescriptorInfo>* mappings) {} 621#endif 622 623#if defined(OS_WIN) 624 // Returns the name of the dll that contains cursors and other resources. 625 virtual const wchar_t* GetResourceDllName(); 626 627 // This is called on the PROCESS_LAUNCHER thread before the renderer process 628 // is launched. It gives the embedder a chance to add loosen the sandbox 629 // policy. 630 virtual void PreSpawnRenderer(sandbox::TargetPolicy* policy, 631 bool* success) {} 632#endif 633 634#if defined(VIDEO_HOLE) 635 // Allows an embedder to provide its own ExternalVideoSurfaceContainer 636 // implementation. Return NULL to disable external surface video. 637 virtual ExternalVideoSurfaceContainer* 638 OverrideCreateExternalVideoSurfaceContainer(WebContents* web_contents); 639#endif 640}; 641 642} // namespace content 643 644#endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 645