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 ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ | 5 #ifndef ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ |
6 #define ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ | 6 #define ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ |
7 | 7 |
| 8 #include "android_webview/browser/aw_browser_context.h" |
| 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" |
8 #include "content/public/browser/content_browser_client.h" | 12 #include "content/public/browser/content_browser_client.h" |
9 | 13 #include "net/url_request/url_request_job_factory.h" |
10 #include "android_webview/browser/aw_browser_context.h" | |
11 #include "base/compiler_specific.h" | |
12 | 14 |
13 namespace android_webview { | 15 namespace android_webview { |
14 | 16 |
15 class AwContentBrowserClient : public content::ContentBrowserClient { | 17 class AwContentBrowserClient : public content::ContentBrowserClient { |
16 public: | 18 public: |
17 typedef content::WebContentsViewDelegate* ViewDelegateFactoryFn( | 19 typedef content::WebContentsViewDelegate* ViewDelegateFactoryFn( |
18 content::WebContents* web_contents); | 20 content::WebContents* web_contents); |
19 | 21 |
20 AwContentBrowserClient( | 22 AwContentBrowserClient( |
21 ViewDelegateFactoryFn* view_delegate_factory, | 23 ViewDelegateFactoryFn* view_delegate_factory, |
22 GeolocationPermissionFactoryFn* geolocation_permission_factory); | 24 GeolocationPermissionFactoryFn* geolocation_permission_factory); |
23 virtual ~AwContentBrowserClient(); | 25 virtual ~AwContentBrowserClient(); |
24 | 26 |
25 AwBrowserContext* GetAwBrowserContext(); | 27 AwBrowserContext* GetAwBrowserContext(); |
26 | 28 |
27 // Overriden methods from ContentBrowserClient. | 29 // Overriden methods from ContentBrowserClient. |
28 virtual content::BrowserMainParts* CreateBrowserMainParts( | 30 virtual content::BrowserMainParts* CreateBrowserMainParts( |
29 const content::MainFunctionParams& parameters) OVERRIDE; | 31 const content::MainFunctionParams& parameters) OVERRIDE; |
30 virtual content::WebContentsViewDelegate* GetWebContentsViewDelegate( | 32 virtual content::WebContentsViewDelegate* GetWebContentsViewDelegate( |
31 content::WebContents* web_contents) OVERRIDE; | 33 content::WebContents* web_contents) OVERRIDE; |
32 virtual void RenderProcessHostCreated( | 34 virtual void RenderProcessHostCreated( |
33 content::RenderProcessHost* host) OVERRIDE; | 35 content::RenderProcessHost* host) OVERRIDE; |
| 36 virtual net::URLRequestContextGetter* CreateRequestContext( |
| 37 content::BrowserContext* browser_context, |
| 38 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 39 blob_protocol_handler, |
| 40 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 41 file_system_protocol_handler, |
| 42 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 43 developer_protocol_handler, |
| 44 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 45 chrome_protocol_handler, |
| 46 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 47 chrome_devtools_protocol_handler) OVERRIDE; |
| 48 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( |
| 49 content::BrowserContext* browser_context, |
| 50 const FilePath& partition_path, |
| 51 bool in_memory, |
| 52 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 53 blob_protocol_handler, |
| 54 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 55 file_system_protocol_handler, |
| 56 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 57 developer_protocol_handler, |
| 58 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 59 chrome_protocol_handler, |
| 60 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 61 chrome_devtools_protocol_handler) OVERRIDE; |
34 virtual std::string GetCanonicalEncodingNameByAliasName( | 62 virtual std::string GetCanonicalEncodingNameByAliasName( |
35 const std::string& alias_name) OVERRIDE; | 63 const std::string& alias_name) OVERRIDE; |
36 virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, | 64 virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, |
37 int child_process_id) OVERRIDE; | 65 int child_process_id) OVERRIDE; |
38 virtual std::string GetApplicationLocale() OVERRIDE; | 66 virtual std::string GetApplicationLocale() OVERRIDE; |
39 virtual std::string GetAcceptLangs(content::BrowserContext* context) OVERRIDE; | 67 virtual std::string GetAcceptLangs(content::BrowserContext* context) OVERRIDE; |
40 virtual gfx::ImageSkia* GetDefaultFavicon() OVERRIDE; | 68 virtual gfx::ImageSkia* GetDefaultFavicon() OVERRIDE; |
41 virtual bool AllowAppCache(const GURL& manifest_url, | 69 virtual bool AllowAppCache(const GURL& manifest_url, |
42 const GURL& first_party, | 70 const GURL& first_party, |
43 content::ResourceContext* context) OVERRIDE; | 71 content::ResourceContext* context) OVERRIDE; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 scoped_ptr<AwBrowserContext> browser_context_; | 159 scoped_ptr<AwBrowserContext> browser_context_; |
132 | 160 |
133 ViewDelegateFactoryFn* view_delegate_factory_; | 161 ViewDelegateFactoryFn* view_delegate_factory_; |
134 | 162 |
135 DISALLOW_COPY_AND_ASSIGN(AwContentBrowserClient); | 163 DISALLOW_COPY_AND_ASSIGN(AwContentBrowserClient); |
136 }; | 164 }; |
137 | 165 |
138 } // namespace android_webview | 166 } // namespace android_webview |
139 | 167 |
140 #endif // ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ | 168 #endif // ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ |
OLD | NEW |