LibWeb+WebContent: Provide feedback on find in page requests

This change allows the results of a find in page query to be reported
back to the user interface. Currently, the number of results found and
the current match index are reported.
This commit is contained in:
Tim Ledbetter 2024-06-09 18:35:32 +01:00 committed by Tim Flynn
parent 6957b87ac2
commit d33c4c751f
Notes: sideshowbarker 2024-07-16 22:18:54 +09:00
7 changed files with 46 additions and 12 deletions

View file

@ -78,6 +78,14 @@ void WebContentClient::did_finish_text_test(u64 page_id)
}
}
void WebContentClient::did_find_in_page(u64 page_id, size_t current_match_index, Optional<size_t> const& total_match_count)
{
if (auto view = view_for_page_id(page_id); view.has_value()) {
if (view->on_find_in_page)
view->on_find_in_page(current_match_index, total_match_count);
}
}
void WebContentClient::did_request_navigate_back(u64 page_id)
{
if (auto view = view_for_page_id(page_id); view.has_value()) {