1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 15:05:09 +00:00

LibWeb: Make context menus work in WebContentView

As usual, this was just a matter of plumbing the PageClient calls from
the WebContent side over to the WebContentView side. :^)
This commit is contained in:
Andreas Kling 2020-07-07 12:24:29 +02:00
parent 81ea9d1ef6
commit 92374fc942
7 changed files with 40 additions and 0 deletions

View file

@ -162,6 +162,18 @@ void WebContentView::notify_server_did_start_loading(Badge<WebContentClient>, co
on_load_start(url);
}
void WebContentView::notify_server_did_request_context_menu(Badge<WebContentClient>, const Gfx::IntPoint& content_position)
{
if (on_context_menu_request)
on_context_menu_request(screen_relative_rect().location().translated(to_widget_position(content_position)));
}
void WebContentView::notify_server_did_request_link_context_menu(Badge<WebContentClient>, const Gfx::IntPoint& content_position, const URL& url, const String&, unsigned)
{
if (on_link_context_menu_request)
on_link_context_menu_request(url, screen_relative_rect().location().translated(to_widget_position(content_position)));
}
void WebContentView::did_scroll()
{
client().post_message(Messages::WebContentServer::SetViewportRect(visible_content_rect()));