| 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 <map> |
| 8 #include <string> | 9 #include <string> |
| 9 #include <utility> | 10 #include <utility> |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
| 14 #include "base/memory/linked_ptr.h" |
| 13 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 14 #include "content/public/browser/file_descriptor_info.h" | 16 #include "content/public/browser/file_descriptor_info.h" |
| 15 #include "content/public/common/socket_permission_request.h" | 17 #include "content/public/common/socket_permission_request.h" |
| 16 #include "content/public/common/content_client.h" | 18 #include "content/public/common/content_client.h" |
| 17 #include "content/public/common/window_container_type.h" | 19 #include "content/public/common/window_container_type.h" |
| 18 #include "net/base/mime_util.h" | 20 #include "net/base/mime_util.h" |
| 19 #include "net/cookies/canonical_cookie.h" | 21 #include "net/cookies/canonical_cookie.h" |
| 20 #include "net/url_request/url_request_job_factory.h" | 22 #include "net/url_request/url_request_job_factory.h" |
| 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresen
ter.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresen
ter.h" |
| 22 #include "webkit/glue/resource_type.h" | 24 #include "webkit/glue/resource_type.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 class RenderViewHostDelegateView; | 77 class RenderViewHostDelegateView; |
| 76 class ResourceContext; | 78 class ResourceContext; |
| 77 class SiteInstance; | 79 class SiteInstance; |
| 78 class SpeechRecognitionManagerDelegate; | 80 class SpeechRecognitionManagerDelegate; |
| 79 class WebContents; | 81 class WebContents; |
| 80 class WebContentsViewDelegate; | 82 class WebContentsViewDelegate; |
| 81 class WebContentsViewPort; | 83 class WebContentsViewPort; |
| 82 struct MainFunctionParams; | 84 struct MainFunctionParams; |
| 83 struct ShowDesktopNotificationHostMsgParams; | 85 struct ShowDesktopNotificationHostMsgParams; |
| 84 | 86 |
| 87 // A mapping from the scheme name to the protocol handler that services its |
| 88 // content. |
| 89 typedef std::map< |
| 90 std::string, linked_ptr<net::URLRequestJobFactory::ProtocolHandler> > |
| 91 ProtocolHandlerMap; |
| 92 |
| 85 // Embedder API (or SPI) for participating in browser logic, to be implemented | 93 // Embedder API (or SPI) for participating in browser logic, to be implemented |
| 86 // by the client of the content browser. See ChromeContentBrowserClient for the | 94 // by the client of the content browser. See ChromeContentBrowserClient for the |
| 87 // principal implementation. The methods are assumed to be called on the UI | 95 // principal implementation. The methods are assumed to be called on the UI |
| 88 // thread unless otherwise specified. Use this "escape hatch" sparingly, to | 96 // thread unless otherwise specified. Use this "escape hatch" sparingly, to |
| 89 // avoid the embedder interface ballooning and becoming very specific to Chrome. | 97 // avoid the embedder interface ballooning and becoming very specific to Chrome. |
| 90 // (Often, the call out to the client can happen in a different part of the code | 98 // (Often, the call out to the client can happen in a different part of the code |
| 91 // that either already has a hook out to the embedder, or calls out to one of | 99 // that either already has a hook out to the embedder, or calls out to one of |
| 92 // the observer interfaces.) | 100 // the observer interfaces.) |
| 93 class CONTENT_EXPORT ContentBrowserClient { | 101 class CONTENT_EXPORT ContentBrowserClient { |
| 94 public: | 102 public: |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // Get the effective URL for the given actual URL, to allow an embedder to | 140 // Get the effective URL for the given actual URL, to allow an embedder to |
| 133 // group different url schemes in the same SiteInstance. | 141 // group different url schemes in the same SiteInstance. |
| 134 virtual GURL GetEffectiveURL(BrowserContext* browser_context, | 142 virtual GURL GetEffectiveURL(BrowserContext* browser_context, |
| 135 const GURL& url); | 143 const GURL& url); |
| 136 | 144 |
| 137 // Returns whether all instances of the specified effective URL should be | 145 // Returns whether all instances of the specified effective URL should be |
| 138 // rendered by the same process, rather than using process-per-site-instance. | 146 // rendered by the same process, rather than using process-per-site-instance. |
| 139 virtual bool ShouldUseProcessPerSite(BrowserContext* browser_context, | 147 virtual bool ShouldUseProcessPerSite(BrowserContext* browser_context, |
| 140 const GURL& effective_url); | 148 const GURL& effective_url); |
| 141 | 149 |
| 150 // Returns a list additional WebUI schemes, if any. These additional schemes |
| 151 // act as aliases to the chrome: scheme. The additional schemes may or may |
| 152 // not serve specific WebUI pages depending on the particular URLDataSource |
| 153 // and its override of URLDataSource::ShouldServiceRequest. |
| 154 virtual std::vector<std::string> GetAdditionalWebUISchemes(); |
| 155 |
| 142 // Creates the main net::URLRequestContextGetter. Should only be called once | 156 // Creates the main net::URLRequestContextGetter. Should only be called once |
| 143 // per ContentBrowserClient object. | 157 // per ContentBrowserClient object. |
| 144 // TODO(ajwong): Remove once http://crbug.com/159193 is resolved. | 158 // TODO(ajwong): Remove once http://crbug.com/159193 is resolved. |
| 145 virtual net::URLRequestContextGetter* CreateRequestContext( | 159 virtual net::URLRequestContextGetter* CreateRequestContext( |
| 146 BrowserContext* browser_context, | 160 BrowserContext* browser_context, |
| 147 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 161 ProtocolHandlerMap* protocol_handlers); |
| 148 blob_protocol_handler, | |
| 149 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 150 file_system_protocol_handler, | |
| 151 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 152 developer_protocol_handler, | |
| 153 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 154 chrome_protocol_handler, | |
| 155 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 156 chrome_devtools_protocol_handler); | |
| 157 | 162 |
| 158 // Creates the net::URLRequestContextGetter for a StoragePartition. Should | 163 // Creates the net::URLRequestContextGetter for a StoragePartition. Should |
| 159 // only be called once per partition_path per ContentBrowserClient object. | 164 // only be called once per partition_path per ContentBrowserClient object. |
| 160 // TODO(ajwong): Remove once http://crbug.com/159193 is resolved. | 165 // TODO(ajwong): Remove once http://crbug.com/159193 is resolved. |
| 161 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( | 166 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( |
| 162 BrowserContext* browser_context, | 167 BrowserContext* browser_context, |
| 163 const base::FilePath& partition_path, | 168 const base::FilePath& partition_path, |
| 164 bool in_memory, | 169 bool in_memory, |
| 165 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 170 ProtocolHandlerMap* protocol_handlers); |
| 166 blob_protocol_handler, | |
| 167 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 168 file_system_protocol_handler, | |
| 169 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 170 developer_protocol_handler, | |
| 171 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 172 chrome_protocol_handler, | |
| 173 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 174 chrome_devtools_protocol_handler); | |
| 175 | 171 |
| 176 // Returns whether a specified URL is handled by the embedder's internal | 172 // Returns whether a specified URL is handled by the embedder's internal |
| 177 // protocol handlers. | 173 // protocol handlers. |
| 178 virtual bool IsHandledURL(const GURL& url); | 174 virtual bool IsHandledURL(const GURL& url); |
| 179 | 175 |
| 180 // Returns whether a new view for a given |site_url| can be launched in a | 176 // Returns whether a new view for a given |site_url| can be launched in a |
| 181 // given |process_host|. | 177 // given |process_host|. |
| 182 virtual bool IsSuitableHost(RenderProcessHost* process_host, | 178 virtual bool IsSuitableHost(RenderProcessHost* process_host, |
| 183 const GURL& site_url); | 179 const GURL& site_url); |
| 184 | 180 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 // This is called on a worker thread. | 507 // This is called on a worker thread. |
| 512 virtual | 508 virtual |
| 513 crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate( | 509 crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate( |
| 514 const GURL& url); | 510 const GURL& url); |
| 515 #endif | 511 #endif |
| 516 }; | 512 }; |
| 517 | 513 |
| 518 } // namespace content | 514 } // namespace content |
| 519 | 515 |
| 520 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ | 516 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
| OLD | NEW |