mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 19:19:30 +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
|
@ -26,8 +26,9 @@
|
|||
|
||||
namespace WebView {
|
||||
|
||||
class Application : public DevTools::DevToolsDelegate
|
||||
, public SettingsObserver {
|
||||
struct ApplicationSettingsObserver;
|
||||
|
||||
class Application : public DevTools::DevToolsDelegate {
|
||||
AK_MAKE_NONCOPYABLE(Application);
|
||||
|
||||
public:
|
||||
|
@ -129,12 +130,10 @@ private:
|
|||
virtual void stop_listening_for_console_messages(DevTools::TabDescription const&) const override;
|
||||
virtual void request_console_messages(DevTools::TabDescription const&, i32) const override;
|
||||
|
||||
// ^SettingsObserver
|
||||
virtual void dns_settings_changed() override;
|
||||
|
||||
static Application* s_the;
|
||||
|
||||
Settings m_settings;
|
||||
OwnPtr<ApplicationSettingsObserver> m_settings_observer;
|
||||
|
||||
BrowserOptions m_browser_options;
|
||||
WebContentOptions m_web_content_options;
|
||||
|
@ -156,6 +155,7 @@ private:
|
|||
|
||||
OwnPtr<DevTools::DevToolsServer> m_devtools;
|
||||
} SWIFT_IMMORTAL_REFERENCE;
|
||||
|
||||
}
|
||||
|
||||
#define WEB_VIEW_APPLICATION(ApplicationType) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue