OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
6 #define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
| 11 #include <memory> |
11 #include <string> | 12 #include <string> |
12 #include <utility> | 13 #include <utility> |
13 #include <vector> | 14 #include <vector> |
14 | 15 |
15 #include "base/callback_forward.h" | 16 #include "base/callback_forward.h" |
16 #include "base/memory/scoped_ptr.h" | |
17 #include "base/memory/scoped_vector.h" | 17 #include "base/memory/scoped_vector.h" |
18 #include "base/values.h" | 18 #include "base/values.h" |
19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
20 #include "content/public/browser/certificate_request_result_type.h" | 20 #include "content/public/browser/certificate_request_result_type.h" |
21 #include "content/public/browser/navigation_throttle.h" | 21 #include "content/public/browser/navigation_throttle.h" |
22 #include "content/public/common/content_client.h" | 22 #include "content/public/common/content_client.h" |
23 #include "content/public/common/media_stream_request.h" | 23 #include "content/public/common/media_stream_request.h" |
24 #include "content/public/common/resource_type.h" | 24 #include "content/public/common/resource_type.h" |
25 #include "content/public/common/socket_permission_request.h" | 25 #include "content/public/common/socket_permission_request.h" |
26 #include "content/public/common/window_container_type.h" | 26 #include "content/public/common/window_container_type.h" |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 bool can_be_default, | 445 bool can_be_default, |
446 std::string* partition_domain, | 446 std::string* partition_domain, |
447 std::string* partition_name, | 447 std::string* partition_name, |
448 bool* in_memory); | 448 bool* in_memory); |
449 | 449 |
450 // Create and return a new quota permission context. | 450 // Create and return a new quota permission context. |
451 virtual QuotaPermissionContext* CreateQuotaPermissionContext(); | 451 virtual QuotaPermissionContext* CreateQuotaPermissionContext(); |
452 | 452 |
453 // Gives the embedder a chance to register a custom QuotaEvictionPolicy for | 453 // Gives the embedder a chance to register a custom QuotaEvictionPolicy for |
454 // temporary storage. | 454 // temporary storage. |
455 virtual scoped_ptr<storage::QuotaEvictionPolicy> | 455 virtual std::unique_ptr<storage::QuotaEvictionPolicy> |
456 GetTemporaryStorageEvictionPolicy(BrowserContext* context); | 456 GetTemporaryStorageEvictionPolicy(BrowserContext* context); |
457 | 457 |
458 // Informs the embedder that a certificate error has occured. If | 458 // Informs the embedder that a certificate error has occured. If |
459 // |overridable| is true and if |strict_enforcement| is false, the user | 459 // |overridable| is true and if |strict_enforcement| is false, the user |
460 // can ignore the error and continue. The embedder can call the callback | 460 // can ignore the error and continue. The embedder can call the callback |
461 // asynchronously. If |result| is not set to | 461 // asynchronously. If |result| is not set to |
462 // CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE, the request will be cancelled | 462 // CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE, the request will be cancelled |
463 // or denied immediately, and the callback won't be run. | 463 // or denied immediately, and the callback won't be run. |
464 virtual void AllowCertificateError(WebContents* web_contents, | 464 virtual void AllowCertificateError(WebContents* web_contents, |
465 int cert_error, | 465 int cert_error, |
466 const net::SSLInfo& ssl_info, | 466 const net::SSLInfo& ssl_info, |
467 const GURL& request_url, | 467 const GURL& request_url, |
468 ResourceType resource_type, | 468 ResourceType resource_type, |
469 bool overridable, | 469 bool overridable, |
470 bool strict_enforcement, | 470 bool strict_enforcement, |
471 bool expired_previous_decision, | 471 bool expired_previous_decision, |
472 const base::Callback<void(bool)>& callback, | 472 const base::Callback<void(bool)>& callback, |
473 CertificateRequestResultType* result) {} | 473 CertificateRequestResultType* result) {} |
474 | 474 |
475 // Selects a SSL client certificate and returns it to the |delegate|. Note: | 475 // Selects a SSL client certificate and returns it to the |delegate|. Note: |
476 // |delegate| may be called synchronously or asynchronously. | 476 // |delegate| may be called synchronously or asynchronously. |
477 // | 477 // |
478 // TODO(davidben): Move this hook to WebContentsDelegate. | 478 // TODO(davidben): Move this hook to WebContentsDelegate. |
479 virtual void SelectClientCertificate( | 479 virtual void SelectClientCertificate( |
480 WebContents* web_contents, | 480 WebContents* web_contents, |
481 net::SSLCertRequestInfo* cert_request_info, | 481 net::SSLCertRequestInfo* cert_request_info, |
482 scoped_ptr<ClientCertificateDelegate> delegate); | 482 std::unique_ptr<ClientCertificateDelegate> delegate); |
483 | 483 |
484 // Adds a new installable certificate or private key. | 484 // Adds a new installable certificate or private key. |
485 // Typically used to install an X.509 user certificate. | 485 // Typically used to install an X.509 user certificate. |
486 // Note that it's up to the embedder to verify that the data is | 486 // Note that it's up to the embedder to verify that the data is |
487 // well-formed. |cert_data| will be nullptr if |cert_size| is 0. | 487 // well-formed. |cert_data| will be nullptr if |cert_size| is 0. |
488 virtual void AddCertificate(net::CertificateMimeType cert_type, | 488 virtual void AddCertificate(net::CertificateMimeType cert_type, |
489 const void* cert_data, | 489 const void* cert_data, |
490 size_t cert_size, | 490 size_t cert_size, |
491 int render_process_id, | 491 int render_process_id, |
492 int render_frame_id) {} | 492 int render_frame_id) {} |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 ServiceRegistry* registry, | 643 ServiceRegistry* registry, |
644 RenderFrameHost* render_frame_host) {} | 644 RenderFrameHost* render_frame_host) {} |
645 | 645 |
646 // Allows to register browser Mojo services exposed through the | 646 // Allows to register browser Mojo services exposed through the |
647 // RenderFrameHost. | 647 // RenderFrameHost. |
648 virtual void RegisterRenderFrameMojoServices( | 648 virtual void RegisterRenderFrameMojoServices( |
649 ServiceRegistry* registry, | 649 ServiceRegistry* registry, |
650 RenderFrameHost* render_frame_host) {} | 650 RenderFrameHost* render_frame_host) {} |
651 | 651 |
652 using StaticMojoApplicationMap = | 652 using StaticMojoApplicationMap = |
653 std::map<std::string, base::Callback<scoped_ptr<mojo::ShellClient>()>>; | 653 std::map<std::string, |
| 654 base::Callback<std::unique_ptr<mojo::ShellClient>()>>; |
654 | 655 |
655 // Registers Mojo applications to be loaded in the browser process by the | 656 // Registers Mojo applications to be loaded in the browser process by the |
656 // browser's global Mojo shell. | 657 // browser's global Mojo shell. |
657 virtual void RegisterInProcessMojoApplications( | 658 virtual void RegisterInProcessMojoApplications( |
658 StaticMojoApplicationMap* apps) {} | 659 StaticMojoApplicationMap* apps) {} |
659 | 660 |
660 using OutOfProcessMojoApplicationMap = std::map<std::string, base::string16>; | 661 using OutOfProcessMojoApplicationMap = std::map<std::string, base::string16>; |
661 | 662 |
662 // Registers Mojo applications to be loaded out of the browser process, in a | 663 // Registers Mojo applications to be loaded out of the browser process, in a |
663 // sandboxed utility process. The value of each map entry should be the | 664 // sandboxed utility process. The value of each map entry should be the |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 // Allows the embedder to register one or more NavigationThrottles for the | 700 // Allows the embedder to register one or more NavigationThrottles for the |
700 // navigation indicated by |navigation_handle|. A NavigationThrottle is used | 701 // navigation indicated by |navigation_handle|. A NavigationThrottle is used |
701 // to control the flow of a navigation on the UI thread. The embedder is | 702 // to control the flow of a navigation on the UI thread. The embedder is |
702 // guaranteed that the throttles will be executed in the order they were | 703 // guaranteed that the throttles will be executed in the order they were |
703 // provided. | 704 // provided. |
704 virtual ScopedVector<NavigationThrottle> CreateThrottlesForNavigation( | 705 virtual ScopedVector<NavigationThrottle> CreateThrottlesForNavigation( |
705 NavigationHandle* navigation_handle); | 706 NavigationHandle* navigation_handle); |
706 | 707 |
707 // Creates and returns a factory used for creating CDM instances for playing | 708 // Creates and returns a factory used for creating CDM instances for playing |
708 // protected content. | 709 // protected content. |
709 virtual scoped_ptr<media::CdmFactory> CreateCdmFactory(); | 710 virtual std::unique_ptr<media::CdmFactory> CreateCdmFactory(); |
710 | 711 |
711 // Populates |mappings| with all files that need to be mapped before launching | 712 // Populates |mappings| with all files that need to be mapped before launching |
712 // a child process. | 713 // a child process. |
713 #if defined(OS_ANDROID) | 714 #if defined(OS_ANDROID) |
714 virtual void GetAdditionalMappedFilesForChildProcess( | 715 virtual void GetAdditionalMappedFilesForChildProcess( |
715 const base::CommandLine& command_line, | 716 const base::CommandLine& command_line, |
716 int child_process_id, | 717 int child_process_id, |
717 content::FileDescriptorInfo* mappings, | 718 content::FileDescriptorInfo* mappings, |
718 std::map<int, base::MemoryMappedFile::Region>* regions) {} | 719 std::map<int, base::MemoryMappedFile::Region>* regions) {} |
719 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 720 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 // Allows an embedder to provide its own ExternalVideoSurfaceContainer | 753 // Allows an embedder to provide its own ExternalVideoSurfaceContainer |
753 // implementation. Return nullptr to disable external surface video. | 754 // implementation. Return nullptr to disable external surface video. |
754 virtual ExternalVideoSurfaceContainer* | 755 virtual ExternalVideoSurfaceContainer* |
755 OverrideCreateExternalVideoSurfaceContainer(WebContents* web_contents); | 756 OverrideCreateExternalVideoSurfaceContainer(WebContents* web_contents); |
756 #endif | 757 #endif |
757 }; | 758 }; |
758 | 759 |
759 } // namespace content | 760 } // namespace content |
760 | 761 |
761 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ | 762 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
OLD | NEW |