mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-13 03:29:49 +00:00
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:
parent
6539c72e7e
commit
6a6c56aabe
Notes:
github-actions[bot]
2025-04-24 00:00:00 +00:00
Author: https://github.com/trflynn89
Commit: 6a6c56aabe
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4445
4 changed files with 65 additions and 90 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue