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" | 8 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
12 #include "content/public/browser/content_browser_client.h" | 11 #include "content/public/browser/content_browser_client.h" |
13 #include "net/url_request/url_request_job_factory.h" | 12 #include "net/url_request/url_request_job_factory.h" |
14 | 13 |
15 namespace android_webview { | 14 namespace android_webview { |
16 | 15 |
| 16 class AwBrowserContext; |
| 17 class JniDependencyFactory; |
| 18 |
17 class AwContentBrowserClient : public content::ContentBrowserClient { | 19 class AwContentBrowserClient : public content::ContentBrowserClient { |
18 public: | 20 public: |
19 typedef content::WebContentsViewDelegate* ViewDelegateFactoryFn( | 21 static AwContentBrowserClient* FromContentBrowserClient( |
20 content::WebContents* web_contents); | 22 content::ContentBrowserClient* client); |
21 | 23 |
22 AwContentBrowserClient( | 24 AwContentBrowserClient(JniDependencyFactory* native_factory); |
23 ViewDelegateFactoryFn* view_delegate_factory, | |
24 GeolocationPermissionFactoryFn* geolocation_permission_factory); | |
25 virtual ~AwContentBrowserClient(); | 25 virtual ~AwContentBrowserClient(); |
26 | 26 |
27 AwBrowserContext* GetAwBrowserContext(); | 27 AwBrowserContext* GetAwBrowserContext(); |
28 | 28 |
29 // Overriden methods from ContentBrowserClient. | 29 // Overriden methods from ContentBrowserClient. |
30 virtual void AddCertificate(net::URLRequest* request, | 30 virtual void AddCertificate(net::URLRequest* request, |
31 net::CertificateMimeType cert_type, | 31 net::CertificateMimeType cert_type, |
32 const void* cert_data, | 32 const void* cert_data, |
33 size_t cert_size, | 33 size_t cert_size, |
34 int render_process_id, | 34 int render_process_id, |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 virtual bool AllowPepperSocketAPI( | 157 virtual bool AllowPepperSocketAPI( |
158 content::BrowserContext* browser_context, | 158 content::BrowserContext* browser_context, |
159 const GURL& url, | 159 const GURL& url, |
160 const content::SocketPermissionRequest& params) OVERRIDE; | 160 const content::SocketPermissionRequest& params) OVERRIDE; |
161 | 161 |
162 private: | 162 private: |
163 // Android WebView currently has a single global (non-off-the-record) browser | 163 // Android WebView currently has a single global (non-off-the-record) browser |
164 // context. | 164 // context. |
165 scoped_ptr<AwBrowserContext> browser_context_; | 165 scoped_ptr<AwBrowserContext> browser_context_; |
166 | 166 |
167 ViewDelegateFactoryFn* view_delegate_factory_; | 167 JniDependencyFactory* native_factory_; |
168 | 168 |
169 DISALLOW_COPY_AND_ASSIGN(AwContentBrowserClient); | 169 DISALLOW_COPY_AND_ASSIGN(AwContentBrowserClient); |
170 }; | 170 }; |
171 | 171 |
172 } // namespace android_webview | 172 } // namespace android_webview |
173 | 173 |
174 #endif // ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ | 174 #endif // ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ |
OLD | NEW |