Index: chrome/browser/ui/android/ssl_client_certificate_request.h |
diff --git a/chrome/browser/ui/android/ssl_client_certificate_request.h b/chrome/browser/ui/android/ssl_client_certificate_request.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9685cf64fd22888cc7b321c24433a7b363b00e23 |
--- /dev/null |
+++ b/chrome/browser/ui/android/ssl_client_certificate_request.h |
@@ -0,0 +1,59 @@ |
+// 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_REQUEST_H_ |
+#define CHROME_BROWSER_UI_ANDROID_SSL_CLIENT_CERTIFICATE_REQUEST_H_ |
+ |
+#include <jni.h> |
+ |
+#include "base/android/scoped_java_ref.h" |
+#include "base/basictypes.h" |
+#include "base/callback.h" |
+#include "base/memory/ref_counted.h" |
+#include "base/string_piece.h" |
+ |
+namespace net { |
+class SSLCertRequestInfo; |
+} // namespace net |
+ |
+namespace chrome { |
+namespace android { |
+ |
+// Type for a callback that will receive the results of certificate |
+// selection. |
+// The first parameter is the encoded client certificate chain, where |
+// each item is a DER-encoded X.509 certificate. |
+// The second parameter is a local JNI reference to the platform's |
+// PrivateKey object for this certificate. |
+// Note that the callback will be called with NULL parameters |
+// to indicate that no certificate was selected, or that an error |
+// occured (e.g. if the user failed to unlock access to the |
+// credential storage). |
+typedef base::Callback<void(const std::vector<base::StringPiece>*, |
Ryan Sleevi
2013/03/06 23:24:22
On second glance, I'm not at all sure how this is
digit1
2013/03/07 15:38:20
Actually this section of the head if obsolete, the
|
+ jobject)> |
+ CertificateSelectionCallback; |
+ |
+// Launch an asynchronous client certificate system activity to let |
+// the user select a client certificate. |
+// |
+// |cert_request_info| holds the client certificate request details. |
+// |cert_callback| is a callback that will be called later with the |
+// results of the request, later on the UI thread. |
+// |
+// Due to platform APIs, note the following limitations: |
+// - It's not possible to cancel a request once it has been started. |
+// - Each request will launch a system activity which pauses the UI |
+// thread. |
+// - There is no way to distinguish between different error cases. |
+void StartClientCertificateRequest( |
Ryan Sleevi
2013/03/06 23:24:22
maybe I'm blind, but why does this need to be in t
digit1
2013/03/07 15:38:20
It doesn't need to be here, it's just that I forgo
|
+ const net::SSLCertRequestInfo* cert_request_info, |
+ const CertificateSelectionCallback& cert_callback); |
+ |
+// Register JNI methods. |
+bool RegisterSSLClientCertificateRequestAndroid(JNIEnv* env); |
+ |
+} // namespace android |
+} // namespace chrome |
+ |
+#endif // CHROME_BROWSER_UI_ANDROID_SSL_CLIENT_CERTIFICATE_REQUEST_H_ |