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/certificate_viewer.h" | 5 #include "chrome/browser/certificate_viewer.h" |
6 | 6 |
7 #include <Security/Security.h> | 7 #include <Security/Security.h> |
8 #include <SecurityInterface/SFCertificatePanel.h> | 8 #include <SecurityInterface/SFCertificatePanel.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/mac/foundation_util.h" | 12 #include "base/mac/foundation_util.h" |
13 #include "base/mac/scoped_cftyperef.h" | 13 #include "base/mac/scoped_cftyperef.h" |
14 #include "net/base/x509_certificate.h" | 14 #include "net/cert/x509_certificate.h" |
15 #include "net/base/x509_util_mac.h" | 15 #include "net/cert/x509_util_mac.h" |
16 | 16 |
17 void ShowCertificateViewer(content::WebContents* web_contents, | 17 void ShowCertificateViewer(content::WebContents* web_contents, |
18 gfx::NativeWindow parent, | 18 gfx::NativeWindow parent, |
19 net::X509Certificate* cert) { | 19 net::X509Certificate* cert) { |
20 base::mac::ScopedCFTypeRef<CFArrayRef> cert_chain( | 20 base::mac::ScopedCFTypeRef<CFArrayRef> cert_chain( |
21 cert->CreateOSCertChainForCert()); | 21 cert->CreateOSCertChainForCert()); |
22 NSArray* certificates = base::mac::CFToNSCast(cert_chain.get()); | 22 NSArray* certificates = base::mac::CFToNSCast(cert_chain.get()); |
23 | 23 |
24 // Explicitly disable revocation checking, regardless of user preferences | 24 // Explicitly disable revocation checking, regardless of user preferences |
25 // or system settings. The behaviour of SFCertificatePanel is to call | 25 // or system settings. The behaviour of SFCertificatePanel is to call |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 SFCertificatePanel* panel = [[SFCertificatePanel alloc] init]; | 61 SFCertificatePanel* panel = [[SFCertificatePanel alloc] init]; |
62 [panel setPolicies:(id)policies.get()]; | 62 [panel setPolicies:(id)policies.get()]; |
63 [panel beginSheetForWindow:parent | 63 [panel beginSheetForWindow:parent |
64 modalDelegate:nil | 64 modalDelegate:nil |
65 didEndSelector:NULL | 65 didEndSelector:NULL |
66 contextInfo:NULL | 66 contextInfo:NULL |
67 certificates:certificates | 67 certificates:certificates |
68 showGroup:YES]; | 68 showGroup:YES]; |
69 // The SFCertificatePanel releases itself when the sheet is dismissed. | 69 // The SFCertificatePanel releases itself when the sheet is dismissed. |
70 } | 70 } |
OLD | NEW |