OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_ANDROID_SSL_CLIENT_CERTIFICATE_REQUEST_H_ | |
6 #define CHROME_BROWSER_UI_ANDROID_SSL_CLIENT_CERTIFICATE_REQUEST_H_ | |
7 | |
8 #include <jni.h> | |
9 | |
10 #include "base/android/scoped_java_ref.h" | |
11 #include "base/basictypes.h" | |
12 #include "base/callback.h" | |
13 #include "base/memory/ref_counted.h" | |
14 #include "base/string_piece.h" | |
15 | |
16 namespace net { | |
17 class SSLCertRequestInfo; | |
18 } // namespace net | |
19 | |
20 namespace chrome { | |
21 namespace android { | |
22 | |
23 // Type for a callback that will receive the results of certificate | |
24 // selection. | |
25 // The first parameter is the encoded client certificate chain, where | |
26 // each item is a DER-encoded X.509 certificate. | |
27 // The second parameter is a local JNI reference to the platform's | |
28 // PrivateKey object for this certificate. | |
29 // Note that the callback will be called with NULL parameters | |
30 // to indicate that no certificate was selected, or that an error | |
31 // occured. | |
32 typedef base::Callback | |
33 <void(const std::vector<base::StringPiece>*, jobject)> | |
34 CertificateSelectionCallback; | |
Ryan Sleevi
2013/03/06 21:50:43
Suggestion on reflow:
typedef base::Callback<void
digit1
2013/03/06 23:00:08
Done.
| |
35 | |
36 // Launch an asynchronous client certificate system activity to let | |
37 // the user select a client certificate. | |
38 // | |
39 // |cert_request_info| holds the client certificate request details. | |
40 // |cert_callback| is a callback that will be called later with the | |
41 // results of the request, later on the UI thread. | |
42 // | |
43 // 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.
| |
44 // | |
45 // - It's not possible to cancel a request once it has been started. | |
46 // | |
47 // - Each request will launch a system activity which pauses the UI | |
48 // thread. | |
49 // | |
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.
| |
50 // - If the user fails to select a certificate, fails to unlock access | |
51 // to the credential storage, or another error occurs, the | |
52 // callback is called with NULL parameters. There is no way to know | |
53 // exactly what happened though. | |
54 // | |
Ryan Sleevi
2013/03/06 21:50:43
nit: delete blank line
digit1
2013/03/06 23:00:08
Done.
| |
55 void StartClientCertificateRequest( | |
56 const net::SSLCertRequestInfo* cert_request_info, | |
57 const CertificateSelectionCallback& cert_callback); | |
58 | |
59 // Register JNI methods. | |
60 bool RegisterSSLClientCertificateRequestAndroid(JNIEnv* env); | |
61 | |
62 } // namespace android | |
63 } // namespace chrome | |
64 | |
65 #endif // CHROME_BROWSER_UI_ANDROID_SSL_CLIENT_CERTIFICATE_REQUEST_H_ | |
OLD | NEW |