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 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
16 #include "base/task_runner.h" | 16 #include "base/task_runner.h" |
17 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
18 #include "chrome/browser/ui/host_desktop.h" | 18 #include "chrome/browser/ui/host_desktop.h" |
19 #include "net/cert/x509_certificate.h" | 19 #include "net/cert/x509_certificate.h" |
20 #include "ui/aura/window.h" | 20 #include "ui/aura/window.h" |
21 #include "ui/aura/window_tree_host.h" | 21 #include "ui/aura/window_tree_host.h" |
| 22 #include "ui/gfx/host_desktop_type.h" |
22 #include "ui/shell_dialogs/base_shell_dialog_win.h" | 23 #include "ui/shell_dialogs/base_shell_dialog_win.h" |
23 | 24 |
24 namespace { | 25 namespace { |
25 | 26 |
26 // Shows a Windows certificate viewer dialog on a background thread to avoid | 27 // Shows a Windows certificate viewer dialog on a background thread to avoid |
27 // nested message loops. | 28 // nested message loops. |
28 class CertificateViewerDialog : public ui::BaseShellDialogImpl { | 29 class CertificateViewerDialog : public ui::BaseShellDialogImpl { |
29 public: | 30 public: |
30 CertificateViewerDialog() {} | 31 CertificateViewerDialog() {} |
31 | 32 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 if (chrome::GetHostDesktopTypeForNativeWindow(parent) != | 91 if (chrome::GetHostDesktopTypeForNativeWindow(parent) != |
91 ui::HOST_DESKTOP_TYPE_ASH) { | 92 ui::HOST_DESKTOP_TYPE_ASH) { |
92 CertificateViewerDialog* dialog = new CertificateViewerDialog; | 93 CertificateViewerDialog* dialog = new CertificateViewerDialog; |
93 dialog->Show( | 94 dialog->Show( |
94 parent->GetHost()->GetAcceleratedWidget(), cert, | 95 parent->GetHost()->GetAcceleratedWidget(), cert, |
95 base::Bind(&base::DeletePointer<CertificateViewerDialog>, dialog)); | 96 base::Bind(&base::DeletePointer<CertificateViewerDialog>, dialog)); |
96 } else { | 97 } else { |
97 NOTIMPLEMENTED(); | 98 NOTIMPLEMENTED(); |
98 } | 99 } |
99 } | 100 } |
OLD | NEW |