| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 NSString* message = l10n_util::GetNSStringF( | 170 NSString* message = l10n_util::GetNSStringF( |
| 171 IDS_CLIENT_CERT_DIALOG_TEXT, | 171 IDS_CLIENT_CERT_DIALOG_TEXT, |
| 172 ASCIIToUTF16(certRequestInfo_->host_and_port)); | 172 ASCIIToUTF16(certRequestInfo_->host_and_port)); |
| 173 | 173 |
| 174 // Create and set up a system choose-identity panel. | 174 // Create and set up a system choose-identity panel. |
| 175 SFChooseIdentityPanel* panel = [[SFChooseIdentityPanel alloc] init]; | 175 SFChooseIdentityPanel* panel = [[SFChooseIdentityPanel alloc] init]; |
| 176 [panel setInformativeText:message]; | 176 [panel setInformativeText:message]; |
| 177 [panel setDefaultButtonTitle:l10n_util::GetNSString(IDS_OK)]; | 177 [panel setDefaultButtonTitle:l10n_util::GetNSString(IDS_OK)]; |
| 178 [panel setAlternateButtonTitle:l10n_util::GetNSString(IDS_CANCEL)]; | 178 [panel setAlternateButtonTitle:l10n_util::GetNSString(IDS_CANCEL)]; |
| 179 SecPolicyRef sslPolicy; | 179 SecPolicyRef sslPolicy; |
| 180 if (net::X509Certificate::CreateSSLClientPolicy(&sslPolicy) == noErr) { | 180 if (net::X509Certificate::CreateSSLPolicy(false, std::string(), |
| 181 &sslPolicy) == noErr) { |
| 181 [panel setPolicies:(id)sslPolicy]; | 182 [panel setPolicies:(id)sslPolicy]; |
| 182 CFRelease(sslPolicy); | 183 CFRelease(sslPolicy); |
| 183 } | 184 } |
| 184 | 185 |
| 185 window_ = | 186 window_ = |
| 186 parent->CreateConstrainedDialog(new ConstrainedSFChooseIdentityPanel( | 187 parent->CreateConstrainedDialog(new ConstrainedSFChooseIdentityPanel( |
| 187 panel, self, | 188 panel, self, |
| 188 @selector(sheetDidEnd:returnCode:context:), | 189 @selector(sheetDidEnd:returnCode:context:), |
| 189 identities_, title)); | 190 identities_, title)); |
| 190 // Note: SFChooseIdentityPanel does not take a reference to itself while the | 191 // Note: SFChooseIdentityPanel does not take a reference to itself while the |
| 191 // sheet is open. Don't release the ownership claim until the sheet has ended | 192 // sheet is open. Don't release the ownership claim until the sheet has ended |
| 192 // in |-sheetDidEnd:returnCode:context:|. | 193 // in |-sheetDidEnd:returnCode:context:|. |
| 193 } | 194 } |
| 194 | 195 |
| 195 @end | 196 @end |
| OLD | NEW |