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_SELECTOR_ANDROID_H_ | |
6 #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
| |
7 | |
8 #include <jni.h> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "base/callback.h" | |
12 #include "chrome/browser/ssl/ssl_client_certificate_selector.h" | |
13 | |
14 namespace net { | |
15 class SSLCertRequestInfo; | |
16 } // namespace net | |
17 | |
18 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
| |
19 | |
20 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,
| |
21 public: | |
22 SSLClientCertRequest( | |
23 net::SSLCertRequestInfo* cert_request_info, | |
24 const chrome::SelectCertificateCallback& callback) | |
25 : cert_request_info_(cert_request_info), | |
26 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
| |
27 | |
28 ~SSLClientCertRequest() {} | |
29 | |
30 // Start the request | |
31 bool Start(); | |
32 | |
33 // Called from Java through JNI when the request completes or was | |
34 // cancelled by the user. | |
35 // |env| is the current threads' JNIEnv handle. | |
36 // |obj| is a JNI reference to the Java object instance associated | |
37 // with this request. | |
38 // |private_key_alias| is a JNI string reference to the private key | |
39 // unique name. | |
40 // |encoded_chain_ref| is a JNI reference to an array of byte arrays | |
41 // modelling the encoded client certificate chain. Will be null if | |
42 // the request was cancelled or an error occured. | |
43 // |private_key_ref| is a JNI reference to the PrivateKey object for | |
44 // the client certificate. Will be null if the request was cancelled | |
45 // or an error occured. | |
46 void OnRequestCompletion(JNIEnv* env, | |
47 jobject obj, | |
48 jstring private_key_alias_ref, | |
49 jobjectArray encoded_chain_ref, | |
50 jobject private_key_ref); | |
51 | |
52 private: | |
53 net::SSLCertRequestInfo* cert_request_info_; | |
54 chrome::SelectCertificateCallback callback_; | |
55 | |
56 DISALLOW_COPY_AND_ASSIGN(SSLClientCertRequest); | |
57 }; | |
58 | |
59 // Register JNI methods. | |
60 bool RegisterSSLClientCertificateSelectorAndroid(JNIEnv* env); | |
61 | |
62 } // namespace browser | |
63 | |
64 #endif // CHROME_BROWSER_UI_ANDROID_SSL_CLIENT_CERTIFICATE_SELECTOR_ANDROID_H_ | |
65 | |
OLD | NEW |