mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:17:45 +00:00
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:
parent
fd65a24834
commit
32243e1df2
8 changed files with 48 additions and 1 deletions
|
@ -144,4 +144,14 @@ void PageHost::page_did_unhover_link()
|
|||
m_client.post_message(Messages::WebContentClient::DidUnhoverLink());
|
||||
}
|
||||
|
||||
void PageHost::page_did_click_link(const URL& url, const String& target, unsigned modifiers)
|
||||
{
|
||||
m_client.post_message(Messages::WebContentClient::DidClickLink(url, target, modifiers));
|
||||
}
|
||||
|
||||
void PageHost::page_did_middle_click_link(const URL& url, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers)
|
||||
{
|
||||
m_client.post_message(Messages::WebContentClient::DidMiddleClickLink(url, target, modifiers));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public:
|
|||
void set_viewport_rect(const Gfx::IntRect&);
|
||||
|
||||
private:
|
||||
// ^PageHost
|
||||
// ^PageClient
|
||||
virtual Gfx::Palette palette() const override;
|
||||
virtual void page_did_invalidate(const Gfx::IntRect&) override;
|
||||
virtual void page_did_change_selection() override;
|
||||
|
@ -58,6 +58,8 @@ private:
|
|||
virtual void page_did_request_scroll_into_view(const Gfx::IntRect&) override;
|
||||
virtual void page_did_hover_link(const URL&) override;
|
||||
virtual void page_did_unhover_link() override;
|
||||
virtual void page_did_click_link(const URL&, const String& target, unsigned modifiers) override;
|
||||
virtual void page_did_middle_click_link(const URL&, const String& target, unsigned modifiers) override;
|
||||
|
||||
explicit PageHost(ClientConnection&);
|
||||
|
||||
|
|
|
@ -9,4 +9,6 @@ endpoint WebContentClient = 90
|
|||
DidRequestScrollIntoView(Gfx::IntRect rect) =|
|
||||
DidHoverLink(URL url) =|
|
||||
DidUnhoverLink() =|
|
||||
DidClickLink(URL url, String target, unsigned modifiers) =|
|
||||
DidMiddleClickLink(URL url, String target, unsigned modifiers) =|
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue