1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2026-01-21 06:50:59 +00:00
serenity/Userland/Applications/BrowserSettings/Defaults.h
Timothy Flynn 05c8d5ba57 Base+Ladybird: Move Ladybird-related HTML files to their own folder
Pages like the new tab page, error page, etc. all belong solely to
Ladybird, but are scattered across a couple of subfolders in Base. This
moves them all to Base/res/ladybird.
2023-12-04 19:46:35 -05:00

43 lines
1.3 KiB
C++

/*
* Copyright (c) 2023, Ben Wiederhake <BenWiederhake.GitHub@gmx.de>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/String.h>
#include <AK/StringView.h>
#include <LibCore/Resource.h>
namespace Browser {
static constexpr StringView default_color_scheme = "auto"sv;
static constexpr bool default_enable_content_filters = true;
static constexpr bool default_show_bookmarks_bar = true;
static constexpr bool default_close_download_widget_on_finish = false;
static constexpr bool default_allow_autoplay_on_all_websites = false;
inline String const& default_homepage_url()
{
// FIXME: Teach LibWeb how to load resource:// URLs, rather than converting to a file:// URL here.
static auto default_homepage_url = []() {
static constexpr auto url = "resource://html/misc/welcome.html"sv;
return MUST(Core::Resource::load_from_uri(url))->file_url();
}();
return default_homepage_url;
}
inline String const& default_new_tab_url()
{
// FIXME: Teach LibWeb how to load resource:// URLs, rather than converting to a file:// URL here.
static auto default_new_tab_url = []() {
static constexpr auto url = "resource://ladybird/new-tab.html"sv;
return MUST(Core::Resource::load_from_uri(url))->file_url();
}();
return default_new_tab_url;
}
}