| 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 #include "chrome/browser/ssl_client_certificate_selector.h" | 5 #include "chrome/browser/ssl_client_certificate_selector.h" |
| 6 | 6 |
| 7 #import <SecurityInterface/SFChooseIdentityPanel.h> | 7 #import <SecurityInterface/SFChooseIdentityPanel.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 virtual void OnCertSelectedByNotification() { | 124 virtual void OnCertSelectedByNotification() { |
| 125 [controller_ onNotification]; | 125 [controller_ onNotification]; |
| 126 } | 126 } |
| 127 | 127 |
| 128 private: | 128 private: |
| 129 SSLClientCertificateSelectorCocoa* controller_; | 129 SSLClientCertificateSelectorCocoa* controller_; |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 } // namespace | 132 } // namespace |
| 133 | 133 |
| 134 namespace browser { | 134 namespace chrome { |
| 135 | 135 |
| 136 void ShowSSLClientCertificateSelector( | 136 void ShowSSLClientCertificateSelector( |
| 137 TabContents* tabContents, | 137 TabContents* tabContents, |
| 138 const net::HttpNetworkSession* network_session, | 138 const net::HttpNetworkSession* network_session, |
| 139 net::SSLCertRequestInfo* cert_request_info, | 139 net::SSLCertRequestInfo* cert_request_info, |
| 140 const base::Callback<void(net::X509Certificate*)>& callback) { | 140 const base::Callback<void(net::X509Certificate*)>& callback) { |
| 141 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 141 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 142 SSLClientCertificateSelectorCocoa* selector = | 142 SSLClientCertificateSelectorCocoa* selector = |
| 143 [[[SSLClientCertificateSelectorCocoa alloc] | 143 [[[SSLClientCertificateSelectorCocoa alloc] |
| 144 initWithObserver:network_session | 144 initWithObserver:network_session |
| 145 certRequestInfo:cert_request_info | 145 certRequestInfo:cert_request_info |
| 146 callback:callback] autorelease]; | 146 callback:callback] autorelease]; |
| 147 [selector displayDialog:tabContents]; | 147 [selector displayDialog:tabContents]; |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace browser | 150 } // namespace chrome |
| 151 | 151 |
| 152 @implementation SSLClientCertificateSelectorCocoa | 152 @implementation SSLClientCertificateSelectorCocoa |
| 153 | 153 |
| 154 - (id)initWithObserver:(const net::HttpNetworkSession*)networkSession | 154 - (id)initWithObserver:(const net::HttpNetworkSession*)networkSession |
| 155 certRequestInfo:(net::SSLCertRequestInfo*)certRequestInfo | 155 certRequestInfo:(net::SSLCertRequestInfo*)certRequestInfo |
| 156 callback:(const base::Callback<void(net::X509Certificate*)>&)callback { | 156 callback:(const base::Callback<void(net::X509Certificate*)>&)callback { |
| 157 DCHECK(networkSession); | 157 DCHECK(networkSession); |
| 158 DCHECK(certRequestInfo); | 158 DCHECK(certRequestInfo); |
| 159 if ((self = [super init])) { | 159 if ((self = [super init])) { |
| 160 window_ = NULL; | 160 window_ = NULL; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 panel, self, | 230 panel, self, |
| 231 @selector(sheetDidEnd:returnCode:context:), | 231 @selector(sheetDidEnd:returnCode:context:), |
| 232 identities_, title)); | 232 identities_, title)); |
| 233 observer_->StartObserving(); | 233 observer_->StartObserving(); |
| 234 // Note: SFChooseIdentityPanel does not take a reference to itself while the | 234 // Note: SFChooseIdentityPanel does not take a reference to itself while the |
| 235 // sheet is open. ConstrainedSFChooseIdentityPanel will release ownership | 235 // sheet is open. ConstrainedSFChooseIdentityPanel will release ownership |
| 236 // on destruction. | 236 // on destruction. |
| 237 } | 237 } |
| 238 | 238 |
| 239 @end | 239 @end |
| OLD | NEW |