mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-24 21:45:20 +00:00
Help: Replace InProcessWebView with OutOfProcessWebView
This commit is contained in:
parent
95a6019ff0
commit
870dd44ba9
Notes:
sideshowbarker
2024-07-19 01:57:50 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/870dd44ba9f Pull-request: https://github.com/SerenityOS/serenity/pull/3727
1 changed files with 11 additions and 7 deletions
|
@ -47,8 +47,7 @@
|
|||
#include <LibGUI/TreeView.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibMarkdown/Document.h>
|
||||
#include <LibWeb/InProcessWebView.h>
|
||||
#include <LibWeb/Layout/LayoutNode.h>
|
||||
#include <LibWeb/OutOfProcessWebView.h>
|
||||
#include <libgen.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
@ -82,6 +81,11 @@ int main(int argc, char* argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (unveil("/tmp/portal/webcontent", "rw") < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
|
||||
unveil(nullptr, nullptr);
|
||||
|
||||
const char* term_to_search_for_at_launch = nullptr;
|
||||
|
@ -137,7 +141,7 @@ int main(int argc, char* argv[])
|
|||
left_tab_bar.set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
||||
left_tab_bar.set_preferred_size(200, 500);
|
||||
|
||||
auto& page_view = splitter.add<Web::InProcessWebView>();
|
||||
auto& page_view = splitter.add<Web::OutOfProcessWebView>();
|
||||
|
||||
History history;
|
||||
|
||||
|
@ -151,7 +155,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
auto open_page = [&](const String& path) {
|
||||
if (path.is_null()) {
|
||||
page_view.set_document(nullptr);
|
||||
page_view.load_empty_document();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -178,7 +182,7 @@ int main(int argc, char* argv[])
|
|||
tree_view.on_selection_change = [&] {
|
||||
String path = model->page_path(tree_view.selection().first());
|
||||
if (path.is_null()) {
|
||||
page_view.set_document(nullptr);
|
||||
page_view.load_empty_document();
|
||||
window->set_title("Help");
|
||||
return;
|
||||
}
|
||||
|
@ -207,12 +211,12 @@ int main(int argc, char* argv[])
|
|||
auto& search_model = *static_cast<GUI::FilteringProxyModel*>(model);
|
||||
index = search_model.map(index);
|
||||
} else {
|
||||
page_view.set_document(nullptr);
|
||||
page_view.load_empty_document();
|
||||
return;
|
||||
}
|
||||
String path = model->page_path(index);
|
||||
if (path.is_null()) {
|
||||
page_view.set_document(nullptr);
|
||||
page_view.load_empty_document();
|
||||
return;
|
||||
}
|
||||
tree_view.selection().clear();
|
||||
|
|
Loading…
Add table
Reference in a new issue