| OLD | NEW |
| 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/mac/scoped_cftyperef.h" | 11 #include "base/mac/scoped_cftyperef.h" |
| 12 #include "base/mac/scoped_nsobject.h" | 12 #include "base/mac/scoped_nsobject.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "chrome/browser/ssl/ssl_client_certificate_selector.h" | 15 #include "chrome/browser/ssl/ssl_client_certificate_selector.h" |
| 16 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sh
eet.h" | 16 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sh
eet.h" |
| 17 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_con
troller.h" | 17 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_con
troller.h" |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 class BrowserContext; | 20 class BrowserContext; |
| 21 class ClientCertificateDelegate; |
| 21 } | 22 } |
| 22 | 23 |
| 23 class ConstrainedWindowMac; | 24 class ConstrainedWindowMac; |
| 24 @class SFChooseIdentityPanel; | 25 @class SFChooseIdentityPanel; |
| 25 class SSLClientAuthObserverCocoaBridge; | 26 class SSLClientAuthObserverCocoaBridge; |
| 26 | 27 |
| 27 @interface SSLClientCertificateSelectorCocoa | 28 @interface SSLClientCertificateSelectorCocoa |
| 28 : NSObject<ConstrainedWindowSheet> { | 29 : NSObject<ConstrainedWindowSheet> { |
| 29 @private | 30 @private |
| 30 // The list of identities offered to the user. | 31 // The list of identities offered to the user. |
| 31 base::ScopedCFTypeRef<CFMutableArrayRef> identities_; | 32 base::ScopedCFTypeRef<CFMutableArrayRef> identities_; |
| 32 // The corresponding list of certificates. | 33 // The corresponding list of certificates. |
| 33 std::vector<scoped_refptr<net::X509Certificate> > certificates_; | 34 std::vector<scoped_refptr<net::X509Certificate> > certificates_; |
| 34 // A C++ object to bridge SSLClientAuthObserver notifications to us. | 35 // A C++ object to bridge SSLClientAuthObserver notifications to us. |
| 35 scoped_ptr<SSLClientAuthObserverCocoaBridge> observer_; | 36 scoped_ptr<SSLClientAuthObserverCocoaBridge> observer_; |
| 36 base::scoped_nsobject<SFChooseIdentityPanel> panel_; | 37 base::scoped_nsobject<SFChooseIdentityPanel> panel_; |
| 37 scoped_ptr<ConstrainedWindowMac> constrainedWindow_; | 38 scoped_ptr<ConstrainedWindowMac> constrainedWindow_; |
| 38 base::scoped_nsobject<NSWindow> overlayWindow_; | 39 base::scoped_nsobject<NSWindow> overlayWindow_; |
| 39 BOOL closePending_; | 40 BOOL closePending_; |
| 40 // A copy of the sheet's frame used to restore on show. | 41 // A copy of the sheet's frame used to restore on show. |
| 41 NSRect oldSheetFrame_; | 42 NSRect oldSheetFrame_; |
| 42 // 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. |
| 43 BOOL oldResizesSubviews_; | 44 BOOL oldResizesSubviews_; |
| 45 // True if the certificate selection has been made. |
| 46 BOOL certificateSelected_; |
| 44 } | 47 } |
| 45 | 48 |
| 46 @property (readonly, nonatomic) SFChooseIdentityPanel* panel; | 49 @property (readonly, nonatomic) SFChooseIdentityPanel* panel; |
| 47 | 50 |
| 48 - (id)initWithBrowserContext:(const content::BrowserContext*)browserContext | 51 - (id)initWithBrowserContext:(const content::BrowserContext*)browserContext |
| 49 certRequestInfo:(net::SSLCertRequestInfo*)certRequestInfo | 52 certRequestInfo:(net::SSLCertRequestInfo*)certRequestInfo |
| 50 callback:(const chrome::SelectCertificateCallback&)callback; | 53 delegate:(scoped_ptr<content::ClientCertificateDelegate>) |
| 54 delegate; |
| 51 - (void)displayForWebContents:(content::WebContents*)webContents; | 55 - (void)displayForWebContents:(content::WebContents*)webContents; |
| 52 - (void)closeWebContentsModalDialog; | 56 - (void)closeWebContentsModalDialog; |
| 53 | 57 |
| 54 - (NSWindow*)overlayWindow; | 58 - (NSWindow*)overlayWindow; |
| 55 | 59 |
| 56 @end | 60 @end |
| 57 | 61 |
| 58 #endif // CHROME_BROWSER_UI_COCOA_SSL_CLIENT_CERTIFICATE_SELECTOR_COCOA_H_ | 62 #endif // CHROME_BROWSER_UI_COCOA_SSL_CLIENT_CERTIFICATE_SELECTOR_COCOA_H_ |
| OLD | NEW |