LibWebView: Create a dedicated settings observer for the Application

We had a bit of an awkward setup where we want the Application to be a
SettingsObserver, but neither the Settings object nor the Application
itself was fully initialized by the time the observer was created. So
we invented a deferred observer initializer specifically for the
Application.

Instead, let's just create a dedicated observer subclass that is owned
by the Application. We can then create it once we have the singleton
Application appropriately set up.
This commit is contained in:
Timothy Flynn 2025-04-23 12:37:05 -04:00 committed by Tim Flynn
commit 6a6c56aabe
Notes: github-actions[bot] 2025-04-24 00:00:00 +00:00
4 changed files with 65 additions and 90 deletions

View file

@ -32,11 +32,7 @@ enum class DoNotTrack {
class SettingsObserver {
public:
enum class AddToObservers {
No,
Yes,
};
explicit SettingsObserver(AddToObservers = AddToObservers::Yes);
explicit SettingsObserver();
virtual ~SettingsObserver();
virtual void new_tab_page_url_changed() { }
@ -46,13 +42,6 @@ public:
virtual void autoplay_settings_changed() { }
virtual void do_not_track_changed() { }
virtual void dns_settings_changed() { }
protected:
void complete_delayed_registration();
void complete_delayed_unregistration();
private:
bool m_registration_was_delayed { false };
};
class Settings {