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/ui/webui/options/advanced_options_utils.h" | 5 #include "chrome/browser/ui/webui/options/advanced_options_utils.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 #include <shellapi.h> | 10 #include <shellapi.h> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
16 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
17 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
18 #include "content/public/browser/web_contents_view.h" | 18 #include "content/public/browser/web_contents_view.h" |
| 19 #include "ui/views/win/hwnd_util.h" |
19 | 20 |
20 using content::BrowserThread; | 21 using content::BrowserThread; |
21 using content::WebContents; | 22 using content::WebContents; |
22 | 23 |
23 namespace options { | 24 namespace options { |
24 | 25 |
25 // Callback that opens the Internet Options control panel dialog with the | 26 // Callback that opens the Internet Options control panel dialog with the |
26 // Connections tab selected. | 27 // Connections tab selected. |
27 void OpenConnectionDialogCallback() { | 28 void OpenConnectionDialogCallback() { |
28 // Using rundll32 seems better than LaunchConnectionDialog which causes a | 29 // Using rundll32 seems better than LaunchConnectionDialog which causes a |
(...skipping 24 matching lines...) Expand all Loading... |
53 DCHECK(BrowserThread::IsMessageLoopValid(BrowserThread::FILE)); | 54 DCHECK(BrowserThread::IsMessageLoopValid(BrowserThread::FILE)); |
54 BrowserThread::PostTask(BrowserThread::FILE, | 55 BrowserThread::PostTask(BrowserThread::FILE, |
55 FROM_HERE, | 56 FROM_HERE, |
56 base::Bind(&OpenConnectionDialogCallback)); | 57 base::Bind(&OpenConnectionDialogCallback)); |
57 } | 58 } |
58 | 59 |
59 void AdvancedOptionsUtilities::ShowManageSSLCertificates( | 60 void AdvancedOptionsUtilities::ShowManageSSLCertificates( |
60 WebContents* web_contents) { | 61 WebContents* web_contents) { |
61 CRYPTUI_CERT_MGR_STRUCT cert_mgr = { 0 }; | 62 CRYPTUI_CERT_MGR_STRUCT cert_mgr = { 0 }; |
62 cert_mgr.dwSize = sizeof(CRYPTUI_CERT_MGR_STRUCT); | 63 cert_mgr.dwSize = sizeof(CRYPTUI_CERT_MGR_STRUCT); |
63 cert_mgr.hwndParent = | 64 cert_mgr.hwndParent = views::HWNDForNativeWindow( |
64 #if defined(USE_AURA) | 65 web_contents->GetView()->GetTopLevelNativeWindow()); |
65 NULL; | |
66 #else | |
67 web_contents->GetView()->GetTopLevelNativeWindow(); | |
68 #endif | |
69 ::CryptUIDlgCertMgr(&cert_mgr); | 66 ::CryptUIDlgCertMgr(&cert_mgr); |
70 } | 67 } |
71 | 68 |
72 } // namespace options | 69 } // namespace options |
OLD | NEW |