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

LibWeb+WebContent: Support image context menus in OOPWV

You can now right-click images in web content and get a context menu.
This commit is contained in:
Andreas Kling 2021-04-11 16:49:25 +02:00
parent e43fba0c58
commit 54cd8dfc4d
7 changed files with 22 additions and 2 deletions

View file

@ -322,6 +322,12 @@ void OutOfProcessWebView::notify_server_did_request_link_context_menu(Badge<WebC
on_link_context_menu_request(url, screen_relative_rect().location().translated(to_widget_position(content_position)));
}
void OutOfProcessWebView::notify_server_did_request_image_context_menu(Badge<WebContentClient>, const Gfx::IntPoint& content_position, const URL& url, const String&, unsigned, const Gfx::ShareableBitmap& bitmap)
{
if (on_image_context_menu_request)
on_image_context_menu_request(url, screen_relative_rect().location().translated(to_widget_position(content_position)), bitmap);
}
void OutOfProcessWebView::notify_server_did_request_alert(Badge<WebContentClient>, const String& message)
{
GUI::MessageBox::show(window(), message, "Alert", GUI::MessageBox::Type::Information);