Chromium Code Reviews| Index: chrome/browser/ui/android/ssl_client_certificate_request.cc |
| diff --git a/chrome/browser/ui/android/ssl_client_certificate_request.cc b/chrome/browser/ui/android/ssl_client_certificate_request.cc |
| index 468b53b21b3661e4ce8b0083ef20307604b4773d..5d7b33817d541bda71a589a5ed5be8802edb784b 100644 |
| --- a/chrome/browser/ui/android/ssl_client_certificate_request.cc |
| +++ b/chrome/browser/ui/android/ssl_client_certificate_request.cc |
| @@ -13,6 +13,7 @@ |
| #include "base/compiler_specific.h" |
| #include "base/logging.h" |
| #include "chrome/browser/ssl/ssl_client_certificate_selector.h" |
| +#include "chrome/browser/ui/android/window_android_helper.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "jni/SSLClientCertificateRequest_jni.h" |
| #include "net/android/keystore_openssl.h" |
| @@ -21,6 +22,7 @@ |
| #include "net/ssl/openssl_client_key_store.h" |
| #include "net/ssl/ssl_cert_request_info.h" |
| #include "net/ssl/ssl_client_cert_type.h" |
| +#include "ui/base/android/window_android.h" |
| namespace chrome { |
| @@ -40,9 +42,15 @@ void RecordClientCertificateKey( |
| void StartClientCertificateRequest( |
| const net::SSLCertRequestInfo* cert_request_info, |
| + const ui::WindowAndroid* window, |
| const chrome::SelectCertificateCallback& callback) { |
| DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| + if (!window) { |
|
Ted C
2014/02/13 04:38:44
Since you DCHECK window below, you should be able
David Trainor- moved to gerrit
2014/02/13 05:03:55
Yeah I thought about that too, but was trying to f
David Trainor- moved to gerrit
2014/02/14 19:13:36
Done.
|
| + LOG(ERROR) << "Invalid WindowAndroid"; |
| + return; |
| + } |
| + |
| // Ensure that callback(NULL) is posted as a task on the UI thread |
| // in case of an error. |
| base::Closure post_task_closure = base::Bind( |
| @@ -104,8 +112,13 @@ void StartClientCertificateRequest( |
| if (!chrome::android:: |
| Java_SSLClientCertificateRequest_selectClientCertificate( |
| - env, request_id, key_types_ref.obj(), principals_ref.obj(), |
| - host_name_ref.obj(), cert_request_info->host_and_port.port())) { |
| + env, |
| + request_id, |
| + window->GetJavaObject().obj(), |
| + key_types_ref.obj(), |
| + principals_ref.obj(), |
| + host_name_ref.obj(), |
| + cert_request_info->host_and_port.port())) { |
| return; |
| } |
| @@ -206,8 +219,11 @@ void ShowSSLClientCertificateSelector( |
| const net::HttpNetworkSession* network_session, |
| net::SSLCertRequestInfo* cert_request_info, |
| const chrome::SelectCertificateCallback& callback) { |
| + ui::WindowAndroid* window = |
| + WindowAndroidHelper::FromWebContents(contents)->GetWindowAndroid(); |
| + DCHECK(window); |
| DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| - StartClientCertificateRequest(cert_request_info, callback); |
| + StartClientCertificateRequest(cert_request_info, window, callback); |
| } |
| } // namespace chrome |