| 676 | } |
| 677 | |
| 678 | HRESULT BrowserWindow::HandleTabSecurityUpdate(size_t tabId, ICoreWebView2* webview, ICoreWebView2DevToolsProtocolEventReceivedEventArgs* args) |
| 679 | { |
| 680 | wil::unique_cotaskmem_string jsonArgs; |
| 681 | RETURN_IF_FAILED(args->get_ParameterObjectAsJson(&jsonArgs)); |
| 682 | web::json::value securityEvent = web::json::value::parse(jsonArgs.get()); |
| 683 | |
| 684 | web::json::value jsonObj = web::json::value::parse(L"{}"); |
| 685 | jsonObj[L"message"] = web::json::value(MG_SECURITY_UPDATE); |
| 686 | jsonObj[L"args"] = web::json::value::parse(L"{}"); |
| 687 | jsonObj[L"args"][L"tabId"] = web::json::value::number(tabId); |
| 688 | jsonObj[L"args"][L"state"] = securityEvent.at(L"securityState"); |
| 689 | |
| 690 | return PostJsonToWebView(jsonObj, m_controlsWebView.Get()); |
| 691 | } |
| 692 | |
| 693 | void BrowserWindow::HandleTabCreated(size_t tabId, bool shouldBeActive) |
| 694 | { |