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 "chrome/browser/ui/android/ssl_client_certificate_request.h" | 5 #include "chrome/browser/ui/android/ssl_client_certificate_request.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // Build the |host_name| and |port| JNI parameters, as a String and | 88 // Build the |host_name| and |port| JNI parameters, as a String and |
89 // a jint. | 89 // a jint. |
90 ScopedJavaLocalRef<jstring> host_name_ref = | 90 ScopedJavaLocalRef<jstring> host_name_ref = |
91 base::android::ConvertUTF8ToJavaString( | 91 base::android::ConvertUTF8ToJavaString( |
92 env, cert_request_info->host_and_port.host()); | 92 env, cert_request_info->host_and_port.host()); |
93 | 93 |
94 // Pass the address of the delegate through to Java. | 94 // Pass the address of the delegate through to Java. |
95 jlong request_id = reinterpret_cast<intptr_t>(delegate.get()); | 95 jlong request_id = reinterpret_cast<intptr_t>(delegate.get()); |
96 | 96 |
97 if (!chrome::android:: | 97 if (!chrome::android:: |
98 Java_SSLClientCertificateRequest_selectClientCertificate( | 98 Java_SSLClientCertificateRequest_selectClientCertificate( |
99 env, | 99 env, request_id, window->GetJavaObject(), key_types_ref, |
100 request_id, | 100 principals_ref, host_name_ref, |
101 window->GetJavaObject().obj(), | 101 cert_request_info->host_and_port.port())) { |
102 key_types_ref.obj(), | |
103 principals_ref.obj(), | |
104 host_name_ref.obj(), | |
105 cert_request_info->host_and_port.port())) { | |
106 return; | 102 return; |
107 } | 103 } |
108 | 104 |
109 // Ownership was transferred to Java. | 105 // Ownership was transferred to Java. |
110 ignore_result(delegate.release()); | 106 ignore_result(delegate.release()); |
111 } | 107 } |
112 | 108 |
113 } // namespace | 109 } // namespace |
114 | 110 |
115 namespace android { | 111 namespace android { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 net::SSLCertRequestInfo* cert_request_info, | 206 net::SSLCertRequestInfo* cert_request_info, |
211 std::unique_ptr<content::ClientCertificateDelegate> delegate) { | 207 std::unique_ptr<content::ClientCertificateDelegate> delegate) { |
212 ui::WindowAndroid* window = ViewAndroidHelper::FromWebContents(contents) | 208 ui::WindowAndroid* window = ViewAndroidHelper::FromWebContents(contents) |
213 ->GetViewAndroid()->GetWindowAndroid(); | 209 ->GetViewAndroid()->GetWindowAndroid(); |
214 DCHECK(window); | 210 DCHECK(window); |
215 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 211 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
216 StartClientCertificateRequest(cert_request_info, window, std::move(delegate)); | 212 StartClientCertificateRequest(cert_request_info, window, std::move(delegate)); |
217 } | 213 } |
218 | 214 |
219 } // namespace chrome | 215 } // namespace chrome |
OLD | NEW |