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 #include "android_webview/browser/aw_content_browser_client.h" | 5 #include "android_webview/browser/aw_content_browser_client.h" |
6 | 6 |
7 #include "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
8 #include "android_webview/browser/aw_browser_main_parts.h" | 8 #include "android_webview/browser/aw_browser_main_parts.h" |
| 9 #include "android_webview/browser/aw_contents_client_bridge_base.h" |
9 #include "android_webview/browser/aw_cookie_access_policy.h" | 10 #include "android_webview/browser/aw_cookie_access_policy.h" |
10 #include "android_webview/browser/aw_quota_permission_context.h" | 11 #include "android_webview/browser/aw_quota_permission_context.h" |
11 #include "android_webview/browser/jni_dependency_factory.h" | 12 #include "android_webview/browser/jni_dependency_factory.h" |
12 #include "android_webview/browser/net_disk_cache_remover.h" | 13 #include "android_webview/browser/net_disk_cache_remover.h" |
13 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" | 14 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" |
14 #include "android_webview/common/url_constants.h" | 15 #include "android_webview/common/url_constants.h" |
15 #include "base/android/locale_utils.h" | 16 #include "base/android/locale_utils.h" |
16 #include "base/base_paths_android.h" | 17 #include "base/base_paths_android.h" |
17 #include "base/path_service.h" | 18 #include "base/path_service.h" |
18 #include "content/public/browser/access_token_store.h" | 19 #include "content/public/browser/access_token_store.h" |
19 #include "content/public/browser/child_process_security_policy.h" | 20 #include "content/public/browser/child_process_security_policy.h" |
20 #include "content/public/browser/render_process_host.h" | 21 #include "content/public/browser/render_process_host.h" |
21 #include "content/public/browser/render_view_host.h" | 22 #include "content/public/browser/render_view_host.h" |
22 #include "content/public/common/url_constants.h" | 23 #include "content/public/common/url_constants.h" |
23 #include "grit/ui_resources.h" | 24 #include "grit/ui_resources.h" |
24 #include "net/android/network_library.h" | 25 #include "net/android/network_library.h" |
| 26 #include "net/base/ssl_info.h" |
25 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
26 | 28 |
27 namespace { | 29 namespace { |
28 | 30 |
29 class AwAccessTokenStore : public content::AccessTokenStore { | 31 class AwAccessTokenStore : public content::AccessTokenStore { |
30 public: | 32 public: |
31 AwAccessTokenStore() { } | 33 AwAccessTokenStore() { } |
32 | 34 |
33 // content::AccessTokenStore implementation | 35 // content::AccessTokenStore implementation |
34 virtual void LoadAccessTokens( | 36 virtual void LoadAccessTokens( |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 void AwContentBrowserClient::AllowCertificateError( | 267 void AwContentBrowserClient::AllowCertificateError( |
266 int render_process_id, | 268 int render_process_id, |
267 int render_view_id, | 269 int render_view_id, |
268 int cert_error, | 270 int cert_error, |
269 const net::SSLInfo& ssl_info, | 271 const net::SSLInfo& ssl_info, |
270 const GURL& request_url, | 272 const GURL& request_url, |
271 bool overridable, | 273 bool overridable, |
272 bool strict_enforcement, | 274 bool strict_enforcement, |
273 const base::Callback<void(bool)>& callback, | 275 const base::Callback<void(bool)>& callback, |
274 bool* cancel_request) { | 276 bool* cancel_request) { |
275 // TODO(boliu): Implement this to power WebViewClient.onReceivedSslError. | 277 |
276 NOTIMPLEMENTED(); | 278 AwContentsClientBridgeBase* client = |
277 *cancel_request = true; | 279 AwContentsClientBridgeBase::FromID(render_process_id, render_view_id); |
| 280 if (client) { |
| 281 client->AllowCertificateError(cert_error, ssl_info.cert, request_url, |
| 282 callback, cancel_request); |
| 283 } else { |
| 284 *cancel_request = true; |
| 285 } |
278 } | 286 } |
279 | 287 |
280 WebKit::WebNotificationPresenter::Permission | 288 WebKit::WebNotificationPresenter::Permission |
281 AwContentBrowserClient::CheckDesktopNotificationPermission( | 289 AwContentBrowserClient::CheckDesktopNotificationPermission( |
282 const GURL& source_url, | 290 const GURL& source_url, |
283 content::ResourceContext* context, | 291 content::ResourceContext* context, |
284 int render_process_id) { | 292 int render_process_id) { |
285 // Android WebView does not support notifications, so return Denied here. | 293 // Android WebView does not support notifications, so return Denied here. |
286 return WebKit::WebNotificationPresenter::PermissionDenied; | 294 return WebKit::WebNotificationPresenter::PermissionDenied; |
287 } | 295 } |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 | 400 |
393 bool AwContentBrowserClient::AllowPepperSocketAPI( | 401 bool AwContentBrowserClient::AllowPepperSocketAPI( |
394 content::BrowserContext* browser_context, | 402 content::BrowserContext* browser_context, |
395 const GURL& url, | 403 const GURL& url, |
396 const content::SocketPermissionRequest& params) { | 404 const content::SocketPermissionRequest& params) { |
397 NOTREACHED() << "Android WebView does not support plugins"; | 405 NOTREACHED() << "Android WebView does not support plugins"; |
398 return false; | 406 return false; |
399 } | 407 } |
400 | 408 |
401 } // namespace android_webview | 409 } // namespace android_webview |
OLD | NEW |