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_MAIN_AW_MAIN_DELEGATE_H_ | 5 #ifndef ANDROID_WEBVIEW_LIB_MAIN_AW_MAIN_DELEGATE_H_ |
6 #define ANDROID_WEBVIEW_LIB_MAIN_AW_MAIN_DELEGATE_H_ | 6 #define ANDROID_WEBVIEW_LIB_MAIN_AW_MAIN_DELEGATE_H_ |
7 | 7 |
| 8 #include "android_webview/browser/jni_dependency_factory.h" |
8 #include "android_webview/common/aw_content_client.h" | 9 #include "android_webview/common/aw_content_client.h" |
9 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
10 #include "content/public/app/content_main_delegate.h" | 11 #include "content/public/app/content_main_delegate.h" |
11 | 12 |
12 namespace content { | 13 namespace content { |
13 class BrowserMainRunner; | 14 class BrowserMainRunner; |
14 } | 15 } |
15 | 16 |
16 namespace android_webview { | 17 namespace android_webview { |
17 | 18 |
18 class AwContentBrowserClient; | 19 class AwContentBrowserClient; |
19 class AwContentRendererClient; | 20 class AwContentRendererClient; |
20 | 21 |
21 // Android WebView implementation of ContentMainDelegate. | 22 // Android WebView implementation of ContentMainDelegate. |
22 class AwMainDelegate : public content::ContentMainDelegate { | 23 class AwMainDelegate : public content::ContentMainDelegate, |
| 24 public JniDependencyFactory { |
23 public: | 25 public: |
24 AwMainDelegate(); | 26 AwMainDelegate(); |
25 virtual ~AwMainDelegate(); | 27 virtual ~AwMainDelegate(); |
26 | 28 |
27 private: | 29 private: |
28 // content::ContentMainDelegate implementation: | 30 // content::ContentMainDelegate implementation: |
29 virtual bool BasicStartupComplete(int* exit_code) OVERRIDE; | 31 virtual bool BasicStartupComplete(int* exit_code) OVERRIDE; |
30 virtual void PreSandboxStartup() OVERRIDE; | 32 virtual void PreSandboxStartup() OVERRIDE; |
31 virtual void SandboxInitialized(const std::string& process_type) OVERRIDE; | 33 virtual void SandboxInitialized(const std::string& process_type) OVERRIDE; |
32 virtual int RunProcess( | 34 virtual int RunProcess( |
33 const std::string& process_type, | 35 const std::string& process_type, |
34 const content::MainFunctionParams& main_function_params) OVERRIDE; | 36 const content::MainFunctionParams& main_function_params) OVERRIDE; |
35 virtual void ProcessExiting(const std::string& process_type) OVERRIDE; | 37 virtual void ProcessExiting(const std::string& process_type) OVERRIDE; |
36 virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE; | 38 virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE; |
37 virtual content::ContentRendererClient* | 39 virtual content::ContentRendererClient* |
38 CreateContentRendererClient() OVERRIDE; | 40 CreateContentRendererClient() OVERRIDE; |
39 | 41 |
| 42 // JniDependencyFactory implementation. |
| 43 virtual AwQuotaManagerBridge* CreateAwQuotaManagerBridge( |
| 44 AwBrowserContext* browser_context) OVERRIDE; |
| 45 virtual content::GeolocationPermissionContext* CreateGeolocationPermission( |
| 46 AwBrowserContext* browser_context) OVERRIDE; |
| 47 virtual content::WebContentsViewDelegate* CreateViewDelegate( |
| 48 content::WebContents* web_contents) OVERRIDE; |
| 49 |
40 scoped_ptr<content::BrowserMainRunner> browser_runner_; | 50 scoped_ptr<content::BrowserMainRunner> browser_runner_; |
41 AwContentClient content_client_; | 51 AwContentClient content_client_; |
42 scoped_ptr<AwContentBrowserClient> content_browser_client_; | 52 scoped_ptr<AwContentBrowserClient> content_browser_client_; |
43 scoped_ptr<AwContentRendererClient> content_renderer_client_; | 53 scoped_ptr<AwContentRendererClient> content_renderer_client_; |
44 | 54 |
45 DISALLOW_COPY_AND_ASSIGN(AwMainDelegate); | 55 DISALLOW_COPY_AND_ASSIGN(AwMainDelegate); |
46 }; | 56 }; |
47 | 57 |
48 } // namespace android_webview | 58 } // namespace android_webview |
49 | 59 |
50 #endif // ANDROID_WEBVIEW_LIB_MAIN_AW_MAIN_DELEGATE_H_ | 60 #endif // ANDROID_WEBVIEW_LIB_MAIN_AW_MAIN_DELEGATE_H_ |
OLD | NEW |