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..fb2c289c6ff5a14f23f1508684971dc3c2f7bcd5 |
--- /dev/null |
+++ b/chrome/browser/ui/android/ssl_client_certificate_request.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_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. |
+typedef base::Callback |
+ <void(const std::vector<base::StringPiece>*, jobject)> |
+ CertificateSelectionCallback; |
Ryan Sleevi
2013/03/06 21:50:43
Suggestion on reflow:
typedef base::Callback<void
digit1
2013/03/06 23:00:08
Done.
|
+ |
+// 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. |
+// |
+// Note the following limitations, coming from the platform APIS: |
Ryan Sleevi
2013/03/06 21:50:43
Suggestion on reword:
// Due to platform APIs, no
digit1
2013/03/06 23:00:08
Done.
|
+// |
+// - 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. |
+// |
Ryan Sleevi
2013/03/06 21:50:43
style: suggest deleting the blank lines on 44, 46,
digit1
2013/03/06 23:00:08
Done.
|
+// - If the user fails to select a certificate, fails to unlock access |
+// to the credential storage, or another error occurs, the |
+// callback is called with NULL parameters. There is no way to know |
+// exactly what happened though. |
+// |
Ryan Sleevi
2013/03/06 21:50:43
nit: delete blank line
digit1
2013/03/06 23:00:08
Done.
|
+void StartClientCertificateRequest( |
+ 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_ |