This source file includes following definitions.
- OpenConnectionDialogCallback
- ShowNetworkProxySettings
- ShowManageSSLCertificates
#include "chrome/browser/ui/webui/options/advanced_options_utils.h"
#include <windows.h>
#include <cryptuiapi.h>
#pragma comment(lib, "cryptui.lib")
#include <shellapi.h>
#include "base/bind.h"
#include "base/path_service.h"
#include "base/threading/thread.h"
#include "chrome/browser/browser_process.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "ui/views/win/hwnd_util.h"
using content::BrowserThread;
using content::WebContents;
namespace options {
void OpenConnectionDialogCallback() {
base::FilePath rundll32;
PathService::Get(base::DIR_SYSTEM, &rundll32);
rundll32 = rundll32.AppendASCII("rundll32.exe");
base::FilePath shell32dll;
PathService::Get(base::DIR_SYSTEM, &shell32dll);
shell32dll = shell32dll.AppendASCII("shell32.dll");
base::FilePath inetcpl;
PathService::Get(base::DIR_SYSTEM, &inetcpl);
inetcpl = inetcpl.AppendASCII("inetcpl.cpl,,4");
std::wstring args(shell32dll.value());
args.append(L",Control_RunDLL ");
args.append(inetcpl.value());
ShellExecute(NULL, L"open", rundll32.value().c_str(), args.c_str(), NULL,
SW_SHOWNORMAL);
}
void AdvancedOptionsUtilities::ShowNetworkProxySettings(
WebContents* web_contents) {
DCHECK(BrowserThread::IsMessageLoopValid(BrowserThread::FILE));
BrowserThread::PostTask(BrowserThread::FILE,
FROM_HERE,
base::Bind(&OpenConnectionDialogCallback));
}
void AdvancedOptionsUtilities::ShowManageSSLCertificates(
WebContents* web_contents) {
CRYPTUI_CERT_MGR_STRUCT cert_mgr = { 0 };
cert_mgr.dwSize = sizeof(CRYPTUI_CERT_MGR_STRUCT);
cert_mgr.hwndParent = views::HWNDForNativeWindow(
web_contents->GetView()->GetTopLevelNativeWindow());
::CryptUIDlgCertMgr(&cert_mgr);
}
}