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 #import "chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.h" |
6 | 6 |
7 #import <SecurityInterface/SFChooseIdentityPanel.h> | 7 #import <SecurityInterface/SFChooseIdentityPanel.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 - (void)sheetDidEnd:(NSWindow*)parent | 105 - (void)sheetDidEnd:(NSWindow*)parent |
106 returnCode:(NSInteger)returnCode | 106 returnCode:(NSInteger)returnCode |
107 context:(void*)context { | 107 context:(void*)context { |
108 net::X509Certificate* cert = NULL; | 108 net::X509Certificate* cert = NULL; |
109 if (returnCode == NSFileHandlingPanelOKButton) { | 109 if (returnCode == NSFileHandlingPanelOKButton) { |
110 CFRange range = CFRangeMake(0, CFArrayGetCount(identities_)); | 110 CFRange range = CFRangeMake(0, CFArrayGetCount(identities_)); |
111 CFIndex index = | 111 CFIndex index = |
112 CFArrayGetFirstIndexOfValue(identities_, range, [panel_ identity]); | 112 CFArrayGetFirstIndexOfValue(identities_, range, [panel_ identity]); |
113 if (index != -1) | 113 if (index != -1) |
114 cert = certificates_[index]; | 114 cert = certificates_[index].get(); |
115 else | 115 else |
116 NOTREACHED(); | 116 NOTREACHED(); |
117 } | 117 } |
118 | 118 |
119 // Finally, tell the backend which identity (or none) the user selected. | 119 // Finally, tell the backend which identity (or none) the user selected. |
120 observer_->StopObserving(); | 120 observer_->StopObserving(); |
121 observer_->CertificateSelected(cert); | 121 observer_->CertificateSelected(cert); |
122 | 122 |
123 if (!closePending_) | 123 if (!closePending_) |
124 constrainedWindow_->CloseWebContentsModalDialog(); | 124 constrainedWindow_->CloseWebContentsModalDialog(); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 // NOOP | 224 // NOOP |
225 } | 225 } |
226 | 226 |
227 - (void)onConstrainedWindowClosed { | 227 - (void)onConstrainedWindowClosed { |
228 panel_.reset(); | 228 panel_.reset(); |
229 constrainedWindow_.reset(); | 229 constrainedWindow_.reset(); |
230 [self release]; | 230 [self release]; |
231 } | 231 } |
232 | 232 |
233 @end | 233 @end |
OLD | NEW |