Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: chrome/browser/ui/views/ssl_client_certificate_selector.h

Issue 2898573002: Refactor client cert private key handling. (Closed)
Patch Set: removed no longer needed forward declaration Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_VIEWS_SSL_CLIENT_CERTIFICATE_SELECTOR_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_SSL_CLIENT_CERTIFICATE_SELECTOR_H_
6 #define CHROME_BROWSER_UI_VIEWS_SSL_CLIENT_CERTIFICATE_SELECTOR_H_ 6 #define CHROME_BROWSER_UI_VIEWS_SSL_CLIENT_CERTIFICATE_SELECTOR_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "chrome/browser/ssl/ssl_client_auth_observer.h"
10 #include "chrome/browser/ssl/ssl_client_certificate_selector.h" 9 #include "chrome/browser/ssl/ssl_client_certificate_selector.h"
11 #include "chrome/browser/ui/views/certificate_selector.h" 10 #include "chrome/browser/ui/views/certificate_selector.h"
12 #include "content/public/browser/web_contents_observer.h"
13 11
14 // This header file exists only for testing. Chrome should access the 12 // This header file exists only for testing. Chrome should access the
15 // certificate selector only through the cross-platform interface 13 // certificate selector only through the cross-platform interface
16 // chrome/browser/ssl_client_certificate_selector.h. 14 // chrome/browser/ssl_client_certificate_selector.h.
17 15
18 namespace content { 16 namespace content {
19 class WebContents; 17 class WebContents;
20 } 18 }
21 19
22 namespace net { 20 namespace net {
23 class SSLCertRequestInfo; 21 class SSLCertRequestInfo;
24 class X509Certificate;
25 } 22 }
26 23
27 class SSLClientCertificateSelector : public chrome::CertificateSelector, 24 class SSLClientCertificateSelector : public chrome::CertificateSelector {
28 public SSLClientAuthObserver,
29 public content::WebContentsObserver {
30 public: 25 public:
31 SSLClientCertificateSelector( 26 SSLClientCertificateSelector(
32 content::WebContents* web_contents, 27 content::WebContents* web_contents,
33 const scoped_refptr<net::SSLCertRequestInfo>& cert_request_info, 28 const scoped_refptr<net::SSLCertRequestInfo>& cert_request_info,
34 net::CertificateList client_certs, 29 net::ClientCertIdentityList client_certs,
35 std::unique_ptr<content::ClientCertificateDelegate> delegate); 30 std::unique_ptr<content::ClientCertificateDelegate> delegate);
36 ~SSLClientCertificateSelector() override; 31 ~SSLClientCertificateSelector() override;
37 32
38 void Init(); 33 void Init();
39 34 void CloseDialog();
40 // SSLClientAuthObserver:
41 void OnCertSelectedByNotification() override;
42 35
43 // chrome::CertificateSelector: 36 // chrome::CertificateSelector:
44 void DeleteDelegate() override; 37 void DeleteDelegate() override;
45 bool Accept() override; 38 void AcceptCertificate(
46 39 std::unique_ptr<net::ClientCertIdentity> identity) override;
47 // content::WebContentsObserver:
48 void WebContentsDestroyed() override;
49 40
50 private: 41 private:
51 // Callback after unlocking certificate slot. 42 class SSLClientAuthObserverImpl;
52 void Unlocked(net::X509Certificate* cert); 43
44 std::unique_ptr<SSLClientAuthObserverImpl> auth_observer_impl_;
53 45
54 DISALLOW_COPY_AND_ASSIGN(SSLClientCertificateSelector); 46 DISALLOW_COPY_AND_ASSIGN(SSLClientCertificateSelector);
55 }; 47 };
56 48
57 #endif // CHROME_BROWSER_UI_VIEWS_SSL_CLIENT_CERTIFICATE_SELECTOR_H_ 49 #endif // CHROME_BROWSER_UI_VIEWS_SSL_CLIENT_CERTIFICATE_SELECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698