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/certificate_viewer.h" | 5 #include "chrome/browser/certificate_viewer.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <cryptuiapi.h> | 8 #include <cryptuiapi.h> |
9 #pragma comment(lib, "cryptui.lib") | 9 #pragma comment(lib, "cryptui.lib") |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 view_info.rghStores = &cert_store; | 38 view_info.rghStores = &cert_store; |
39 BOOL properties_changed; | 39 BOOL properties_changed; |
40 | 40 |
41 // We must allow nested tasks to dispatch so that, e.g. gpu tasks are | 41 // We must allow nested tasks to dispatch so that, e.g. gpu tasks are |
42 // processed for painting. This allows a second window to continue painting | 42 // processed for painting. This allows a second window to continue painting |
43 // while the the certificate dialog is open. | 43 // while the the certificate dialog is open. |
44 base::MessageLoop::ScopedNestableTaskAllower allow( | 44 base::MessageLoop::ScopedNestableTaskAllower allow( |
45 base::MessageLoop::current()); | 45 base::MessageLoop::current()); |
46 // This next call blocks but keeps processing windows messages, making it | 46 // This next call blocks but keeps processing windows messages, making it |
47 // modal to the browser window. | 47 // modal to the browser window. |
48 BOOL rv = ::CryptUIDlgViewCertificate(&view_info, &properties_changed); | 48 ::CryptUIDlgViewCertificate(&view_info, &properties_changed); |
49 | 49 |
50 CertFreeCertificateContext(cert_list); | 50 CertFreeCertificateContext(cert_list); |
51 } | 51 } |
52 | 52 |
53 } // namespace | 53 } // namespace |
54 | 54 |
55 void ShowCertificateViewer(content::WebContents* web_contents, | 55 void ShowCertificateViewer(content::WebContents* web_contents, |
56 gfx::NativeWindow parent, | 56 gfx::NativeWindow parent, |
57 net::X509Certificate* cert) { | 57 net::X509Certificate* cert) { |
58 if (chrome::GetHostDesktopTypeForNativeWindow(parent) != | 58 if (chrome::GetHostDesktopTypeForNativeWindow(parent) != |
59 chrome::HOST_DESKTOP_TYPE_ASH) { | 59 chrome::HOST_DESKTOP_TYPE_ASH) { |
60 ShowCertificateViewerImpl( | 60 ShowCertificateViewerImpl( |
61 web_contents, | 61 web_contents, |
62 parent->GetHost()->GetAcceleratedWidget(), cert); | 62 parent->GetHost()->GetAcceleratedWidget(), cert); |
63 } else { | 63 } else { |
64 NOTIMPLEMENTED(); | 64 NOTIMPLEMENTED(); |
65 } | 65 } |
66 } | 66 } |
OLD | NEW |