LibWebView+UI: Add an Application method to open a URL in a new tab

This lets us avoid each UI needing to handle link clicks directly, and
lets actions stored in LibWebView avoid awkwardly going through the link
click callbacks to open URLs.
This commit is contained in:
Timothy Flynn 2025-09-13 09:08:24 -04:00 committed by Tim Flynn
parent c2365653a5
commit ce331cbcd5
Notes: github-actions[bot] 2025-09-18 11:28:58 +00:00
20 changed files with 62 additions and 170 deletions

View file

@ -21,6 +21,7 @@
#include <LibWeb/CSS/PreferredColorScheme.h>
#include <LibWeb/CSS/PreferredContrast.h>
#include <LibWeb/CSS/PreferredMotion.h>
#include <LibWeb/HTML/ActivateTab.h>
#include <LibWebView/Forward.h>
#include <LibWebView/Options.h>
#include <LibWebView/Process.h>
@ -56,7 +57,10 @@ public:
static ProcessManager& process_manager() { return *the().m_process_manager; }
ErrorOr<NonnullRefPtr<WebContentClient>> launch_web_content_process(ViewImplementation&);
virtual Optional<ViewImplementation&> active_web_view() const { return {}; }
virtual Optional<ViewImplementation&> open_blank_new_tab(Web::HTML::ActivateTab) const { return {}; }
void open_url_in_new_tab(URL::URL const&, Web::HTML::ActivateTab) const;
void add_child_process(Process&&);