mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
Ladybird: Handle close event in WebContentView
This commit is contained in:
parent
cc41233be4
commit
59752807c4
3 changed files with 7 additions and 0 deletions
|
@ -64,6 +64,10 @@ Tab::Tab(BrowserWindow* window, StringView webdriver_content_ipc_path)
|
|||
m_toolbar->addAction(m_home_action);
|
||||
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) {
|
||||
m_hover_label->setText(title);
|
||||
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>)
|
||||
{
|
||||
emit close();
|
||||
}
|
||||
|
||||
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);
|
||||
virtual ~WebContentView() override;
|
||||
|
||||
Function<void()> on_close;
|
||||
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&, 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;
|
||||
|
||||
signals:
|
||||
void close();
|
||||
void link_hovered(QString, int timeout = 0);
|
||||
void link_unhovered();
|
||||
void back_mouse_button();
|
||||
|
|
Loading…
Add table
Reference in a new issue