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

LibWeb: Add a shared WebViewHooks base class for both web view widgets

This will make it easier for Browser to share code between both views.
This commit is contained in:
Andreas Kling 2020-07-06 21:18:16 +02:00
parent 7a7e39c7af
commit 49b9a0a665
5 changed files with 60 additions and 21 deletions

View file

@ -26,12 +26,16 @@
#pragma once
#include <AK/URL.h>
#include <LibGUI/ScrollableWidget.h>
#include <LibGUI/Widget.h>
#include <LibWeb/WebViewHooks.h>
class WebContentClient;
class WebContentView final : public GUI::ScrollableWidget {
class WebContentView final
: public GUI::ScrollableWidget
, public Web::WebViewHooks {
C_OBJECT(WebContentView);
public:
@ -39,11 +43,6 @@ public:
void load(const URL&);
Function<void(const String&)> on_title_change;
Function<void(const URL&)> on_link_hover;
Function<void(const URL&, const String& target, unsigned modifiers)> on_link_click;
Function<void(const URL&, const String& target, unsigned modifiers)> on_link_middle_click;
void notify_server_did_layout(Badge<WebContentClient>, const Gfx::IntSize& content_size);
void notify_server_did_paint(Badge<WebContentClient>, i32 shbuf_id);
void notify_server_did_invalidate_content_rect(Badge<WebContentClient>, const Gfx::IntRect&);