Skip to content

Commit

Permalink
feat: expose onJsdialog
Browse files Browse the repository at this point in the history
  • Loading branch information
TrafalgarSX committed Aug 18, 2024
1 parent fb75a3f commit 80d61b3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
13 changes: 13 additions & 0 deletions include/CefViewBrowserClientDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ class CefViewBrowserClientDelegateInterface
};
#pragma endregion

#pragma region JSDialogHandler
virtual bool OnJSDialog(CefRefPtr<CefBrowser> browser,
const CefString& origin_url,
CefJSDialogHandler::JSDialogType dialog_type,
const CefString& message_text,
const CefString& default_prompt_text,
CefRefPtr<CefJSDialogCallback> callback,
bool& suppress_message)
{
return false;
}
#pragma endregion

// display handler
#pragma region DisplayHandler
virtual void addressChanged(CefRefPtr<CefBrowser>& browser, int64_t frameId, const std::string& url) = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ CefViewBrowserClient::OnJSDialog(CefRefPtr<CefBrowser> browser,
{
CEF_REQUIRE_UI_THREAD();

auto delegate = client_delegate_.lock();
if (delegate)
return delegate->OnJSDialog(
browser, origin_url, dialog_type, message_text, default_prompt_text, callback, suppress_message);

return false;
}

Expand Down

0 comments on commit 80d61b3

Please sign in to comment.