| 539 | } |
| 540 | |
| 541 | HRESULT BrowserWindow::HandleTabHistoryUpdate(size_t tabId, ICoreWebView2* webview) |
| 542 | { |
| 543 | wil::unique_cotaskmem_string source; |
| 544 | RETURN_IF_FAILED(webview->get_Source(&source)); |
| 545 | |
| 546 | web::json::value jsonObj = web::json::value::parse(L"{}"); |
| 547 | jsonObj[L"message"] = web::json::value(MG_UPDATE_URI); |
| 548 | jsonObj[L"args"] = web::json::value::parse(L"{}"); |
| 549 | jsonObj[L"args"][L"tabId"] = web::json::value::number(tabId); |
| 550 | jsonObj[L"args"][L"uri"] = web::json::value(source.get()); |
| 551 | |
| 552 | BOOL canGoForward = FALSE; |
| 553 | RETURN_IF_FAILED(webview->get_CanGoForward(&canGoForward)); |
| 554 | jsonObj[L"args"][L"canGoForward"] = web::json::value::boolean(canGoForward); |
| 555 | |
| 556 | BOOL canGoBack = FALSE; |
| 557 | RETURN_IF_FAILED(webview->get_CanGoBack(&canGoBack)); |
| 558 | jsonObj[L"args"][L"canGoBack"] = web::json::value::boolean(canGoBack); |
| 559 | |
| 560 | RETURN_IF_FAILED(PostJsonToWebView(jsonObj, m_controlsWebView.Get())); |
| 561 | |
| 562 | return S_OK; |
| 563 | } |
| 564 | |
| 565 | HRESULT BrowserWindow::HandleTabNavStarting(size_t tabId, ICoreWebView2* webview) |
| 566 | { |