LibWebView: Add autocomplete settings to about:settings

This implements an autocomplete engine inside LibWebView, to replace the
engine currently used by Qt. Whereas Qt uses the Qt Network framework to
perform autocomplete requests, LibWebView uses RequestServer. This moves
downloading this untrusted data out of the browser process.

This patch only implements the persisted settings and their UI. It does
not integrate this engine into the browser UI.
This commit is contained in:
Timothy Flynn 2025-03-30 16:21:24 -04:00 committed by Tim Flynn
commit 5d2e6ffe30
Notes: github-actions[bot] 2025-04-02 12:53:55 +00:00
9 changed files with 432 additions and 66 deletions

View file

@ -11,6 +11,7 @@
#include <AK/JsonValue.h>
#include <AK/Optional.h>
#include <LibURL/URL.h>
#include <LibWebView/Autocomplete.h>
#include <LibWebView/Forward.h>
#include <LibWebView/SearchEngine.h>
@ -30,6 +31,7 @@ public:
virtual void new_tab_page_url_changed() { }
virtual void search_engine_changed() { }
virtual void autocomplete_engine_changed() { }
virtual void autoplay_settings_changed() { }
};
@ -47,6 +49,9 @@ public:
Optional<SearchEngine> const& search_engine() const { return m_search_engine; }
void set_search_engine(Optional<StringView> search_engine_name);
Optional<AutocompleteEngine> const& autocomplete_engine() const { return m_autocomplete_engine; }
void set_autocomplete_engine(Optional<StringView> autocomplete_engine_name);
SiteSetting const& autoplay_settings() const { return m_autoplay; }
void set_autoplay_enabled_globally(bool);
void add_autoplay_site_filter(String const&);
@ -65,6 +70,7 @@ private:
URL::URL m_new_tab_page_url;
Optional<SearchEngine> m_search_engine;
Optional<AutocompleteEngine> m_autocomplete_engine;
SiteSetting m_autoplay;
Vector<SettingsObserver&> m_observers;