mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:27:35 +00:00
Ladybird+LibWebView: Move CookieJar, Database, and History to LibWebView
These classes are used as-is in all chromes. Move them to LibWebView so that non-Serenity chromes don't have to awkwardly reach into its headers and sources.
This commit is contained in:
parent
7d313ff83d
commit
5c5a00dd3a
28 changed files with 76 additions and 107 deletions
|
@ -14,10 +14,10 @@
|
|||
#include "StringUtils.h"
|
||||
#include "WebContentView.h"
|
||||
#include <AK/TypeCasts.h>
|
||||
#include <Browser/CookieJar.h>
|
||||
#include <Ladybird/Utilities.h>
|
||||
#include <LibWeb/CSS/PreferredColorScheme.h>
|
||||
#include <LibWeb/Loader/ResourceLoader.h>
|
||||
#include <LibWebView/CookieJar.h>
|
||||
#include <QAction>
|
||||
#include <QActionGroup>
|
||||
#include <QClipboard>
|
||||
|
@ -39,7 +39,7 @@ static QIcon const& app_icon()
|
|||
return icon;
|
||||
}
|
||||
|
||||
BrowserWindow::BrowserWindow(Optional<URL> const& initial_url, Browser::CookieJar& cookie_jar, StringView webdriver_content_ipc_path, WebView::EnableCallgrindProfiling enable_callgrind_profiling, UseLagomNetworking use_lagom_networking)
|
||||
BrowserWindow::BrowserWindow(Optional<URL> const& initial_url, WebView::CookieJar& cookie_jar, StringView webdriver_content_ipc_path, WebView::EnableCallgrindProfiling enable_callgrind_profiling, UseLagomNetworking use_lagom_networking)
|
||||
: m_cookie_jar(cookie_jar)
|
||||
, m_webdriver_content_ipc_path(webdriver_content_ipc_path)
|
||||
, m_enable_callgrind_profiling(enable_callgrind_profiling)
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "Tab.h"
|
||||
#include <LibCore/Forward.h>
|
||||
#include <LibWeb/HTML/ActivateTab.h>
|
||||
#include <LibWebView/Forward.h>
|
||||
#include <QIcon>
|
||||
#include <QLineEdit>
|
||||
#include <QMainWindow>
|
||||
|
@ -17,10 +18,6 @@
|
|||
#include <QTabWidget>
|
||||
#include <QToolBar>
|
||||
|
||||
namespace Browser {
|
||||
class CookieJar;
|
||||
}
|
||||
|
||||
namespace Ladybird {
|
||||
|
||||
class WebContentView;
|
||||
|
@ -28,7 +25,7 @@ class WebContentView;
|
|||
class BrowserWindow : public QMainWindow {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit BrowserWindow(Optional<URL> const& initial_url, Browser::CookieJar&, StringView webdriver_content_ipc_path, WebView::EnableCallgrindProfiling, UseLagomNetworking);
|
||||
explicit BrowserWindow(Optional<URL> const& initial_url, WebView::CookieJar&, StringView webdriver_content_ipc_path, WebView::EnableCallgrindProfiling, UseLagomNetworking);
|
||||
|
||||
WebContentView& view() const { return m_current_tab->view(); }
|
||||
|
||||
|
@ -119,7 +116,7 @@ private:
|
|||
OwnPtr<QAction> m_view_source_action {};
|
||||
OwnPtr<QAction> m_inspect_dom_node_action {};
|
||||
|
||||
Browser::CookieJar& m_cookie_jar;
|
||||
WebView::CookieJar& m_cookie_jar;
|
||||
|
||||
StringView m_webdriver_content_ipc_path;
|
||||
WebView::EnableCallgrindProfiling m_enable_callgrind_profiling;
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "Settings.h"
|
||||
#include "StringUtils.h"
|
||||
#include "TVGIconEngine.h"
|
||||
#include <Browser/History.h>
|
||||
#include <LibGfx/ImageFormats/BMPWriter.h>
|
||||
#include <LibGfx/Painter.h>
|
||||
#include <LibWebView/SourceHighlighter.h>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "LocationEdit.h"
|
||||
#include "WebContentView.h"
|
||||
#include <Browser/History.h>
|
||||
#include <LibWebView/History.h>
|
||||
#include <QBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
|
@ -82,7 +82,7 @@ private:
|
|||
LocationEdit* m_location_edit { nullptr };
|
||||
WebContentView* m_view { nullptr };
|
||||
BrowserWindow* m_window { nullptr };
|
||||
Browser::History m_history;
|
||||
WebView::History m_history;
|
||||
QString m_title;
|
||||
QLabel* m_hover_label { nullptr };
|
||||
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
#include "Settings.h"
|
||||
#include "WebContentView.h"
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <Browser/CookieJar.h>
|
||||
#include <Browser/Database.h>
|
||||
#include <Ladybird/HelperProcess.h>
|
||||
#include <Ladybird/Utilities.h>
|
||||
#include <LibCore/ArgsParser.h>
|
||||
|
@ -21,6 +19,8 @@
|
|||
#include <LibGfx/Font/FontDatabase.h>
|
||||
#include <LibMain/Main.h>
|
||||
#include <LibSQL/SQLClient.h>
|
||||
#include <LibWebView/CookieJar.h>
|
||||
#include <LibWebView/Database.h>
|
||||
#include <QApplication>
|
||||
|
||||
namespace Ladybird {
|
||||
|
@ -95,15 +95,15 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
return url;
|
||||
};
|
||||
|
||||
RefPtr<Browser::Database> database;
|
||||
RefPtr<WebView::Database> database;
|
||||
|
||||
if (enable_sql_database) {
|
||||
auto sql_server_paths = TRY(get_paths_for_helper_process("SQLServer"sv));
|
||||
auto sql_client = TRY(SQL::SQLClient::launch_server_and_create_client(move(sql_server_paths)));
|
||||
database = TRY(Browser::Database::create(move(sql_client)));
|
||||
database = TRY(WebView::Database::create(move(sql_client)));
|
||||
}
|
||||
|
||||
auto cookie_jar = database ? TRY(Browser::CookieJar::create(*database)) : Browser::CookieJar::create();
|
||||
auto cookie_jar = database ? TRY(WebView::CookieJar::create(*database)) : WebView::CookieJar::create();
|
||||
|
||||
Optional<URL> initial_url;
|
||||
if (auto url = TRY(get_formatted_url(raw_url)); url.is_valid())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue