mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWebView: Store the tab title on the ViewImplementation
This will be needed for DevTools, to avoid the need to go into the UI layer for this information.
This commit is contained in:
parent
3904765c4f
commit
49c93d01db
Notes:
github-actions[bot]
2025-02-19 13:47:30 +00:00
Author: https://github.com/trflynn89
Commit: 49c93d01db
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3589
Reviewed-by: https://github.com/ADKaster
2 changed files with 8 additions and 6 deletions
|
@ -142,13 +142,11 @@ void WebContentClient::did_change_title(u64 page_id, ByteString const& title)
|
|||
process->set_title(MUST(String::from_byte_string(title)));
|
||||
|
||||
if (auto view = view_for_page_id(page_id); view.has_value()) {
|
||||
if (!view->on_title_change)
|
||||
return;
|
||||
auto title_or_url = title.is_empty() ? view->url().to_byte_string() : title;
|
||||
view->set_title({}, title_or_url);
|
||||
|
||||
if (title.is_empty())
|
||||
view->on_title_change(view->url().to_byte_string());
|
||||
else
|
||||
view->on_title_change(title);
|
||||
if (view->on_title_change)
|
||||
view->on_title_change(title_or_url);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue