| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "android_webview/browser/aw_browser_context.h" | 9 #include "android_webview/browser/aw_browser_context.h" |
| 10 #include "android_webview/browser/aw_browser_main_parts.h" | 10 #include "android_webview/browser/aw_browser_main_parts.h" |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 const GURL& request_url, | 381 const GURL& request_url, |
| 382 ResourceType resource_type, | 382 ResourceType resource_type, |
| 383 bool overridable, | 383 bool overridable, |
| 384 bool strict_enforcement, | 384 bool strict_enforcement, |
| 385 bool expired_previous_decision, | 385 bool expired_previous_decision, |
| 386 const base::Callback<void(content::CertificateRequestResultType)>& | 386 const base::Callback<void(content::CertificateRequestResultType)>& |
| 387 callback) { | 387 callback) { |
| 388 AwContentsClientBridgeBase* client = | 388 AwContentsClientBridgeBase* client = |
| 389 AwContentsClientBridgeBase::FromWebContents(web_contents); | 389 AwContentsClientBridgeBase::FromWebContents(web_contents); |
| 390 bool cancel_request = true; | 390 bool cancel_request = true; |
| 391 if (client) | 391 if (client) { |
| 392 client->AllowCertificateError(cert_error, | 392 client->AllowCertificateError(cert_error, |
| 393 ssl_info.cert.get(), | 393 ssl_info.cert.get(), |
| 394 request_url, | 394 request_url, |
| 395 callback, | 395 callback, |
| 396 &cancel_request); | 396 &cancel_request); |
| 397 if (client->HasPendingJavaException()) { |
| 398 // If there is a pending Java exception we should return out to our Java |
| 399 // handler as quickly as possible - and avoid calling back into Java |
| 400 // through JNI. |
| 401 return; |
| 402 } |
| 403 } |
| 397 if (cancel_request) | 404 if (cancel_request) |
| 398 callback.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY); | 405 callback.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY); |
| 399 } | 406 } |
| 400 | 407 |
| 401 void AwContentBrowserClient::SelectClientCertificate( | 408 void AwContentBrowserClient::SelectClientCertificate( |
| 402 content::WebContents* web_contents, | 409 content::WebContents* web_contents, |
| 403 net::SSLCertRequestInfo* cert_request_info, | 410 net::SSLCertRequestInfo* cert_request_info, |
| 404 net::CertificateList client_certs, | 411 net::CertificateList client_certs, |
| 405 std::unique_ptr<content::ClientCertificateDelegate> delegate) { | 412 std::unique_ptr<content::ClientCertificateDelegate> delegate) { |
| 406 AwContentsClientBridgeBase* client = | 413 AwContentsClientBridgeBase* client = |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 render_frame_host)); | 572 render_frame_host)); |
| 566 | 573 |
| 567 // Although WebView does not support password manager feature, renderer code | 574 // Although WebView does not support password manager feature, renderer code |
| 568 // could still request this interface, so we register a dummy binder which | 575 // could still request this interface, so we register a dummy binder which |
| 569 // just drops the incoming request, to avoid the 'Failed to locate a binder | 576 // just drops the incoming request, to avoid the 'Failed to locate a binder |
| 570 // for interface' error log.. | 577 // for interface' error log.. |
| 571 registry->AddInterface(base::Bind(&DummyBindPasswordManagerDriver)); | 578 registry->AddInterface(base::Bind(&DummyBindPasswordManagerDriver)); |
| 572 } | 579 } |
| 573 | 580 |
| 574 } // namespace android_webview | 581 } // namespace android_webview |
| OLD | NEW |