2020-06-17 18:31:42 +03:00
|
|
|
/*
|
2021-02-10 10:48:28 +03:00
|
|
|
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
2020-06-17 18:31:42 +03:00
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-06-17 18:31:42 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/HashMap.h>
|
|
|
|
#include <LibIPC/ServerConnection.h>
|
2021-04-15 17:36:20 +03:00
|
|
|
#include <LibWeb/Cookie/ParsedCookie.h>
|
2020-06-17 18:31:42 +03:00
|
|
|
#include <WebContent/WebContentClientEndpoint.h>
|
|
|
|
#include <WebContent/WebContentServerEndpoint.h>
|
|
|
|
|
2020-08-24 14:03:18 +03:00
|
|
|
namespace Web {
|
|
|
|
|
2020-08-17 17:20:47 +03:00
|
|
|
class OutOfProcessWebView;
|
2020-06-17 18:31:42 +03:00
|
|
|
|
2021-01-30 20:20:40 +03:00
|
|
|
class WebContentClient final
|
2020-06-17 18:31:42 +03:00
|
|
|
: public IPC::ServerConnection<WebContentClientEndpoint, WebContentServerEndpoint>
|
|
|
|
, public WebContentClientEndpoint {
|
|
|
|
C_OBJECT(WebContentClient);
|
|
|
|
|
|
|
|
public:
|
2021-01-30 20:20:40 +03:00
|
|
|
Function<void()> on_web_content_process_crash;
|
|
|
|
|
2020-06-17 18:31:42 +03:00
|
|
|
private:
|
2020-08-17 17:20:47 +03:00
|
|
|
WebContentClient(OutOfProcessWebView&);
|
2020-06-17 18:31:42 +03:00
|
|
|
|
2021-01-30 20:20:40 +03:00
|
|
|
virtual void die() override;
|
|
|
|
|
2021-05-02 20:54:34 +03:00
|
|
|
virtual void did_paint(Gfx::IntRect const&, i32) override;
|
|
|
|
virtual void did_finish_loading(URL const&) override;
|
|
|
|
virtual void did_invalidate_content_rect(Gfx::IntRect const&) override;
|
|
|
|
virtual void did_change_selection() override;
|
|
|
|
virtual void did_request_cursor_change(i32) override;
|
|
|
|
virtual void did_layout(Gfx::IntSize const&) override;
|
|
|
|
virtual void did_change_title(String const&) override;
|
|
|
|
virtual void did_request_scroll(int) override;
|
|
|
|
virtual void did_request_scroll_into_view(Gfx::IntRect const&) override;
|
|
|
|
virtual void did_enter_tooltip_area(Gfx::IntPoint const&, String const&) override;
|
|
|
|
virtual void did_leave_tooltip_area() override;
|
|
|
|
virtual void did_hover_link(URL const&) override;
|
|
|
|
virtual void did_unhover_link() override;
|
|
|
|
virtual void did_click_link(URL const&, String const&, unsigned) override;
|
|
|
|
virtual void did_middle_click_link(URL const&, String const&, unsigned) override;
|
|
|
|
virtual void did_start_loading(URL const&) override;
|
|
|
|
virtual void did_request_context_menu(Gfx::IntPoint const&) override;
|
|
|
|
virtual void did_request_link_context_menu(Gfx::IntPoint const&, URL const&, String const&, unsigned) override;
|
|
|
|
virtual void did_request_image_context_menu(Gfx::IntPoint const&, URL const&, String const&, unsigned, Gfx::ShareableBitmap const&) override;
|
|
|
|
virtual void did_get_source(URL const&, String const&) override;
|
2021-06-07 18:35:10 +03:00
|
|
|
virtual void did_get_dom_tree(String const&) override;
|
2021-05-03 16:52:56 +03:00
|
|
|
virtual void did_js_console_output(String const&, String const&) override;
|
2021-05-02 20:54:34 +03:00
|
|
|
virtual void did_change_favicon(Gfx::ShareableBitmap const&) override;
|
|
|
|
virtual void did_request_alert(String const&) override;
|
|
|
|
virtual Messages::WebContentClient::DidRequestConfirmResponse did_request_confirm(String const&) override;
|
|
|
|
virtual Messages::WebContentClient::DidRequestPromptResponse did_request_prompt(String const&, String const&) override;
|
|
|
|
virtual Messages::WebContentClient::DidRequestCookieResponse did_request_cookie(URL const&, u8) override;
|
|
|
|
virtual void did_set_cookie(URL const&, Web::Cookie::ParsedCookie const&, u8) override;
|
2020-06-17 18:31:42 +03:00
|
|
|
|
2020-08-17 17:20:47 +03:00
|
|
|
OutOfProcessWebView& m_view;
|
2020-06-17 18:31:42 +03:00
|
|
|
};
|
2020-08-24 14:03:18 +03:00
|
|
|
|
|
|
|
}
|