diff options
author | Linus Groh <mail@linusgroh.de> | 2020-10-08 21:32:22 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-10-08 23:20:52 +0200 |
commit | f0ba53609539909a9b8e5c324b01f046cb603d90 (patch) | |
tree | e75a56273ccd17f371ead4780f1e999a1c7e4ae5 | |
parent | 4ef3a55900d4b274175f56fdfdcf9ad9b84c1edc (diff) | |
download | serenity-f0ba53609539909a9b8e5c324b01f046cb603d90.zip |
html: Replace InProcessWebView with OutOfProcessWebView
-rw-r--r-- | Userland/html.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Userland/html.cpp b/Userland/html.cpp index a72de4bcde..c451957c3a 100644 --- a/Userland/html.cpp +++ b/Userland/html.cpp @@ -32,7 +32,8 @@ #include <LibGUI/Menu.h> #include <LibGUI/MenuBar.h> #include <LibGUI/Window.h> -#include <LibWeb/InProcessWebView.h> +#include <LibGfx/Bitmap.h> +#include <LibWeb/OutOfProcessWebView.h> #include <stdio.h> int main(int argc, char** argv) @@ -57,12 +58,12 @@ int main(int argc, char** argv) auto html = f->read_all(); auto window = GUI::Window::construct(); - auto& widget = window->set_main_widget<Web::InProcessWebView>(); + window->set_title("HTML"); + auto& widget = window->set_main_widget<Web::OutOfProcessWebView>(); + widget.on_title_change = [&](auto& title) { + window->set_title(String::formatted("{} - HTML", title)); + }; widget.load_html(html, url); - if (!widget.document()->title().is_null()) - window->set_title(String::format("%s - HTML", widget.document()->title().characters())); - else - window->set_title("HTML"); window->show(); auto menubar = GUI::MenuBar::construct(); |