LibWebView+UI: Migrate some UI process init to LibWebView

No need to do this setup in every UI's main().
This commit is contained in:
Timothy Flynn 2025-06-10 19:20:46 -04:00 committed by Tim Flynn
commit 39da2d9a2f
Notes: github-actions[bot] 2025-06-11 11:27:28 +00:00
10 changed files with 80 additions and 91 deletions

View file

@ -711,14 +711,11 @@ static ErrorOr<int> run_tests(Core::AnonymousBuffer const& theme, Web::DevicePix
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
#if defined(LADYBIRD_BINARY_PATH)
WebView::platform_init(LADYBIRD_BINARY_PATH);
auto app = TRY(TestWeb::Application::create(arguments, LADYBIRD_BINARY_PATH));
#else
WebView::platform_init();
auto app = TRY(TestWeb::Application::create(arguments, OptionalNone {}));
#endif
auto app = TestWeb::Application::create(arguments);
TRY(app->launch_services());
auto theme_path = LexicalPath::join(WebView::s_ladybird_resource_root, "themes"sv, "Default.ini"sv);
auto theme = TRY(Gfx::load_system_theme(theme_path.string()));