Chromium Code Reviews| Index: chrome/browser/ui/android/ssl_client_certificate_selector_android.h |
| diff --git a/chrome/browser/ui/android/ssl_client_certificate_selector_android.h b/chrome/browser/ui/android/ssl_client_certificate_selector_android.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e33ff0d8d2c498746e0c3c17d558e0b44278e4be |
| --- /dev/null |
| +++ b/chrome/browser/ui/android/ssl_client_certificate_selector_android.h |
| @@ -0,0 +1,65 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_ANDROID_SSL_CLIENT_CERTIFICATE_SELECTOR_ANDROID_H_ |
| +#define CHROME_BROWSER_UI_ANDROID_SSL_CLIENT_CERTIFICATE_SELECTOR_ANDROID_H_ |
|
Ryan Sleevi
2013/02/12 00:25:17
Why is the _Android suffix necessary? You're in ch
digit1
2013/02/12 15:05:25
It's not necessary, but some developers prefer to
|
| + |
| +#include <jni.h> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/callback.h" |
| +#include "chrome/browser/ssl/ssl_client_certificate_selector.h" |
| + |
| +namespace net { |
| +class SSLCertRequestInfo; |
| +} // namespace net |
| + |
| +namespace browser { |
|
Ryan Sleevi
2013/02/12 20:12:58
namespace chrome {
namespace browser {
digit1
2013/02/13 18:24:34
Actually, this can't be under the chrome namespace
|
| + |
| +class SSLClientCertRequest { |
|
Ryan Sleevi
2013/02/12 00:25:17
??? This doesn't match the naming of the file - to
digit1
2013/02/12 15:05:25
I really meant SSLClientCertRequest, it's a C++ cl
Ryan Sleevi
2013/02/12 20:12:58
But then there is no SSLClientCertificateSelectorA
digit1
2013/02/13 18:24:34
I've removed the chrome/ changes from this review,
|
| + public: |
| + SSLClientCertRequest( |
| + net::SSLCertRequestInfo* cert_request_info, |
| + const chrome::SelectCertificateCallback& callback) |
| + : cert_request_info_(cert_request_info), |
| + callback_(callback) { } |
|
Ryan Sleevi
2013/02/12 20:12:58
style: indents are wrong (need two additional spac
digit1
2013/02/13 18:24:34
thanks, I'll fix this in the next patch that reviv
|
| + |
| + ~SSLClientCertRequest() {} |
| + |
| + // Start the request |
| + bool Start(); |
| + |
| + // Called from Java through JNI when the request completes or was |
| + // cancelled by the user. |
| + // |env| is the current threads' JNIEnv handle. |
| + // |obj| is a JNI reference to the Java object instance associated |
| + // with this request. |
| + // |private_key_alias| is a JNI string reference to the private key |
| + // unique name. |
| + // |encoded_chain_ref| is a JNI reference to an array of byte arrays |
| + // modelling the encoded client certificate chain. Will be null if |
| + // the request was cancelled or an error occured. |
| + // |private_key_ref| is a JNI reference to the PrivateKey object for |
| + // the client certificate. Will be null if the request was cancelled |
| + // or an error occured. |
| + void OnRequestCompletion(JNIEnv* env, |
| + jobject obj, |
| + jstring private_key_alias_ref, |
| + jobjectArray encoded_chain_ref, |
| + jobject private_key_ref); |
| + |
| + private: |
| + net::SSLCertRequestInfo* cert_request_info_; |
| + chrome::SelectCertificateCallback callback_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SSLClientCertRequest); |
| +}; |
| + |
| +// Register JNI methods. |
| +bool RegisterSSLClientCertificateSelectorAndroid(JNIEnv* env); |
| + |
| +} // namespace browser |
| + |
| +#endif // CHROME_BROWSER_UI_ANDROID_SSL_CLIENT_CERTIFICATE_SELECTOR_ANDROID_H_ |
| + |