mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
Ladybird: Handle close event in WebContentView
This commit is contained in:
parent
cc41233be4
commit
59752807c4
|
@ -64,6 +64,10 @@ Tab::Tab(BrowserWindow* window, StringView webdriver_content_ipc_path)
|
||||||
m_toolbar->addAction(m_home_action);
|
m_toolbar->addAction(m_home_action);
|
||||||
m_toolbar->addWidget(m_location_edit);
|
m_toolbar->addWidget(m_location_edit);
|
||||||
|
|
||||||
|
QObject::connect(m_view, &WebContentView::close, [this] {
|
||||||
|
m_window->close_tab(tab_index());
|
||||||
|
});
|
||||||
|
|
||||||
QObject::connect(m_view, &WebContentView::link_hovered, [this](QString const& title) {
|
QObject::connect(m_view, &WebContentView::link_hovered, [this](QString const& title) {
|
||||||
m_hover_label->setText(title);
|
m_hover_label->setText(title);
|
||||||
update_hover_label();
|
update_hover_label();
|
||||||
|
|
|
@ -966,6 +966,7 @@ void WebContentView::notify_server_did_set_cookie(Badge<WebContentClient>, AK::U
|
||||||
|
|
||||||
void WebContentView::notify_server_did_close_browsing_context(Badge<WebContentClient>)
|
void WebContentView::notify_server_did_close_browsing_context(Badge<WebContentClient>)
|
||||||
{
|
{
|
||||||
|
emit close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContentView::notify_server_did_update_cookie(Badge<WebContentClient>, Web::Cookie::Cookie const& cookie)
|
void WebContentView::notify_server_did_update_cookie(Badge<WebContentClient>, Web::Cookie::Cookie const& cookie)
|
||||||
|
|
|
@ -49,6 +49,7 @@ public:
|
||||||
explicit WebContentView(StringView webdriver_content_ipc_path);
|
explicit WebContentView(StringView webdriver_content_ipc_path);
|
||||||
virtual ~WebContentView() override;
|
virtual ~WebContentView() override;
|
||||||
|
|
||||||
|
Function<void()> on_close;
|
||||||
Function<void(Gfx::IntPoint screen_position)> on_context_menu_request;
|
Function<void(Gfx::IntPoint screen_position)> on_context_menu_request;
|
||||||
Function<void(const AK::URL&, DeprecatedString const& target, unsigned modifiers)> on_link_click;
|
Function<void(const AK::URL&, DeprecatedString const& target, unsigned modifiers)> on_link_click;
|
||||||
Function<void(const AK::URL&, Gfx::IntPoint screen_position)> on_link_context_menu_request;
|
Function<void(const AK::URL&, Gfx::IntPoint screen_position)> on_link_context_menu_request;
|
||||||
|
@ -154,6 +155,7 @@ public:
|
||||||
virtual void notify_server_did_finish_handling_input_event(bool event_was_accepted) override;
|
virtual void notify_server_did_finish_handling_input_event(bool event_was_accepted) override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
void close();
|
||||||
void link_hovered(QString, int timeout = 0);
|
void link_hovered(QString, int timeout = 0);
|
||||||
void link_unhovered();
|
void link_unhovered();
|
||||||
void back_mouse_button();
|
void back_mouse_button();
|
||||||
|
|
Loading…
Reference in a new issue