WebContent: Plumb link clicks to the WebContentView :^)

You can now react to links being clicked via the on_link_click hook.
This commit is contained in:
Andreas Kling 2020-07-06 20:01:46 +02:00
parent fd65a24834
commit 32243e1df2
Notes: sideshowbarker 2024-07-19 05:06:18 +09:00
8 changed files with 48 additions and 1 deletions

View file

@ -137,6 +137,18 @@ void WebContentView::notify_server_did_unhover_link(Badge<WebContentClient>)
on_link_hover({});
}
void WebContentView::notify_server_did_click_link(Badge<WebContentClient>, const URL& url, const String& target, unsigned int modifiers)
{
if (on_link_click)
on_link_click(url, target, modifiers);
}
void WebContentView::notify_server_did_middle_click_link(Badge<WebContentClient>, const URL& url, const String& target, unsigned int modifiers)
{
if (on_link_middle_click)
on_link_middle_click(url, target, modifiers);
}
void WebContentView::did_scroll()
{
client().post_message(Messages::WebContentServer::SetViewportRect(visible_content_rect()));