summaryrefslogtreecommitdiff
path: root/Applications/Help/main.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-10-08 21:59:03 +0100
committerAndreas Kling <kling@serenityos.org>2020-10-08 23:20:52 +0200
commit870dd44ba9f33aaf68ad2031f2bc3ca732502b02 (patch)
treee66d316b23f05af3dd47e772eb231efded785b9a /Applications/Help/main.cpp
parent95a6019ff0e956c502b5ab11325a68cc72320b3e (diff)
downloadserenity-870dd44ba9f33aaf68ad2031f2bc3ca732502b02.zip
Help: Replace InProcessWebView with OutOfProcessWebView
Diffstat (limited to 'Applications/Help/main.cpp')
-rw-r--r--Applications/Help/main.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/Applications/Help/main.cpp b/Applications/Help/main.cpp
index 9a3290272f..373d9bf407 100644
--- a/Applications/Help/main.cpp
+++ b/Applications/Help/main.cpp
@@ -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();