Chromium Code Reviews| Index: content/public/browser/content_browser_client.h |
| diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h |
| index af10346b14b42ac5bdff3fd5032e4bbf772b6171..3c1efd7f664cd3333914d5236aabaa9865bce561 100644 |
| --- a/content/public/browser/content_browser_client.h |
| +++ b/content/public/browser/content_browser_client.h |
| @@ -5,11 +5,13 @@ |
| #ifndef CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
| #define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
| +#include <map> |
| #include <string> |
| #include <utility> |
| #include <vector> |
| #include "base/callback_forward.h" |
| +#include "base/memory/linked_ptr.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "content/public/browser/file_descriptor_info.h" |
| #include "content/public/common/socket_permission_request.h" |
| @@ -53,6 +55,7 @@ class SSLInfo; |
| class URLRequest; |
| class URLRequestContext; |
| class URLRequestContextGetter; |
| +class URLRequestJobFactoryImpl; |
| class X509Certificate; |
| } |
| @@ -82,6 +85,12 @@ class WebContentsViewPort; |
| struct MainFunctionParams; |
| struct ShowDesktopNotificationHostMsgParams; |
| +// A mapping from the scheme name to the protocol handler that services its |
| +// content. |
| +typedef std::map< |
| + std::string, linked_ptr<net::URLRequestJobFactory::ProtocolHandler> > |
| + ProtocolHandlerMap; |
| + |
| // Embedder API (or SPI) for participating in browser logic, to be implemented |
| // by the client of the content browser. See ChromeContentBrowserClient for the |
| // principal implementation. The methods are assumed to be called on the UI |
| @@ -139,21 +148,27 @@ class CONTENT_EXPORT ContentBrowserClient { |
| virtual bool ShouldUseProcessPerSite(BrowserContext* browser_context, |
| const GURL& effective_url); |
| + // Returns a list additional WebUI schemes, if any. These additional schemes |
| + // act as aliases to the chrome: scheme. The additional schemes may or may |
| + // not serve specific WebUI pages depending on the particular URLDataSource |
| + // and its override of URLDataSource::ShouldServiceRequest. |
| + virtual std::vector<std::string> GetAdditionalWebUISchemes(); |
| + |
| + // Utility to install additional WebUI handlers into the |job_factory|. |
| + // Ownership of the handlers is transfered from |protocol_handlers| |
| + // to the |job_factory|. |
| + static void InstallProtocolHandlers( |
|
jam
2013/02/28 02:21:21
nit: we don't really put static methods in this in
dhollowa
2013/02/28 18:21:12
Done. I moved this closer to the call sites. One
|
| + net::URLRequestJobFactoryImpl* job_factory, |
| + content::ProtocolHandlerMap* protocol_handlers); |
| + |
| // Creates the main net::URLRequestContextGetter. Should only be called once |
| // per ContentBrowserClient object. |
| // TODO(ajwong): Remove once http://crbug.com/159193 is resolved. |
| virtual net::URLRequestContextGetter* CreateRequestContext( |
| BrowserContext* browser_context, |
| scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| - blob_protocol_handler, |
| - scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| - file_system_protocol_handler, |
| - scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| developer_protocol_handler, |
| - scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| - chrome_protocol_handler, |
| - scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| - chrome_devtools_protocol_handler); |
| + ProtocolHandlerMap* protocol_handlers); |
| // Creates the net::URLRequestContextGetter for a StoragePartition. Should |
| // only be called once per partition_path per ContentBrowserClient object. |
| @@ -163,15 +178,8 @@ class CONTENT_EXPORT ContentBrowserClient { |
| const base::FilePath& partition_path, |
| bool in_memory, |
| scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| - blob_protocol_handler, |
| - scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| - file_system_protocol_handler, |
| - scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| developer_protocol_handler, |
| - scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| - chrome_protocol_handler, |
| - scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| - chrome_devtools_protocol_handler); |
| + ProtocolHandlerMap* protocol_handlers); |
| // Returns whether a specified URL is handled by the embedder's internal |
| // protocol handlers. |