2022-11-08 12:18:11 -03:00
|
|
|
/*
|
2024-09-29 10:40:17 -03:00
|
|
|
* Copyright (c) 2022-2024, Tim Flynn <trflynn89@ladybird.org>
|
2022-11-08 12:18:11 -03:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
2022-11-14 13:00:31 -03:00
|
|
|
#include <WebDriver/Client.h>
|
|
|
|
|
#include <WebDriver/WebContentConnection.h>
|
2022-11-08 12:18:11 -03:00
|
|
|
|
|
|
|
|
namespace WebDriver {
|
|
|
|
|
|
2025-04-08 17:01:46 -03:00
|
|
|
WebContentConnection::WebContentConnection(NonnullOwnPtr<IPC::Transport> transport)
|
2024-10-22 18:47:33 -03:00
|
|
|
: IPC::ConnectionFromClient<WebDriverClientEndpoint, WebDriverServerEndpoint>(*this, move(transport), 1)
|
2022-11-08 12:18:11 -03:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WebContentConnection::die()
|
|
|
|
|
{
|
2023-03-19 08:08:52 -03:00
|
|
|
if (on_close)
|
|
|
|
|
on_close();
|
2022-11-08 12:18:11 -03:00
|
|
|
}
|
|
|
|
|
|
2025-03-08 14:22:39 -03:00
|
|
|
void WebContentConnection::driver_execution_complete(Web::WebDriver::Response response)
|
2024-10-25 11:28:29 -03:00
|
|
|
{
|
2024-11-01 08:42:21 -03:00
|
|
|
if (on_driver_execution_complete)
|
2025-03-08 14:22:39 -03:00
|
|
|
on_driver_execution_complete(move(response));
|
2024-10-30 21:29:26 -03:00
|
|
|
}
|
|
|
|
|
|
2026-02-11 10:46:07 -03:00
|
|
|
void WebContentConnection::did_set_window_handle(String handle)
|
|
|
|
|
{
|
|
|
|
|
if (on_did_set_window_handle)
|
|
|
|
|
on_did_set_window_handle(move(handle));
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-13 11:06:49 -03:00
|
|
|
void WebContentConnection::did_start_window_replacement(String handle)
|
|
|
|
|
{
|
|
|
|
|
if (on_did_start_window_replacement)
|
|
|
|
|
on_did_start_window_replacement(move(handle));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WebContentConnection::did_close_window(String handle)
|
|
|
|
|
{
|
|
|
|
|
if (on_did_close_window)
|
|
|
|
|
on_did_close_window(move(handle));
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-08 12:18:11 -03:00
|
|
|
}
|