1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 11:58:13 +00:00

LibWeb: Add OOPWV IPC for retrieving selected text

This commit is contained in:
Timothy Flynn 2021-07-14 08:32:55 -04:00 committed by Andreas Kling
parent 528574d958
commit 2fda6ce159
5 changed files with 15 additions and 0 deletions

View file

@ -412,4 +412,9 @@ void OutOfProcessWebView::js_console_input(const String& js_source)
client().async_js_console_input(js_source);
}
String OutOfProcessWebView::selected_text()
{
return client().get_selected_text();
}
}

View file

@ -35,6 +35,8 @@ public:
void js_console_initialize();
void js_console_input(const String& js_source);
String selected_text();
void notify_server_did_layout(Badge<WebContentClient>, const Gfx::IntSize& content_size);
void notify_server_did_paint(Badge<WebContentClient>, i32 bitmap_id);
void notify_server_did_invalidate_content_rect(Badge<WebContentClient>, const Gfx::IntRect&);

View file

@ -243,4 +243,9 @@ void ClientConnection::js_console_input(const String& js_source)
m_console_client->handle_input(js_source);
}
Messages::WebContentServer::GetSelectedTextResponse ClientConnection::get_selected_text()
{
return page().focused_context().selected_text();
}
}

View file

@ -51,6 +51,7 @@ private:
virtual void inspect_dom_tree() override;
virtual void js_console_initialize() override;
virtual void js_console_input(String const&) override;
virtual Messages::WebContentServer::GetSelectedTextResponse get_selected_text() override;
void flush_pending_paint_requests();

View file

@ -29,4 +29,6 @@ endpoint WebContentServer
inspect_dom_tree() =|
js_console_initialize() =|
js_console_input(String js_source) =|
get_selected_text() => (String selection)
}