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