mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:38:11 +00:00
LibWeb: Move OutOfProcessWebView into the Web namespace
This commit is contained in:
parent
09ccb46980
commit
682b2fdb75
9 changed files with 24 additions and 10 deletions
|
@ -50,14 +50,14 @@
|
||||||
#include <LibWeb/DOM/Element.h>
|
#include <LibWeb/DOM/Element.h>
|
||||||
#include <LibWeb/DOMTreeModel.h>
|
#include <LibWeb/DOMTreeModel.h>
|
||||||
#include <LibWeb/Dump.h>
|
#include <LibWeb/Dump.h>
|
||||||
|
#include <LibWeb/InProcessWebView.h>
|
||||||
#include <LibWeb/Layout/LayoutBlock.h>
|
#include <LibWeb/Layout/LayoutBlock.h>
|
||||||
#include <LibWeb/Layout/LayoutDocument.h>
|
#include <LibWeb/Layout/LayoutDocument.h>
|
||||||
#include <LibWeb/Layout/LayoutInline.h>
|
#include <LibWeb/Layout/LayoutInline.h>
|
||||||
#include <LibWeb/Layout/LayoutNode.h>
|
#include <LibWeb/Layout/LayoutNode.h>
|
||||||
#include <LibWeb/Loader/ResourceLoader.h>
|
#include <LibWeb/Loader/ResourceLoader.h>
|
||||||
#include <LibWeb/Page/Frame.h>
|
|
||||||
#include <LibWeb/InProcessWebView.h>
|
|
||||||
#include <LibWeb/OutOfProcessWebView.h>
|
#include <LibWeb/OutOfProcessWebView.h>
|
||||||
|
#include <LibWeb/Page/Frame.h>
|
||||||
|
|
||||||
namespace Browser {
|
namespace Browser {
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ Tab::Tab(Type type)
|
||||||
if (m_type == Type::InProcessWebView)
|
if (m_type == Type::InProcessWebView)
|
||||||
m_page_view = widget.add<Web::InProcessWebView>();
|
m_page_view = widget.add<Web::InProcessWebView>();
|
||||||
else
|
else
|
||||||
m_web_content_view = widget.add<OutOfProcessWebView>();
|
m_web_content_view = widget.add<Web::OutOfProcessWebView>();
|
||||||
|
|
||||||
m_go_back_action = GUI::CommonActions::make_go_back_action([this](auto&) { go_back(); }, this);
|
m_go_back_action = GUI::CommonActions::make_go_back_action([this](auto&) { go_back(); }, this);
|
||||||
m_go_forward_action = GUI::CommonActions::make_go_forward_action([this](auto&) { go_forward(); }, this);
|
m_go_forward_action = GUI::CommonActions::make_go_forward_action([this](auto&) { go_forward(); }, this);
|
||||||
|
|
|
@ -32,9 +32,8 @@
|
||||||
#include <LibHTTP/HttpJob.h>
|
#include <LibHTTP/HttpJob.h>
|
||||||
#include <LibWeb/Forward.h>
|
#include <LibWeb/Forward.h>
|
||||||
|
|
||||||
class OutOfProcessWebView;
|
|
||||||
|
|
||||||
namespace Web {
|
namespace Web {
|
||||||
|
class OutOfProcessWebView;
|
||||||
class WebViewHooks;
|
class WebViewHooks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +87,7 @@ private:
|
||||||
History m_history;
|
History m_history;
|
||||||
|
|
||||||
RefPtr<Web::InProcessWebView> m_page_view;
|
RefPtr<Web::InProcessWebView> m_page_view;
|
||||||
RefPtr<OutOfProcessWebView> m_web_content_view;
|
RefPtr<Web::OutOfProcessWebView> m_web_content_view;
|
||||||
|
|
||||||
RefPtr<GUI::Action> m_go_back_action;
|
RefPtr<GUI::Action> m_go_back_action;
|
||||||
RefPtr<GUI::Action> m_go_forward_action;
|
RefPtr<GUI::Action> m_go_forward_action;
|
||||||
|
|
|
@ -95,8 +95,7 @@ HelpWindow::HelpWindow(GUI::Window* parent)
|
||||||
m_listview = &list_view;
|
m_listview = &list_view;
|
||||||
list_view.set_model(HelpListModel::create());
|
list_view.set_model(HelpListModel::create());
|
||||||
|
|
||||||
// FIXME: This should be in the Web namespace!
|
m_webview = &splitter.add<Web::OutOfProcessWebView>();
|
||||||
m_webview = &splitter.add<OutOfProcessWebView>();
|
|
||||||
|
|
||||||
list_view.on_activation = [this](auto& index) {
|
list_view.on_activation = [this](auto& index) {
|
||||||
if (!m_webview)
|
if (!m_webview)
|
||||||
|
|
|
@ -55,7 +55,7 @@ private:
|
||||||
HelpWindow(GUI::Window* parent = nullptr);
|
HelpWindow(GUI::Window* parent = nullptr);
|
||||||
|
|
||||||
JsonObject m_docs;
|
JsonObject m_docs;
|
||||||
OutOfProcessWebView* m_webview { nullptr };
|
Web::OutOfProcessWebView* m_webview { nullptr };
|
||||||
GUI::ListView* m_listview { nullptr };
|
GUI::ListView* m_listview { nullptr };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ int main(int argc, char** argv)
|
||||||
auto& main_widget = window->set_main_widget<GUI::Widget>();
|
auto& main_widget = window->set_main_widget<GUI::Widget>();
|
||||||
main_widget.set_fill_with_background_color(true);
|
main_widget.set_fill_with_background_color(true);
|
||||||
main_widget.set_layout<GUI::VerticalBoxLayout>();
|
main_widget.set_layout<GUI::VerticalBoxLayout>();
|
||||||
auto& view = main_widget.add<OutOfProcessWebView>();
|
auto& view = main_widget.add<Web::OutOfProcessWebView>();
|
||||||
auto& statusbar = main_widget.add<GUI::StatusBar>();
|
auto& statusbar = main_widget.add<GUI::StatusBar>();
|
||||||
window->set_title("WebView");
|
window->set_title("WebView");
|
||||||
window->resize(640, 480);
|
window->resize(640, 480);
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
#include <LibGUI/Window.h>
|
#include <LibGUI/Window.h>
|
||||||
#include <LibGfx/SystemTheme.h>
|
#include <LibGfx/SystemTheme.h>
|
||||||
|
|
||||||
|
namespace Web {
|
||||||
|
|
||||||
OutOfProcessWebView::OutOfProcessWebView()
|
OutOfProcessWebView::OutOfProcessWebView()
|
||||||
{
|
{
|
||||||
set_should_hide_unnecessary_scrollbars(true);
|
set_should_hide_unnecessary_scrollbars(true);
|
||||||
|
@ -194,3 +196,5 @@ WebContentClient& OutOfProcessWebView::client()
|
||||||
{
|
{
|
||||||
return *m_client;
|
return *m_client;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#include <LibGUI/Widget.h>
|
#include <LibGUI/Widget.h>
|
||||||
#include <LibWeb/WebViewHooks.h>
|
#include <LibWeb/WebViewHooks.h>
|
||||||
|
|
||||||
|
namespace Web {
|
||||||
|
|
||||||
class WebContentClient;
|
class WebContentClient;
|
||||||
|
|
||||||
class OutOfProcessWebView final
|
class OutOfProcessWebView final
|
||||||
|
@ -83,3 +85,5 @@ private:
|
||||||
RefPtr<Gfx::Bitmap> m_front_bitmap;
|
RefPtr<Gfx::Bitmap> m_front_bitmap;
|
||||||
RefPtr<Gfx::Bitmap> m_back_bitmap;
|
RefPtr<Gfx::Bitmap> m_back_bitmap;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
#include "OutOfProcessWebView.h"
|
#include "OutOfProcessWebView.h"
|
||||||
#include <AK/SharedBuffer.h>
|
#include <AK/SharedBuffer.h>
|
||||||
|
|
||||||
|
namespace Web {
|
||||||
|
|
||||||
WebContentClient::WebContentClient(OutOfProcessWebView& view)
|
WebContentClient::WebContentClient(OutOfProcessWebView& view)
|
||||||
: IPC::ServerConnection<WebContentClientEndpoint, WebContentServerEndpoint>(*this, "/tmp/portal/webcontent")
|
: IPC::ServerConnection<WebContentClientEndpoint, WebContentServerEndpoint>(*this, "/tmp/portal/webcontent")
|
||||||
, m_view(view)
|
, m_view(view)
|
||||||
|
@ -139,3 +141,5 @@ void WebContentClient::handle(const Messages::WebContentClient::DidRequestLinkCo
|
||||||
{
|
{
|
||||||
m_view.notify_server_did_request_link_context_menu({}, message.content_position(), message.url(), message.target(), message.modifiers());
|
m_view.notify_server_did_request_link_context_menu({}, message.content_position(), message.url(), message.target(), message.modifiers());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#include <WebContent/WebContentClientEndpoint.h>
|
#include <WebContent/WebContentClientEndpoint.h>
|
||||||
#include <WebContent/WebContentServerEndpoint.h>
|
#include <WebContent/WebContentServerEndpoint.h>
|
||||||
|
|
||||||
|
namespace Web {
|
||||||
|
|
||||||
class OutOfProcessWebView;
|
class OutOfProcessWebView;
|
||||||
|
|
||||||
class WebContentClient
|
class WebContentClient
|
||||||
|
@ -61,3 +63,5 @@ private:
|
||||||
|
|
||||||
OutOfProcessWebView& m_view;
|
OutOfProcessWebView& m_view;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue