diff --git a/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp b/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp index 0a1f899c51..9d78de522c 100644 --- a/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp +++ b/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp @@ -417,4 +417,9 @@ String OutOfProcessWebView::selected_text() return client().get_selected_text(); } +void OutOfProcessWebView::select_all() +{ + client().async_select_all(); +} + } diff --git a/Userland/Libraries/LibWeb/OutOfProcessWebView.h b/Userland/Libraries/LibWeb/OutOfProcessWebView.h index f90091210d..37d354b478 100644 --- a/Userland/Libraries/LibWeb/OutOfProcessWebView.h +++ b/Userland/Libraries/LibWeb/OutOfProcessWebView.h @@ -36,6 +36,7 @@ public: void js_console_input(const String& js_source); String selected_text(); + void select_all(); void notify_server_did_layout(Badge, const Gfx::IntSize& content_size); void notify_server_did_paint(Badge, i32 bitmap_id); diff --git a/Userland/Services/WebContent/ClientConnection.cpp b/Userland/Services/WebContent/ClientConnection.cpp index 3efcf3a6d0..4c7a4733fa 100644 --- a/Userland/Services/WebContent/ClientConnection.cpp +++ b/Userland/Services/WebContent/ClientConnection.cpp @@ -248,4 +248,10 @@ Messages::WebContentServer::GetSelectedTextResponse ClientConnection::get_select return page().focused_context().selected_text(); } +void ClientConnection::select_all() +{ + page().focused_context().select_all(); + page().client().page_did_change_selection(); +} + } diff --git a/Userland/Services/WebContent/ClientConnection.h b/Userland/Services/WebContent/ClientConnection.h index 2d87326497..0e6d59c437 100644 --- a/Userland/Services/WebContent/ClientConnection.h +++ b/Userland/Services/WebContent/ClientConnection.h @@ -52,6 +52,7 @@ private: virtual void js_console_initialize() override; virtual void js_console_input(String const&) override; virtual Messages::WebContentServer::GetSelectedTextResponse get_selected_text() override; + virtual void select_all() override; void flush_pending_paint_requests(); diff --git a/Userland/Services/WebContent/WebContentServer.ipc b/Userland/Services/WebContent/WebContentServer.ipc index cc966cddea..158f84364b 100644 --- a/Userland/Services/WebContent/WebContentServer.ipc +++ b/Userland/Services/WebContent/WebContentServer.ipc @@ -31,4 +31,5 @@ endpoint WebContentServer js_console_input(String js_source) =| get_selected_text() => (String selection) + select_all() =| }