mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 02:55:49 +03:00
LibWebView+WebContent: Add an IPC hook to insert data into the clipboard
This commit is contained in:
parent
4b94b0b561
commit
306850652f
Notes:
sideshowbarker
2024-07-17 18:08:55 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/306850652f Pull-request: https://github.com/SerenityOS/serenity/pull/21878
@ -161,6 +161,7 @@ public:
|
||||
Function<void(bool)> on_finish_handling_input_event;
|
||||
Function<void()> on_text_test_finish;
|
||||
Function<void(Gfx::Color)> on_theme_color_change;
|
||||
Function<void(String const&, String const&, String const&)> on_insert_clipboard_entry;
|
||||
|
||||
virtual Gfx::IntRect viewport_rect() const = 0;
|
||||
virtual Gfx::IntPoint to_content_position(Gfx::IntPoint widget_position) const = 0;
|
||||
|
@ -402,4 +402,10 @@ void WebContentClient::did_change_theme_color(Gfx::Color color)
|
||||
m_view.on_theme_color_change(color);
|
||||
}
|
||||
|
||||
void WebContentClient::did_insert_clipboard_entry(String const& data, String const& presentation_style, String const& mime_type)
|
||||
{
|
||||
if (m_view.on_insert_clipboard_entry)
|
||||
m_view.on_insert_clipboard_entry(data, presentation_style, mime_type);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -86,6 +86,7 @@ private:
|
||||
virtual void did_finish_handling_input_event(bool event_was_accepted) override;
|
||||
virtual void did_finish_text_test() override;
|
||||
virtual void did_change_theme_color(Gfx::Color color) override;
|
||||
virtual void did_insert_clipboard_entry(String const& data, String const& presentation_style, String const& mime_type) override;
|
||||
|
||||
ViewImplementation& m_view;
|
||||
};
|
||||
|
@ -499,4 +499,9 @@ void PageHost::page_did_change_theme_color(Gfx::Color color)
|
||||
m_client.async_did_change_theme_color(color);
|
||||
}
|
||||
|
||||
void PageHost::page_did_insert_clipboard_entry(String data, String presentation_style, String mime_type)
|
||||
{
|
||||
m_client.async_did_insert_clipboard_entry(move(data), move(presentation_style), move(mime_type));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -120,6 +120,7 @@ private:
|
||||
virtual void page_did_request_color_picker(Color current_color) override;
|
||||
virtual void page_did_finish_text_test() override;
|
||||
virtual void page_did_change_theme_color(Gfx::Color color) override;
|
||||
virtual void page_did_insert_clipboard_entry(String data, String presentation_style, String mime_type) override;
|
||||
|
||||
explicit PageHost(ConnectionFromClient&);
|
||||
|
||||
|
@ -63,6 +63,7 @@ endpoint WebContentClient
|
||||
did_request_color_picker(Color current_color) =|
|
||||
did_finish_handling_input_event(bool event_was_accepted) =|
|
||||
did_change_theme_color(Gfx::Color color) =|
|
||||
did_insert_clipboard_entry(String data, String presentation_style, String mime_type) =|
|
||||
|
||||
did_output_js_console_message(i32 message_index) =|
|
||||
did_get_js_console_messages(i32 start_index, Vector<DeprecatedString> message_types, Vector<DeprecatedString> messages) =|
|
||||
|
Loading…
Reference in New Issue
Block a user