mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +00:00
LibWeb+LibWebView+UI: Migrate to LibWebView's language settings
This commit is contained in:
parent
f242920cc9
commit
a3ea4881e7
Notes:
github-actions[bot]
2025-04-04 08:17:32 +00:00
Author: https://github.com/trflynn89
Commit: a3ea4881e7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4215
Reviewed-by: https://github.com/gmta ✅
13 changed files with 14 additions and 148 deletions
|
@ -252,11 +252,6 @@ void ViewImplementation::set_preferred_motion(Web::CSS::PreferredMotion motion)
|
|||
client().async_set_preferred_motion(page_id(), motion);
|
||||
}
|
||||
|
||||
void ViewImplementation::set_preferred_languages(ReadonlySpan<String> preferred_languages)
|
||||
{
|
||||
client().async_set_preferred_languages(page_id(), preferred_languages);
|
||||
}
|
||||
|
||||
ByteString ViewImplementation::selected_text()
|
||||
{
|
||||
return client().get_selected_text(page_id());
|
||||
|
@ -599,6 +594,7 @@ void ViewImplementation::initialize_client(CreateNewClient create_new_client)
|
|||
if (auto const& user_agent_preset = Application::web_content_options().user_agent_preset; user_agent_preset.has_value())
|
||||
client().async_debug_request(m_client_state.page_index, "spoof-user-agent"sv, *user_agents.get(*user_agent_preset));
|
||||
|
||||
languages_changed();
|
||||
autoplay_settings_changed();
|
||||
do_not_track_changed();
|
||||
}
|
||||
|
@ -648,6 +644,12 @@ void ViewImplementation::handle_web_content_process_crash(LoadErrorPage load_err
|
|||
}
|
||||
}
|
||||
|
||||
void ViewImplementation::languages_changed()
|
||||
{
|
||||
auto const& languages = Application::settings().languages();
|
||||
client().async_set_preferred_languages(page_id(), languages);
|
||||
}
|
||||
|
||||
void ViewImplementation::autoplay_settings_changed()
|
||||
{
|
||||
auto const& autoplay_settings = Application::settings().autoplay_settings();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue