mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:14:58 +00:00
Ladybird+LibWeb+WebContent: Generalize video context menus for all media
The data we want to send out of the WebContent process is identical for audio and video elements. Rather than just duplicating all of this for audio, generalize the names used for this IPC for all media elements. This also encapsulates that data into a struct. This makes adding new fields to be sent much easier (such as an upcoming field for muting the element).
This commit is contained in:
parent
e81abbde7b
commit
14ca04de25
17 changed files with 198 additions and 147 deletions
|
@ -176,10 +176,10 @@ void WebContentClient::did_request_image_context_menu(Gfx::IntPoint content_posi
|
|||
m_view.on_image_context_menu_request(url, m_view.to_widget_position(content_position), bitmap);
|
||||
}
|
||||
|
||||
void WebContentClient::did_request_video_context_menu(Gfx::IntPoint content_position, AK::URL const& url, DeprecatedString const&, unsigned, bool is_playing, bool has_user_agent_controls, bool is_looping)
|
||||
void WebContentClient::did_request_media_context_menu(Gfx::IntPoint content_position, DeprecatedString const&, unsigned, Web::Page::MediaContextMenu const& menu)
|
||||
{
|
||||
if (m_view.on_video_context_menu_request)
|
||||
m_view.on_video_context_menu_request(url, m_view.to_widget_position(content_position), is_playing, has_user_agent_controls, is_looping);
|
||||
if (m_view.on_media_context_menu_request)
|
||||
m_view.on_media_context_menu_request(m_view.to_widget_position(content_position), menu);
|
||||
}
|
||||
|
||||
void WebContentClient::did_get_source(AK::URL const& url, DeprecatedString const& source)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue