mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 04:08:08 +00:00
LibWeb+LibWebView+WebContent: Inform chromes when audio is played/paused
Most browsers have some indicator when audio is playing in a tab, which makes it easier to find that tab and mute unwanted audio. This adds an IPC to allow the Ladybird chromes to do something similar.
This commit is contained in:
committed by
Andreas Kling
parent
5424135d81
commit
40c0dd81d2
@@ -870,6 +870,18 @@ void WebContentClient::did_insert_clipboard_entry(u64 page_id, String const& dat
|
||||
view.on_insert_clipboard_entry(data, presentation_style, mime_type);
|
||||
}
|
||||
|
||||
void WebContentClient::did_change_audio_play_state(u64 page_id, Web::HTML::AudioPlayState play_state)
|
||||
{
|
||||
auto maybe_view = m_views.get(page_id);
|
||||
if (!maybe_view.has_value()) {
|
||||
dbgln("Received insert clipboard entry for unknown page ID {}", page_id);
|
||||
return;
|
||||
}
|
||||
|
||||
auto& view = *maybe_view.value();
|
||||
view.did_change_audio_play_state({}, play_state);
|
||||
}
|
||||
|
||||
void WebContentClient::inspector_did_load(u64 page_id)
|
||||
{
|
||||
auto maybe_view = m_views.get(page_id);
|
||||
|
||||
Reference in New Issue
Block a user