| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/native/aw_contents_client_bridge.h" | 5 #include "android_webview/native/aw_contents_client_bridge.h" |
| 6 | 6 |
| 7 #include "android_webview/common/devtools_instrumentation.h" | 7 #include "android_webview/common/devtools_instrumentation.h" |
| 8 #include "android_webview/native/aw_contents.h" | 8 #include "android_webview/native/aw_contents.h" |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 return; | 120 return; |
| 121 } | 121 } |
| 122 callback->Run(proceed); | 122 callback->Run(proceed); |
| 123 pending_cert_error_callbacks_.Remove(id); | 123 pending_cert_error_callbacks_.Remove(id); |
| 124 } | 124 } |
| 125 | 125 |
| 126 // This method is inspired by SelectClientCertificate() in | 126 // This method is inspired by SelectClientCertificate() in |
| 127 // chrome/browser/ui/android/ssl_client_certificate_request.cc | 127 // chrome/browser/ui/android/ssl_client_certificate_request.cc |
| 128 void AwContentsClientBridge::SelectClientCertificate( | 128 void AwContentsClientBridge::SelectClientCertificate( |
| 129 net::SSLCertRequestInfo* cert_request_info, | 129 net::SSLCertRequestInfo* cert_request_info, |
| 130 scoped_ptr<content::ClientCertificateDelegate> delegate) { | 130 std::unique_ptr<content::ClientCertificateDelegate> delegate) { |
| 131 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 131 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 132 | 132 |
| 133 // Add the callback to id map. | 133 // Add the callback to id map. |
| 134 int request_id = | 134 int request_id = |
| 135 pending_client_cert_request_delegates_.Add(delegate.release()); | 135 pending_client_cert_request_delegates_.Add(delegate.release()); |
| 136 // Make sure callback is run on error. | 136 // Make sure callback is run on error. |
| 137 base::ScopedClosureRunner guard(base::Bind( | 137 base::ScopedClosureRunner guard(base::Bind( |
| 138 &AwContentsClientBridge::HandleErrorInClientCertificateResponse, | 138 &AwContentsClientBridge::HandleErrorInClientCertificateResponse, |
| 139 base::Unretained(this), | 139 base::Unretained(this), |
| 140 request_id)); | 140 request_id)); |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 pending_client_cert_request_delegates_.Remove(request_id); | 401 pending_client_cert_request_delegates_.Remove(request_id); |
| 402 | 402 |
| 403 delete delegate; | 403 delete delegate; |
| 404 } | 404 } |
| 405 | 405 |
| 406 bool RegisterAwContentsClientBridge(JNIEnv* env) { | 406 bool RegisterAwContentsClientBridge(JNIEnv* env) { |
| 407 return RegisterNativesImpl(env); | 407 return RegisterNativesImpl(env); |
| 408 } | 408 } |
| 409 | 409 |
| 410 } // namespace android_webview | 410 } // namespace android_webview |
| OLD | NEW |