mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 17:28:48 +00:00
LibWebView: Move OutOfProcessWebView to a new LibWebView library
Also moves WebContentClient and the references to the generated IPC descriptions, since they are all components of OutOfProcessWebView. This patch has no functional changes.
This commit is contained in:
parent
31c0022429
commit
dcbbbf5b4a
Notes:
sideshowbarker
2024-07-17 10:54:09 +09:00
Author: https://github.com/Dexesttp
Commit: dcbbbf5b4a
Pull-request: https://github.com/SerenityOS/serenity/pull/14018
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/MacDue
41 changed files with 97 additions and 73 deletions
|
@ -37,7 +37,7 @@
|
|||
#include <LibWeb/Dump.h>
|
||||
#include <LibWeb/Layout/InitialContainingBlock.h>
|
||||
#include <LibWeb/Loader/ResourceLoader.h>
|
||||
#include <LibWeb/OutOfProcessWebView.h>
|
||||
#include <LibWebView/OutOfProcessWebView.h>
|
||||
|
||||
namespace Browser {
|
||||
|
||||
|
|
|
@ -33,5 +33,5 @@ set(SOURCES
|
|||
)
|
||||
|
||||
serenity_app(Browser ICON app-browser)
|
||||
target_link_libraries(Browser LibWeb LibProtocol LibGUI LibDesktop LibConfig LibMain)
|
||||
target_link_libraries(Browser LibWebView LibWeb LibProtocol LibGUI LibDesktop LibConfig LibMain)
|
||||
link_with_unicode_data(Browser)
|
||||
|
|
|
@ -24,7 +24,7 @@ ConsoleWidget::ConsoleWidget()
|
|||
set_layout<GUI::VerticalBoxLayout>();
|
||||
set_fill_with_background_color(true);
|
||||
|
||||
m_output_view = add<Web::OutOfProcessWebView>();
|
||||
m_output_view = add<WebView::OutOfProcessWebView>();
|
||||
m_output_view->load("data:text/html,<html></html>");
|
||||
// Wait until our output WebView is loaded, and then request any messages that occurred before we existed
|
||||
m_output_view->on_load_finish = [this](auto&) {
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include "History.h"
|
||||
#include <LibGUI/Widget.h>
|
||||
#include <LibWeb/OutOfProcessWebView.h>
|
||||
#include <LibWebView/OutOfProcessWebView.h>
|
||||
|
||||
namespace Browser {
|
||||
|
||||
|
@ -38,7 +38,7 @@ private:
|
|||
void end_group();
|
||||
|
||||
RefPtr<GUI::TextBox> m_input;
|
||||
RefPtr<Web::OutOfProcessWebView> m_output_view;
|
||||
RefPtr<WebView::OutOfProcessWebView> m_output_view;
|
||||
|
||||
i32 m_highest_notified_message_index { -1 };
|
||||
i32 m_highest_received_message_index { -1 };
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/Element.h>
|
||||
#include <LibWeb/DOMTreeModel.h>
|
||||
#include <LibWeb/OutOfProcessWebView.h>
|
||||
#include <LibWeb/StylePropertiesModel.h>
|
||||
#include <LibWebView/OutOfProcessWebView.h>
|
||||
|
||||
namespace Browser {
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <LibWeb/CSS/Selector.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
#include <LibWeb/Layout/BoxModelMetrics.h>
|
||||
#include <LibWebView/Forward.h>
|
||||
|
||||
namespace Browser {
|
||||
|
||||
|
@ -38,7 +39,7 @@ public:
|
|||
|
||||
virtual ~InspectorWidget() = default;
|
||||
|
||||
void set_web_view(NonnullRefPtr<Web::OutOfProcessWebView> web_view) { m_web_view = web_view; }
|
||||
void set_web_view(NonnullRefPtr<WebView::OutOfProcessWebView> web_view) { m_web_view = web_view; }
|
||||
void set_dom_json(String);
|
||||
void clear_dom_json();
|
||||
void set_dom_node_properties_json(Selection, String specified_values_json, String computed_values_json, String custom_properties_json, String node_box_sizing_json);
|
||||
|
@ -54,7 +55,7 @@ private:
|
|||
void update_node_box_model(Optional<String> node_box_sizing_json);
|
||||
void clear_style_json();
|
||||
|
||||
RefPtr<Web::OutOfProcessWebView> m_web_view;
|
||||
RefPtr<WebView::OutOfProcessWebView> m_web_view;
|
||||
|
||||
RefPtr<GUI::TreeView> m_dom_tree_view;
|
||||
RefPtr<GUI::TableView> m_computed_style_table_view;
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#include <LibWeb/Layout/BlockContainer.h>
|
||||
#include <LibWeb/Layout/InitialContainingBlock.h>
|
||||
#include <LibWeb/Loader/ResourceLoader.h>
|
||||
#include <LibWeb/OutOfProcessWebView.h>
|
||||
#include <LibWebView/OutOfProcessWebView.h>
|
||||
|
||||
namespace Browser {
|
||||
|
||||
|
@ -112,7 +112,7 @@ Tab::Tab(BrowserWindow& window)
|
|||
|
||||
auto& webview_container = *find_descendant_of_type_named<GUI::Widget>("webview_container");
|
||||
|
||||
m_web_content_view = webview_container.add<Web::OutOfProcessWebView>();
|
||||
m_web_content_view = webview_container.add<WebView::OutOfProcessWebView>();
|
||||
if (g_content_filters_enabled)
|
||||
m_web_content_view->set_content_filters(g_content_filters);
|
||||
else
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include <LibHTTP/Job.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web {
|
||||
namespace WebView {
|
||||
class OutOfProcessWebView;
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ public:
|
|||
String const& title() const { return m_title; }
|
||||
Gfx::Bitmap const* icon() const { return m_icon; }
|
||||
|
||||
Web::OutOfProcessWebView& view() { return *m_web_content_view; }
|
||||
WebView::OutOfProcessWebView& view() { return *m_web_content_view; }
|
||||
|
||||
private:
|
||||
explicit Tab(BrowserWindow&);
|
||||
|
@ -103,7 +103,7 @@ private:
|
|||
|
||||
History m_history;
|
||||
|
||||
RefPtr<Web::OutOfProcessWebView> m_web_content_view;
|
||||
RefPtr<WebView::OutOfProcessWebView> m_web_content_view;
|
||||
|
||||
RefPtr<GUI::UrlBox> m_location_box;
|
||||
RefPtr<GUI::Button> m_bookmark_button;
|
||||
|
|
|
@ -17,5 +17,5 @@ set(SOURCES
|
|||
)
|
||||
|
||||
serenity_app(Help ICON app-help)
|
||||
target_link_libraries(Help LibWeb LibMarkdown LibGUI LibDesktop LibMain)
|
||||
target_link_libraries(Help LibWebView LibWeb LibMarkdown LibGUI LibDesktop LibMain)
|
||||
link_with_unicode_data(Help)
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
@Web::OutOfProcessWebView {
|
||||
@WebView::OutOfProcessWebView {
|
||||
name: "web_view"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ MainWidget::MainWidget()
|
|||
m_manual_model->update_section_node_on_toggle(index, open);
|
||||
};
|
||||
|
||||
m_web_view = find_descendant_of_type_named<Web::OutOfProcessWebView>("web_view");
|
||||
m_web_view = find_descendant_of_type_named<WebView::OutOfProcessWebView>("web_view");
|
||||
m_web_view->on_link_click = [this](auto& url, auto&, unsigned) {
|
||||
if (url.protocol() == "file") {
|
||||
auto path = url.path();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "History.h"
|
||||
#include "ManualModel.h"
|
||||
#include <LibGUI/FilteringProxyModel.h>
|
||||
#include <LibWeb/OutOfProcessWebView.h>
|
||||
#include <LibWebView/OutOfProcessWebView.h>
|
||||
|
||||
namespace Help {
|
||||
|
||||
|
@ -45,7 +45,7 @@ private:
|
|||
RefPtr<GUI::TextBox> m_search_box;
|
||||
RefPtr<GUI::ListView> m_search_view;
|
||||
RefPtr<GUI::TreeView> m_browse_view;
|
||||
RefPtr<Web::OutOfProcessWebView> m_web_view;
|
||||
RefPtr<WebView::OutOfProcessWebView> m_web_view;
|
||||
|
||||
RefPtr<GUI::Toolbar> m_toolbar;
|
||||
RefPtr<GUI::Statusbar> m_statusbar;
|
||||
|
|
|
@ -16,4 +16,4 @@ set(SOURCES
|
|||
)
|
||||
|
||||
serenity_app(Mail ICON app-mail)
|
||||
target_link_libraries(Mail LibConfig LibCore LibDesktop LibGfx LibGUI LibIMAP LibWeb LibMain)
|
||||
target_link_libraries(Mail LibConfig LibCore LibDesktop LibGfx LibGUI LibIMAP LibWebView LibWeb LibMain)
|
||||
|
|
|
@ -28,7 +28,7 @@ MailWidget::MailWidget()
|
|||
|
||||
m_mailbox_list = *find_descendant_of_type_named<GUI::TreeView>("mailbox_list");
|
||||
m_individual_mailbox_view = *find_descendant_of_type_named<GUI::TableView>("individual_mailbox_view");
|
||||
m_web_view = *find_descendant_of_type_named<Web::OutOfProcessWebView>("web_view");
|
||||
m_web_view = *find_descendant_of_type_named<WebView::OutOfProcessWebView>("web_view");
|
||||
m_statusbar = *find_descendant_of_type_named<GUI::Statusbar>("statusbar");
|
||||
|
||||
m_mailbox_list->on_selection_change = [this] {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include <LibGUI/Widget.h>
|
||||
#include <LibGfx/ShareableBitmap.h>
|
||||
#include <LibIMAP/Client.h>
|
||||
#include <LibWeb/OutOfProcessWebView.h>
|
||||
#include <LibWebView/OutOfProcessWebView.h>
|
||||
|
||||
class MailWidget final : public GUI::Widget {
|
||||
C_OBJECT(MailWidget)
|
||||
|
@ -43,7 +43,7 @@ private:
|
|||
|
||||
RefPtr<GUI::TreeView> m_mailbox_list;
|
||||
RefPtr<GUI::TableView> m_individual_mailbox_view;
|
||||
RefPtr<Web::OutOfProcessWebView> m_web_view;
|
||||
RefPtr<WebView::OutOfProcessWebView> m_web_view;
|
||||
RefPtr<GUI::Statusbar> m_statusbar;
|
||||
|
||||
RefPtr<GUI::Menu> m_link_context_menu;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
name: "individual_mailbox_view"
|
||||
}
|
||||
|
||||
@Web::OutOfProcessWebView {
|
||||
@WebView::OutOfProcessWebView {
|
||||
name: "web_view"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ set(GENERATED_SOURCES
|
|||
)
|
||||
|
||||
serenity_app(Spreadsheet ICON app-spreadsheet)
|
||||
target_link_libraries(Spreadsheet LibFileSystemAccessClient LibGUI LibJS LibMain LibWeb)
|
||||
target_link_libraries(Spreadsheet LibFileSystemAccessClient LibGUI LibJS LibMain LibWebView LibWeb)
|
||||
link_with_unicode_data(Spreadsheet)
|
||||
|
||||
serenity_test(Writers/Test/TestXSVWriter.cpp Spreadsheet)
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include <LibGUI/Splitter.h>
|
||||
#include <LibMarkdown/Document.h>
|
||||
#include <LibWeb/Layout/Node.h>
|
||||
#include <LibWeb/OutOfProcessWebView.h>
|
||||
#include <LibWebView/OutOfProcessWebView.h>
|
||||
|
||||
namespace Spreadsheet {
|
||||
|
||||
|
@ -80,7 +80,7 @@ HelpWindow::HelpWindow(GUI::Window* parent)
|
|||
m_listview->set_activates_on_selection(true);
|
||||
m_listview->set_model(HelpListModel::create());
|
||||
|
||||
m_webview = splitter.add<Web::OutOfProcessWebView>();
|
||||
m_webview = splitter.add<WebView::OutOfProcessWebView>();
|
||||
m_webview->on_link_click = [this](auto& url, auto&, auto&&) {
|
||||
VERIFY(url.protocol() == "spreadsheet");
|
||||
if (url.host() == "example") {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <LibGUI/Dialog.h>
|
||||
#include <LibGUI/Widget.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibWeb/OutOfProcessWebView.h>
|
||||
#include <LibWebView/OutOfProcessWebView.h>
|
||||
|
||||
namespace Spreadsheet {
|
||||
|
||||
|
@ -36,7 +36,7 @@ private:
|
|||
HelpWindow(GUI::Window* parent = nullptr);
|
||||
|
||||
JsonObject m_docs;
|
||||
RefPtr<Web::OutOfProcessWebView> m_webview;
|
||||
RefPtr<WebView::OutOfProcessWebView> m_webview;
|
||||
RefPtr<GUI::ListView> m_listview;
|
||||
};
|
||||
|
||||
|
|
|
@ -15,5 +15,5 @@ set(SOURCES
|
|||
)
|
||||
|
||||
serenity_app(TextEditor ICON app-text-editor)
|
||||
target_link_libraries(TextEditor LibWeb LibMarkdown LibGUI LibShell LibRegex LibDesktop LibCpp LibJS LibSQL LibFileSystemAccessClient LibConfig LibMain)
|
||||
target_link_libraries(TextEditor LibWebView LibWeb LibMarkdown LibGUI LibShell LibRegex LibDesktop LibCpp LibJS LibSQL LibFileSystemAccessClient LibConfig LibMain)
|
||||
link_with_unicode_data(TextEditor)
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include <LibSQL/AST/SyntaxHighlighter.h>
|
||||
#include <LibWeb/CSS/SyntaxHighlighter/SyntaxHighlighter.h>
|
||||
#include <LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.h>
|
||||
#include <LibWeb/OutOfProcessWebView.h>
|
||||
#include <LibWebView/OutOfProcessWebView.h>
|
||||
#include <Shell/SyntaxHighlighter.h>
|
||||
|
||||
namespace TextEditor {
|
||||
|
@ -311,11 +311,11 @@ MainWidget::MainWidget()
|
|||
m_toolbar->add_action(m_editor->redo_action());
|
||||
}
|
||||
|
||||
Web::OutOfProcessWebView& MainWidget::ensure_web_view()
|
||||
WebView::OutOfProcessWebView& MainWidget::ensure_web_view()
|
||||
{
|
||||
if (!m_page_view) {
|
||||
auto& web_view_container = *find_descendant_of_type_named<GUI::Widget>("web_view_container");
|
||||
m_page_view = web_view_container.add<Web::OutOfProcessWebView>();
|
||||
m_page_view = web_view_container.add<WebView::OutOfProcessWebView>();
|
||||
m_page_view->on_link_hover = [this](auto& url) {
|
||||
if (url.is_valid())
|
||||
m_statusbar->set_text(url.to_string());
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include <LibGUI/TextEditor.h>
|
||||
#include <LibGUI/Widget.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
#include <LibWebView/Forward.h>
|
||||
|
||||
namespace TextEditor {
|
||||
|
||||
|
@ -51,7 +51,7 @@ private:
|
|||
void update_markdown_preview();
|
||||
void update_html_preview();
|
||||
|
||||
Web::OutOfProcessWebView& ensure_web_view();
|
||||
WebView::OutOfProcessWebView& ensure_web_view();
|
||||
void set_web_view_visible(bool);
|
||||
|
||||
virtual void drop_event(GUI::DropEvent&) override;
|
||||
|
@ -134,7 +134,7 @@ private:
|
|||
RefPtr<GUI::Action> m_shell_highlight;
|
||||
RefPtr<GUI::Action> m_sql_highlight;
|
||||
|
||||
RefPtr<Web::OutOfProcessWebView> m_page_view;
|
||||
RefPtr<WebView::OutOfProcessWebView> m_page_view;
|
||||
|
||||
bool m_auto_detect_preview_mode { false };
|
||||
bool m_use_regex { false };
|
||||
|
|
|
@ -13,4 +13,4 @@ set(SOURCES
|
|||
)
|
||||
|
||||
serenity_app(Welcome ICON app-welcome)
|
||||
target_link_libraries(Welcome LibGUI LibWeb LibMain)
|
||||
target_link_libraries(Welcome LibGUI LibWebView LibWeb LibMain)
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include <LibGfx/Font/BitmapFont.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <LibMarkdown/Document.h>
|
||||
#include <LibWeb/OutOfProcessWebView.h>
|
||||
#include <LibWebView/OutOfProcessWebView.h>
|
||||
#include <serenity.h>
|
||||
|
||||
WelcomeWidget::WelcomeWidget()
|
||||
|
@ -32,7 +32,7 @@ WelcomeWidget::WelcomeWidget()
|
|||
auto& light_bulb_label = *find_descendant_of_type_named<GUI::Label>("light_bulb_label");
|
||||
light_bulb_label.set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/32x32/app-welcome.png").release_value_but_fixme_should_propagate_errors());
|
||||
|
||||
m_web_view = *find_descendant_of_type_named<Web::OutOfProcessWebView>("web_view");
|
||||
m_web_view = *find_descendant_of_type_named<WebView::OutOfProcessWebView>("web_view");
|
||||
|
||||
m_tip_label = *find_descendant_of_type_named<GUI::Label>("tip_label");
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGUI/Widget.h>
|
||||
#include <LibWeb/OutOfProcessWebView.h>
|
||||
#include <LibWebView/OutOfProcessWebView.h>
|
||||
|
||||
class WelcomeWidget final : public GUI::Widget {
|
||||
C_OBJECT(WelcomeWidget);
|
||||
|
@ -30,7 +30,7 @@ private:
|
|||
RefPtr<GUI::Button> m_new_button;
|
||||
RefPtr<GUI::Label> m_tip_label;
|
||||
RefPtr<GUI::CheckBox> m_startup_checkbox;
|
||||
RefPtr<Web::OutOfProcessWebView> m_web_view;
|
||||
RefPtr<WebView::OutOfProcessWebView> m_web_view;
|
||||
|
||||
size_t m_initial_tip_index { 0 };
|
||||
Vector<String> m_tips;
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
@Web::OutOfProcessWebView {
|
||||
@WebView::OutOfProcessWebView {
|
||||
name: "web_view"
|
||||
min_width: 340
|
||||
min_height: 160
|
||||
|
|
|
@ -55,6 +55,6 @@ set(SOURCES
|
|||
)
|
||||
|
||||
serenity_app(HackStudio ICON app-hack-studio)
|
||||
target_link_libraries(HackStudio LibWeb LibMarkdown LibGUI LibCpp LibGfx LibCore LibVT LibDebug LibX86 LibDiff LibShell LibSymbolication LibRegex LibSQL LibCoredump LibMain)
|
||||
target_link_libraries(HackStudio LibWebView LibWeb LibMarkdown LibGUI LibCpp LibGfx LibCore LibVT LibDebug LibX86 LibDiff LibShell LibSymbolication LibRegex LibSQL LibCoredump LibMain)
|
||||
link_with_unicode_data(HackStudio)
|
||||
add_dependencies(HackStudio CppLanguageServer)
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#include <LibWeb/DOM/Text.h>
|
||||
#include <LibWeb/HTML/HTMLHeadElement.h>
|
||||
#include <LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.h>
|
||||
#include <LibWeb/OutOfProcessWebView.h>
|
||||
#include <LibWebView/OutOfProcessWebView.h>
|
||||
#include <Shell/SyntaxHighlighter.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
|
@ -77,7 +77,7 @@ ErrorOr<void> Editor::initialize_documentation_tooltip()
|
|||
m_documentation_tooltip_window = GUI::Window::construct();
|
||||
m_documentation_tooltip_window->set_rect(0, 0, 500, 400);
|
||||
m_documentation_tooltip_window->set_window_type(GUI::WindowType::Tooltip);
|
||||
m_documentation_page_view = TRY(m_documentation_tooltip_window->try_set_main_widget<Web::OutOfProcessWebView>());
|
||||
m_documentation_page_view = TRY(m_documentation_tooltip_window->try_set_main_widget<WebView::OutOfProcessWebView>());
|
||||
return {};
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ ErrorOr<void> Editor::initialize_parameters_hint_tooltip()
|
|||
m_parameters_hint_tooltip_window = GUI::Window::construct();
|
||||
m_parameters_hint_tooltip_window->set_rect(0, 0, 280, 35);
|
||||
m_parameters_hint_tooltip_window->set_window_type(GUI::WindowType::Tooltip);
|
||||
m_parameter_hint_page_view = TRY(m_parameters_hint_tooltip_window->try_set_main_widget<Web::OutOfProcessWebView>());
|
||||
m_parameter_hint_page_view = TRY(m_parameters_hint_tooltip_window->try_set_main_widget<WebView::OutOfProcessWebView>());
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include <AK/Optional.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <LibGUI/TextEditor.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
#include <LibWebView/Forward.h>
|
||||
|
||||
namespace HackStudio {
|
||||
|
||||
|
@ -113,8 +113,8 @@ private:
|
|||
|
||||
RefPtr<GUI::Window> m_documentation_tooltip_window;
|
||||
RefPtr<GUI::Window> m_parameters_hint_tooltip_window;
|
||||
RefPtr<Web::OutOfProcessWebView> m_documentation_page_view;
|
||||
RefPtr<Web::OutOfProcessWebView> m_parameter_hint_page_view;
|
||||
RefPtr<WebView::OutOfProcessWebView> m_documentation_page_view;
|
||||
RefPtr<WebView::OutOfProcessWebView> m_parameter_hint_page_view;
|
||||
String m_last_parsed_token;
|
||||
GUI::TextPosition m_previous_text_position { 0, 0 };
|
||||
bool m_hovering_editor { false };
|
||||
|
|
|
@ -58,5 +58,6 @@ add_subdirectory(LibVT)
|
|||
add_subdirectory(LibWasm)
|
||||
add_subdirectory(LibWeb)
|
||||
add_subdirectory(LibWebSocket)
|
||||
add_subdirectory(LibWebView)
|
||||
add_subdirectory(LibX86)
|
||||
add_subdirectory(LibXML)
|
||||
|
|
|
@ -285,7 +285,6 @@ set(SOURCES
|
|||
MimeSniff/MimeType.cpp
|
||||
Namespace.cpp
|
||||
NavigationTiming/PerformanceTiming.cpp
|
||||
OutOfProcessWebView.cpp
|
||||
Page/EditEventHandler.cpp
|
||||
Page/EventHandler.cpp
|
||||
Page/Page.cpp
|
||||
|
@ -355,7 +354,6 @@ set(SOURCES
|
|||
WebAssembly/WebAssemblyTableConstructor.cpp
|
||||
WebAssembly/WebAssemblyTableObject.cpp
|
||||
WebAssembly/WebAssemblyTablePrototype.cpp
|
||||
WebContentClient.cpp
|
||||
WebSockets/WebSocket.cpp
|
||||
XHR/EventNames.cpp
|
||||
XHR/XMLHttpRequest.cpp
|
||||
|
@ -366,8 +364,6 @@ set(SOURCES
|
|||
set(GENERATED_SOURCES
|
||||
../../Services/RequestServer/RequestClientEndpoint.h
|
||||
../../Services/RequestServer/RequestServerEndpoint.h
|
||||
../../Services/WebContent/WebContentClientEndpoint.h
|
||||
../../Services/WebContent/WebContentServerEndpoint.h
|
||||
)
|
||||
|
||||
generate_css_implementation()
|
||||
|
|
|
@ -3,4 +3,4 @@ set(SOURCES
|
|||
)
|
||||
|
||||
serenity_bin(DumpLayoutTree)
|
||||
target_link_libraries(DumpLayoutTree LibWeb)
|
||||
target_link_libraries(DumpLayoutTree LibWebView LibWeb)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibWeb/OutOfProcessWebView.h>
|
||||
#include <LibWebView/OutOfProcessWebView.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
@ -16,7 +16,7 @@ int main(int argc, char** argv)
|
|||
window->set_title("DumpLayoutTree");
|
||||
window->resize(800, 600);
|
||||
window->show();
|
||||
auto& web_view = window->set_main_widget<Web::OutOfProcessWebView>();
|
||||
auto& web_view = window->set_main_widget<WebView::OutOfProcessWebView>();
|
||||
web_view.load(URL::create_with_file_protocol(argv[1]));
|
||||
web_view.on_load_finish = [&](auto&) {
|
||||
auto dump = web_view.dump_layout_tree();
|
||||
|
|
|
@ -370,7 +370,6 @@ class EventHandler;
|
|||
class FrameLoader;
|
||||
class LoadRequest;
|
||||
class Origin;
|
||||
class OutOfProcessWebView;
|
||||
class Page;
|
||||
class PageClient;
|
||||
class PaintContext;
|
||||
|
|
14
Userland/Libraries/LibWebView/CMakeLists.txt
Normal file
14
Userland/Libraries/LibWebView/CMakeLists.txt
Normal file
|
@ -0,0 +1,14 @@
|
|||
set(SOURCES
|
||||
OutOfProcessWebView.cpp
|
||||
WebContentClient.cpp
|
||||
)
|
||||
|
||||
set(GENERATED_SOURCES
|
||||
../../Services/RequestServer/RequestClientEndpoint.h
|
||||
../../Services/RequestServer/RequestServerEndpoint.h
|
||||
../../Services/WebContent/WebContentClientEndpoint.h
|
||||
../../Services/WebContent/WebContentServerEndpoint.h
|
||||
)
|
||||
|
||||
serenity_lib(LibWebView webview)
|
||||
target_link_libraries(LibWebView LibGfx LibGUI LibIPC LibWeb)
|
13
Userland/Libraries/LibWebView/Forward.h
Normal file
13
Userland/Libraries/LibWebView/Forward.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* Copyright (c) 2022, The SerenityOS developers
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace WebView {
|
||||
|
||||
class OutOfProcessWebView;
|
||||
|
||||
}
|
|
@ -18,9 +18,9 @@
|
|||
#include <LibGfx/Palette.h>
|
||||
#include <LibGfx/SystemTheme.h>
|
||||
|
||||
REGISTER_WIDGET(Web, OutOfProcessWebView)
|
||||
REGISTER_WIDGET(WebView, OutOfProcessWebView)
|
||||
|
||||
namespace Web {
|
||||
namespace WebView {
|
||||
|
||||
OutOfProcessWebView::OutOfProcessWebView()
|
||||
{
|
||||
|
@ -376,14 +376,14 @@ void OutOfProcessWebView::notify_server_did_change_favicon(Gfx::Bitmap const& fa
|
|||
on_favicon_change(favicon);
|
||||
}
|
||||
|
||||
String OutOfProcessWebView::notify_server_did_request_cookie(Badge<WebContentClient>, const AK::URL& url, Cookie::Source source)
|
||||
String OutOfProcessWebView::notify_server_did_request_cookie(Badge<WebContentClient>, const AK::URL& url, Web::Cookie::Source source)
|
||||
{
|
||||
if (on_get_cookie)
|
||||
return on_get_cookie(url, source);
|
||||
return {};
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::notify_server_did_set_cookie(Badge<WebContentClient>, const AK::URL& url, Cookie::ParsedCookie const& cookie, Cookie::Source source)
|
||||
void OutOfProcessWebView::notify_server_did_set_cookie(Badge<WebContentClient>, const AK::URL& url, Web::Cookie::ParsedCookie const& cookie, Web::Cookie::Source source)
|
||||
{
|
||||
if (on_set_cookie)
|
||||
on_set_cookie(url, cookie, source);
|
||||
|
@ -437,7 +437,7 @@ void OutOfProcessWebView::inspect_dom_tree()
|
|||
client().async_inspect_dom_tree();
|
||||
}
|
||||
|
||||
Optional<OutOfProcessWebView::DOMNodeProperties> OutOfProcessWebView::inspect_dom_node(i32 node_id, Optional<CSS::Selector::PseudoElement> pseudo_element)
|
||||
Optional<OutOfProcessWebView::DOMNodeProperties> OutOfProcessWebView::inspect_dom_node(i32 node_id, Optional<Web::CSS::Selector::PseudoElement> pseudo_element)
|
||||
{
|
||||
auto response = client().inspect_dom_node(node_id, pseudo_element);
|
||||
if (!response.has_style())
|
|
@ -12,7 +12,7 @@
|
|||
#include <LibWeb/CSS/Selector.h>
|
||||
#include <LibWeb/Page/Page.h>
|
||||
|
||||
namespace Web {
|
||||
namespace WebView {
|
||||
|
||||
class WebContentClient;
|
||||
|
||||
|
@ -38,7 +38,7 @@ public:
|
|||
String custom_properties_json;
|
||||
String node_box_sizing_json;
|
||||
};
|
||||
Optional<DOMNodeProperties> inspect_dom_node(i32 node_id, Optional<CSS::Selector::PseudoElement>);
|
||||
Optional<DOMNodeProperties> inspect_dom_node(i32 node_id, Optional<Web::CSS::Selector::PseudoElement>);
|
||||
void clear_inspected_dom_node();
|
||||
i32 get_hovered_node_id();
|
||||
|
||||
|
@ -69,14 +69,14 @@ public:
|
|||
Function<void(const AK::URL&)> on_load_finish;
|
||||
Function<void(Gfx::Bitmap const&)> on_favicon_change;
|
||||
Function<void(const AK::URL&)> on_url_drop;
|
||||
Function<void(DOM::Document*)> on_set_document;
|
||||
Function<void(Web::DOM::Document*)> on_set_document;
|
||||
Function<void(const AK::URL&, String const&)> on_get_source;
|
||||
Function<void(String const&)> on_get_dom_tree;
|
||||
Function<void(i32 node_id, String const& specified_style, String const& computed_style, String const& custom_properties, String const& node_box_sizing)> on_get_dom_node_properties;
|
||||
Function<void(i32 message_id)> on_js_console_new_message;
|
||||
Function<void(i32 start_index, Vector<String> const& message_types, Vector<String> const& messages)> on_get_js_console_messages;
|
||||
Function<String(const AK::URL& url, Cookie::Source source)> on_get_cookie;
|
||||
Function<void(const AK::URL& url, Cookie::ParsedCookie const& cookie, Cookie::Source source)> on_set_cookie;
|
||||
Function<String(const AK::URL& url, Web::Cookie::Source source)> on_get_cookie;
|
||||
Function<void(const AK::URL& url, Web::Cookie::ParsedCookie const& cookie, Web::Cookie::Source source)> on_set_cookie;
|
||||
Function<void(i32 count_waiting)> on_resource_status_change;
|
||||
|
||||
void notify_server_did_layout(Badge<WebContentClient>, Gfx::IntSize const& content_size);
|
||||
|
@ -108,8 +108,8 @@ public:
|
|||
void notify_server_did_output_js_console_message(i32 message_index);
|
||||
void notify_server_did_get_js_console_messages(i32 start_index, Vector<String> const& message_types, Vector<String> const& messages);
|
||||
void notify_server_did_change_favicon(Gfx::Bitmap const& favicon);
|
||||
String notify_server_did_request_cookie(Badge<WebContentClient>, const AK::URL& url, Cookie::Source source);
|
||||
void notify_server_did_set_cookie(Badge<WebContentClient>, const AK::URL& url, Cookie::ParsedCookie const& cookie, Cookie::Source source);
|
||||
String notify_server_did_request_cookie(Badge<WebContentClient>, const AK::URL& url, Web::Cookie::Source source);
|
||||
void notify_server_did_set_cookie(Badge<WebContentClient>, const AK::URL& url, Web::Cookie::ParsedCookie const& cookie, Web::Cookie::Source source);
|
||||
void notify_server_did_update_resource_count(i32 count_waiting);
|
||||
|
||||
private:
|
|
@ -9,7 +9,7 @@
|
|||
#include <AK/Debug.h>
|
||||
#include <LibWeb/Cookie/ParsedCookie.h>
|
||||
|
||||
namespace Web {
|
||||
namespace WebView {
|
||||
|
||||
WebContentClient::WebContentClient(NonnullOwnPtr<Core::Stream::LocalSocket> socket, OutOfProcessWebView& view)
|
||||
: IPC::ConnectionToServer<WebContentClientEndpoint, WebContentServerEndpoint>(*this, move(socket))
|
||||
|
@ -187,12 +187,12 @@ void WebContentClient::did_change_favicon(Gfx::ShareableBitmap const& favicon)
|
|||
|
||||
Messages::WebContentClient::DidRequestCookieResponse WebContentClient::did_request_cookie(AK::URL const& url, u8 source)
|
||||
{
|
||||
return m_view.notify_server_did_request_cookie({}, url, static_cast<Cookie::Source>(source));
|
||||
return m_view.notify_server_did_request_cookie({}, url, static_cast<Web::Cookie::Source>(source));
|
||||
}
|
||||
|
||||
void WebContentClient::did_set_cookie(AK::URL const& url, Web::Cookie::ParsedCookie const& cookie, u8 source)
|
||||
{
|
||||
m_view.notify_server_did_set_cookie({}, url, cookie, static_cast<Cookie::Source>(source));
|
||||
m_view.notify_server_did_set_cookie({}, url, cookie, static_cast<Web::Cookie::Source>(source));
|
||||
}
|
||||
|
||||
void WebContentClient::did_update_resource_count(i32 count_waiting)
|
|
@ -12,7 +12,7 @@
|
|||
#include <WebContent/WebContentClientEndpoint.h>
|
||||
#include <WebContent/WebContentServerEndpoint.h>
|
||||
|
||||
namespace Web {
|
||||
namespace WebView {
|
||||
|
||||
class OutOfProcessWebView;
|
||||
|
|
@ -17,5 +17,5 @@ set(SOURCES
|
|||
)
|
||||
|
||||
serenity_bin(WebContent)
|
||||
target_link_libraries(WebContent LibCore LibIPC LibGfx LibWeb LibMain)
|
||||
target_link_libraries(WebContent LibCore LibIPC LibGfx LibWebView LibWeb LibMain)
|
||||
link_with_unicode_data(WebContent)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue