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 "content/public/browser/content_browser_client.h" | 8 #include "content/public/browser/content_browser_client.h" |
9 | 9 |
10 #include "android_webview/browser/aw_browser_context.h" | 10 #include "android_webview/browser/aw_browser_context.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 | 12 |
13 namespace android_webview { | 13 namespace android_webview { |
14 | 14 |
15 class AwContentBrowserClient : public content::ContentBrowserClient { | 15 class AwContentBrowserClient : public content::ContentBrowserClient { |
16 public: | 16 public: |
17 AwContentBrowserClient(); | 17 typedef content::WebContentsViewDelegate* ViewDelegateFactory( |
joth
2012/12/11 02:37:39
suggest ViewDelegateFactoryFunction (or sometimes
boliu
2012/12/11 19:34:08
FactoryFn.
| |
18 content::WebContents* web_contents); | |
19 | |
20 AwContentBrowserClient(ViewDelegateFactory* view_delegate_factory); | |
18 virtual ~AwContentBrowserClient(); | 21 virtual ~AwContentBrowserClient(); |
19 | 22 |
20 AwBrowserContext* GetAwBrowserContext(); | 23 AwBrowserContext* GetAwBrowserContext(); |
21 | 24 |
22 // Overriden methods from ContentBrowserClient. | 25 // Overriden methods from ContentBrowserClient. |
23 virtual content::BrowserMainParts* CreateBrowserMainParts( | 26 virtual content::BrowserMainParts* CreateBrowserMainParts( |
24 const content::MainFunctionParams& parameters) OVERRIDE; | 27 const content::MainFunctionParams& parameters) OVERRIDE; |
28 virtual content::WebContentsViewDelegate* GetWebContentsViewDelegate( | |
29 content::WebContents* web_contents) OVERRIDE; | |
25 virtual void RenderProcessHostCreated( | 30 virtual void RenderProcessHostCreated( |
26 content::RenderProcessHost* host) OVERRIDE; | 31 content::RenderProcessHost* host) OVERRIDE; |
27 virtual std::string GetCanonicalEncodingNameByAliasName( | 32 virtual std::string GetCanonicalEncodingNameByAliasName( |
28 const std::string& alias_name) OVERRIDE; | 33 const std::string& alias_name) OVERRIDE; |
29 virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, | 34 virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, |
30 int child_process_id) OVERRIDE; | 35 int child_process_id) OVERRIDE; |
31 virtual std::string GetApplicationLocale() OVERRIDE; | 36 virtual std::string GetApplicationLocale() OVERRIDE; |
32 virtual std::string GetAcceptLangs(content::BrowserContext* context) OVERRIDE; | 37 virtual std::string GetAcceptLangs(content::BrowserContext* context) OVERRIDE; |
33 virtual gfx::ImageSkia* GetDefaultFavicon() OVERRIDE; | 38 virtual gfx::ImageSkia* GetDefaultFavicon() OVERRIDE; |
34 virtual bool AllowAppCache(const GURL& manifest_url, | 39 virtual bool AllowAppCache(const GURL& manifest_url, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 virtual void ClearCache(content::RenderViewHost* rvh) OVERRIDE; | 117 virtual void ClearCache(content::RenderViewHost* rvh) OVERRIDE; |
113 virtual void ClearCookies(content::RenderViewHost* rvh) OVERRIDE; | 118 virtual void ClearCookies(content::RenderViewHost* rvh) OVERRIDE; |
114 virtual FilePath GetDefaultDownloadDirectory() OVERRIDE; | 119 virtual FilePath GetDefaultDownloadDirectory() OVERRIDE; |
115 virtual std::string GetDefaultDownloadName() OVERRIDE; | 120 virtual std::string GetDefaultDownloadName() OVERRIDE; |
116 virtual void DidCreatePpapiPlugin( | 121 virtual void DidCreatePpapiPlugin( |
117 content::BrowserPpapiHost* browser_host) OVERRIDE; | 122 content::BrowserPpapiHost* browser_host) OVERRIDE; |
118 virtual bool AllowPepperSocketAPI( | 123 virtual bool AllowPepperSocketAPI( |
119 content::BrowserContext* browser_context, | 124 content::BrowserContext* browser_context, |
120 const GURL& url, | 125 const GURL& url, |
121 const content::SocketPermissionRequest& params) OVERRIDE; | 126 const content::SocketPermissionRequest& params) OVERRIDE; |
127 | |
122 private: | 128 private: |
123 // Android WebView currently has a single global (non-off-the-record) browser | 129 // Android WebView currently has a single global (non-off-the-record) browser |
124 // context. | 130 // context. |
125 scoped_ptr<AwBrowserContext> browser_context_; | 131 scoped_ptr<AwBrowserContext> browser_context_; |
126 | 132 |
133 ViewDelegateFactory* view_delegate_factory_; | |
134 | |
127 DISALLOW_COPY_AND_ASSIGN(AwContentBrowserClient); | 135 DISALLOW_COPY_AND_ASSIGN(AwContentBrowserClient); |
128 }; | 136 }; |
129 | 137 |
130 } // namespace android_webview | 138 } // namespace android_webview |
131 | 139 |
132 #endif // ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ | 140 #endif // ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ |
OLD | NEW |