mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-01 14:18:15 +00:00
Ladybird: Add ability to create a tab without creating a new WebContent
This commit is contained in:
@@ -28,7 +28,7 @@ OutOfProcessWebView::OutOfProcessWebView()
|
||||
set_should_hide_unnecessary_scrollbars(true);
|
||||
set_focus_policy(GUI::FocusPolicy::StrongFocus);
|
||||
|
||||
create_client();
|
||||
initialize_client(CreateNewClient::Yes);
|
||||
|
||||
on_did_layout = [this](auto content_size) {
|
||||
set_content_size(content_size);
|
||||
@@ -81,8 +81,10 @@ OutOfProcessWebView::OutOfProcessWebView()
|
||||
|
||||
OutOfProcessWebView::~OutOfProcessWebView() = default;
|
||||
|
||||
void OutOfProcessWebView::create_client()
|
||||
void OutOfProcessWebView::initialize_client(WebView::ViewImplementation::CreateNewClient)
|
||||
{
|
||||
// FIXME: Don't create a new process when CreateNewClient is false
|
||||
// We should create a new tab/window in the UI instead, and re-use the existing WebContentClient object.
|
||||
m_client_state = {};
|
||||
|
||||
m_client_state.client = WebContentClient::try_create(*this).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
Reference in New Issue
Block a user