1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 09:27:35 +00:00

Browser+WebContent+WebDriver: Move Delete All Cookies to WebContent

This commit is contained in:
Timothy Flynn 2022-11-11 11:27:08 -05:00 committed by Linus Groh
parent b7f21bb92e
commit ff6055e0a3
9 changed files with 18 additions and 69 deletions

View file

@ -10,8 +10,6 @@
#include "WebDriverConnection.h"
#include "BrowserWindow.h"
#include <AK/Vector.h>
#include <LibWeb/Cookie/Cookie.h>
#include <LibWeb/Cookie/ParsedCookie.h>
#include <LibWebView/WebContentClient.h>
namespace Browser {
@ -58,26 +56,4 @@ void WebDriverConnection::forward()
browser_window->active_tab().go_forward();
}
Messages::WebDriverSessionClient::GetAllCookiesResponse WebDriverConnection::get_all_cookies()
{
dbgln_if(WEBDRIVER_DEBUG, "WebDriverConnection: get_cookies");
if (auto browser_window = m_browser_window.strong_ref()) {
if (browser_window->active_tab().on_get_cookies_entries) {
return { browser_window->active_tab().on_get_cookies_entries() };
}
}
return { {} };
}
void WebDriverConnection::update_cookie(Web::Cookie::Cookie const& cookie)
{
dbgln_if(WEBDRIVER_DEBUG, "WebDriverConnection: update_cookie {}", cookie.name);
if (auto browser_window = m_browser_window.strong_ref()) {
auto& tab = browser_window->active_tab();
if (tab.on_update_cookie) {
tab.on_update_cookie(tab.url(), cookie);
}
}
}
}