From facaf953eb9e4f1d48b5a156c05dc8924b688318 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Thu, 1 Aug 2024 13:38:21 -0400 Subject: [PATCH] LibWeb+WebContent: Add a page hook to invoke the did-click-link IPC --- Userland/Libraries/LibWeb/Page/Page.h | 1 + Userland/Services/WebContent/PageClient.cpp | 5 +++++ Userland/Services/WebContent/PageClient.h | 1 + 3 files changed, 7 insertions(+) diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h index 20c5f12d132..add8aa233be 100644 --- a/Userland/Libraries/LibWeb/Page/Page.h +++ b/Userland/Libraries/LibWeb/Page/Page.h @@ -317,6 +317,7 @@ public: virtual void page_did_request_link_context_menu(CSSPixelPoint, URL::URL const&, [[maybe_unused]] ByteString const& target, [[maybe_unused]] unsigned modifiers) { } virtual void page_did_request_image_context_menu(CSSPixelPoint, URL::URL const&, [[maybe_unused]] ByteString const& target, [[maybe_unused]] unsigned modifiers, Gfx::Bitmap const*) { } virtual void page_did_request_media_context_menu(CSSPixelPoint, [[maybe_unused]] ByteString const& target, [[maybe_unused]] unsigned modifiers, Page::MediaContextMenu) { } + virtual void page_did_click_link(URL::URL const&, [[maybe_unused]] ByteString const& target, [[maybe_unused]] unsigned modifiers) { } virtual void page_did_middle_click_link(URL::URL const&, [[maybe_unused]] ByteString const& target, [[maybe_unused]] unsigned modifiers) { } virtual void page_did_request_tooltip_override(CSSPixelPoint, ByteString const&) { } virtual void page_did_stop_tooltip_override() { } diff --git a/Userland/Services/WebContent/PageClient.cpp b/Userland/Services/WebContent/PageClient.cpp index c7c1a76bdeb..b9a52432d64 100644 --- a/Userland/Services/WebContent/PageClient.cpp +++ b/Userland/Services/WebContent/PageClient.cpp @@ -324,6 +324,11 @@ void PageClient::page_did_unhover_link() client().async_did_unhover_link(m_id); } +void PageClient::page_did_click_link(URL::URL const& url, ByteString const& target, unsigned modifiers) +{ + client().async_did_click_link(m_id, url, target, modifiers); +} + void PageClient::page_did_middle_click_link(URL::URL const& url, ByteString const& target, unsigned modifiers) { client().async_did_middle_click_link(m_id, url, target, modifiers); diff --git a/Userland/Services/WebContent/PageClient.h b/Userland/Services/WebContent/PageClient.h index f3861b8716d..2220d62df84 100644 --- a/Userland/Services/WebContent/PageClient.h +++ b/Userland/Services/WebContent/PageClient.h @@ -122,6 +122,7 @@ private: virtual void page_did_leave_tooltip_area() override; virtual void page_did_hover_link(URL::URL const&) override; virtual void page_did_unhover_link() override; + virtual void page_did_click_link(URL::URL const&, ByteString const& target, unsigned modifiers) override; virtual void page_did_middle_click_link(URL::URL const&, ByteString const& target, unsigned modifiers) override; virtual void page_did_request_context_menu(Web::CSSPixelPoint) override; virtual void page_did_request_link_context_menu(Web::CSSPixelPoint, URL::URL const&, ByteString const& target, unsigned modifiers) override;