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

Side by Side Diff: chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.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_COCOA_SSL_CLIENT_CERTIFICATE_SELECTOR_COCOA_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_SSL_CLIENT_CERTIFICATE_SELECTOR_COCOA_H_
6 #define CHROME_BROWSER_UI_COCOA_SSL_CLIENT_CERTIFICATE_SELECTOR_COCOA_H_ 6 #define CHROME_BROWSER_UI_COCOA_SSL_CLIENT_CERTIFICATE_SELECTOR_COCOA_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/mac/scoped_cftyperef.h" 13 #include "base/mac/scoped_cftyperef.h"
14 #include "base/mac/scoped_nsobject.h" 14 #include "base/mac/scoped_nsobject.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "chrome/browser/ssl/ssl_client_certificate_selector.h" 16 #include "chrome/browser/ssl/ssl_client_certificate_selector.h"
17 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sh eet.h" 17 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sh eet.h"
18 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_con troller.h" 18 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_con troller.h"
19 #include "net/cert/x509_certificate.h" 19 #include "net/ssl/client_cert_identity.h"
20 20
21 namespace content { 21 namespace content {
22 class BrowserContext; 22 class BrowserContext;
23 class ClientCertificateDelegate; 23 class ClientCertificateDelegate;
24 } 24 }
25 25
26 class ConstrainedWindowMac; 26 class ConstrainedWindowMac;
27 @class SFChooseIdentityPanel; 27 @class SFChooseIdentityPanel;
28 class SSLClientAuthObserverCocoaBridge; 28 class SSLClientAuthObserverCocoaBridge;
29 29
30 @interface SSLClientCertificateSelectorCocoa 30 @interface SSLClientCertificateSelectorCocoa
31 : NSObject<ConstrainedWindowSheet> { 31 : NSObject<ConstrainedWindowSheet> {
32 @private 32 @private
33 // The list of identities offered to the user. 33 // The list of SecIdentityRefs offered to the user.
34 base::ScopedCFTypeRef<CFMutableArrayRef> identities_; 34 base::ScopedCFTypeRef<CFMutableArrayRef> sec_identities_;
35 // The corresponding list of certificates. 35 // The corresponding list of ClientCertIdentities.
36 std::vector<scoped_refptr<net::X509Certificate>> certificates_; 36 net::ClientCertIdentityList cert_identities_;
37 // A C++ object to bridge SSLClientAuthObserver notifications to us. 37 // A C++ object to bridge SSLClientAuthObserver notifications to us.
38 std::unique_ptr<SSLClientAuthObserverCocoaBridge> observer_; 38 std::unique_ptr<SSLClientAuthObserverCocoaBridge> observer_;
39 base::scoped_nsobject<SFChooseIdentityPanel> panel_; 39 base::scoped_nsobject<SFChooseIdentityPanel> panel_;
40 std::unique_ptr<ConstrainedWindowMac> constrainedWindow_; 40 std::unique_ptr<ConstrainedWindowMac> constrainedWindow_;
41 base::scoped_nsobject<NSWindow> overlayWindow_; 41 base::scoped_nsobject<NSWindow> overlayWindow_;
42 BOOL closePending_; 42 BOOL closePending_;
43 // A copy of the sheet's |autoresizesSubviews| flag to restore on show. 43 // A copy of the sheet's |autoresizesSubviews| flag to restore on show.
44 BOOL oldResizesSubviews_; 44 BOOL oldResizesSubviews_;
45 // True if the user dismissed the dialog directly, either via the OK (continue 45 // True if the user dismissed the dialog directly, either via the OK (continue
46 // the request with a certificate) or Cancel (continue the request with no 46 // the request with a certificate) or Cancel (continue the request with no
47 // certificate) buttons. 47 // certificate) buttons.
48 BOOL userResponded_; 48 BOOL userResponded_;
49 } 49 }
50 50
51 @property (readonly, nonatomic) SFChooseIdentityPanel* panel; 51 @property (readonly, nonatomic) SFChooseIdentityPanel* panel;
52 52
53 - (id)initWithBrowserContext:(const content::BrowserContext*)browserContext 53 - (id)initWithBrowserContext:(const content::BrowserContext*)browserContext
54 certRequestInfo:(net::SSLCertRequestInfo*)certRequestInfo 54 certRequestInfo:(net::SSLCertRequestInfo*)certRequestInfo
55 delegate: 55 delegate:
56 (std::unique_ptr<content::ClientCertificateDelegate>) 56 (std::unique_ptr<content::ClientCertificateDelegate>)
57 delegate; 57 delegate;
58 - (void)displayForWebContents:(content::WebContents*)webContents 58 - (void)displayForWebContents:(content::WebContents*)webContents
59 clientCerts:(net::CertificateList)inputClientCerts; 59 clientCerts:(net::ClientCertIdentityList)inputClientCerts;
60 - (void)closeWebContentsModalDialog; 60 - (void)closeWebContentsModalDialog;
61 61
62 - (NSWindow*)overlayWindow; 62 - (NSWindow*)overlayWindow;
63 63
64 @end 64 @end
65 65
66 #endif // CHROME_BROWSER_UI_COCOA_SSL_CLIENT_CERTIFICATE_SELECTOR_COCOA_H_ 66 #endif // CHROME_BROWSER_UI_COCOA_SSL_CLIENT_CERTIFICATE_SELECTOR_COCOA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698