mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-18 08:20:44 +00:00
LibWeb+LibWebView+WebContent: Convert about:settings to a WebUI
Some checks are pending
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
This commit is contained in:
parent
c75e40180c
commit
f05b0bfd5f
Notes:
github-actions[bot]
2025-03-28 11:32:05 +00:00
Author: https://github.com/trflynn89
Commit: f05b0bfd5f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4068
23 changed files with 151 additions and 264 deletions
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Tim Flynn <trflynn89@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibURL/Parser.h>
|
||||
#include <LibURL/URL.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Bindings/SettingsPrototype.h>
|
||||
#include <LibWeb/Internals/Settings.h>
|
||||
#include <LibWeb/Page/Page.h>
|
||||
|
||||
namespace Web::Internals {
|
||||
|
||||
GC_DEFINE_ALLOCATOR(Settings);
|
||||
|
||||
Settings::Settings(JS::Realm& realm)
|
||||
: InternalsBase(realm)
|
||||
{
|
||||
}
|
||||
|
||||
Settings::~Settings() = default;
|
||||
|
||||
void Settings::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(Settings);
|
||||
}
|
||||
|
||||
void Settings::load_current_settings()
|
||||
{
|
||||
page().client().request_current_settings();
|
||||
}
|
||||
|
||||
void Settings::restore_default_settings()
|
||||
{
|
||||
page().client().restore_default_settings();
|
||||
}
|
||||
|
||||
void Settings::set_new_tab_page_url(String const& new_tab_page_url)
|
||||
{
|
||||
if (auto parsed_new_tab_page_url = URL::Parser::basic_parse(new_tab_page_url); parsed_new_tab_page_url.has_value())
|
||||
page().client().set_new_tab_page_url(*parsed_new_tab_page_url);
|
||||
}
|
||||
|
||||
void Settings::load_available_search_engines()
|
||||
{
|
||||
page().client().request_available_search_engines();
|
||||
}
|
||||
|
||||
void Settings::set_search_engine(Optional<String> const& search_engine)
|
||||
{
|
||||
page().client().set_search_engine(search_engine);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Tim Flynn <trflynn89@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/Internals/InternalsBase.h>
|
||||
|
||||
namespace Web::Internals {
|
||||
|
||||
class Settings final : public InternalsBase {
|
||||
WEB_PLATFORM_OBJECT(Settings, InternalsBase);
|
||||
GC_DECLARE_ALLOCATOR(Settings);
|
||||
|
||||
public:
|
||||
virtual ~Settings() override;
|
||||
|
||||
void load_current_settings();
|
||||
void restore_default_settings();
|
||||
|
||||
void set_new_tab_page_url(String const& new_tab_page_url);
|
||||
|
||||
void load_available_search_engines();
|
||||
void set_search_engine(Optional<String> const& search_engine);
|
||||
|
||||
private:
|
||||
explicit Settings(JS::Realm&);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
[Exposed=Nobody]
|
||||
interface Settings {
|
||||
undefined loadCurrentSettings();
|
||||
undefined restoreDefaultSettings();
|
||||
|
||||
undefined setNewTabPageURL(USVString newTabPageURL);
|
||||
|
||||
undefined loadAvailableSearchEngines();
|
||||
undefined setSearchEngine(DOMString? search_engine);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue