diff --git a/Userland/Libraries/LibWebView/ViewImplementation.h b/Userland/Libraries/LibWebView/ViewImplementation.h index 7729d710867..d1be505062b 100644 --- a/Userland/Libraries/LibWebView/ViewImplementation.h +++ b/Userland/Libraries/LibWebView/ViewImplementation.h @@ -161,6 +161,7 @@ public: Function on_finish_handling_input_event; Function on_text_test_finish; Function on_theme_color_change; + Function on_insert_clipboard_entry; virtual Gfx::IntRect viewport_rect() const = 0; virtual Gfx::IntPoint to_content_position(Gfx::IntPoint widget_position) const = 0; diff --git a/Userland/Libraries/LibWebView/WebContentClient.cpp b/Userland/Libraries/LibWebView/WebContentClient.cpp index 41ce3cb42ce..7abf36d07b3 100644 --- a/Userland/Libraries/LibWebView/WebContentClient.cpp +++ b/Userland/Libraries/LibWebView/WebContentClient.cpp @@ -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); +} + } diff --git a/Userland/Libraries/LibWebView/WebContentClient.h b/Userland/Libraries/LibWebView/WebContentClient.h index 57864a0e0b5..da13ceade39 100644 --- a/Userland/Libraries/LibWebView/WebContentClient.h +++ b/Userland/Libraries/LibWebView/WebContentClient.h @@ -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; }; diff --git a/Userland/Services/WebContent/PageHost.cpp b/Userland/Services/WebContent/PageHost.cpp index 83bf434c759..3f955f7c016 100644 --- a/Userland/Services/WebContent/PageHost.cpp +++ b/Userland/Services/WebContent/PageHost.cpp @@ -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)); +} + } diff --git a/Userland/Services/WebContent/PageHost.h b/Userland/Services/WebContent/PageHost.h index 5b00bc017c2..b47ee99ab56 100644 --- a/Userland/Services/WebContent/PageHost.h +++ b/Userland/Services/WebContent/PageHost.h @@ -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&); diff --git a/Userland/Services/WebContent/WebContentClient.ipc b/Userland/Services/WebContent/WebContentClient.ipc index 4648ee1dbbc..a90c91f4952 100644 --- a/Userland/Services/WebContent/WebContentClient.ipc +++ b/Userland/Services/WebContent/WebContentClient.ipc @@ -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 message_types, Vector messages) =|