1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

Browser+WebContent+WebDriver: Move [Max,Min]imize Window to WebContent

This also lets us more fully implement the "iconify the window" method,
which requires we block until the document reaches the "hidden" state.
This commit is contained in:
Timothy Flynn 2022-11-09 11:00:53 -05:00 committed by Linus Groh
parent 1c398b32ce
commit 03d0c7a5b6
9 changed files with 75 additions and 86 deletions

View file

@ -58,37 +58,6 @@ void WebDriverConnection::forward()
browser_window->active_tab().go_forward();
}
Messages::WebDriverSessionClient::GetWindowRectResponse WebDriverConnection::get_window_rect()
{
dbgln_if(WEBDRIVER_DEBUG, "WebDriverConnection: get_window_rect");
if (auto browser_window = m_browser_window.strong_ref())
return { browser_window->rect() };
return { {} };
}
void WebDriverConnection::restore_window()
{
dbgln_if(WEBDRIVER_DEBUG, "WebDriverConnection: restore_window");
if (auto browser_window = m_browser_window.strong_ref()) {
browser_window->show();
browser_window->move_to_front();
}
}
void WebDriverConnection::maximize_window()
{
dbgln_if(WEBDRIVER_DEBUG, "WebDriverConnection: maximize_window");
if (auto browser_window = m_browser_window.strong_ref())
browser_window->set_maximized(true);
}
void WebDriverConnection::minimize_window()
{
dbgln_if(WEBDRIVER_DEBUG, "WebDriverConnection: minimize_window");
if (auto browser_window = m_browser_window.strong_ref())
browser_window->set_minimized(true);
}
Messages::WebDriverSessionClient::SerializeSourceResponse WebDriverConnection::serialize_source()
{
dbgln_if(WEBDRIVER_DEBUG, "WebDriverConnection: serialize_source");