mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:07:34 +00:00
LibWeb: Add Page abstraction between PageView and main Frame
* A PageView is a view onto a Page object. * A Page always has a main Frame (root of Frame tree.) * Page has a PageClient. PageView is a PageClient. The goal here is to allow building another kind of view onto a Page while keeping the rest of LibWeb intact.
This commit is contained in:
parent
5072d4e02d
commit
92392398a2
16 changed files with 351 additions and 179 deletions
|
@ -130,7 +130,7 @@ Tab::Tab()
|
|||
m_bookmark_button->set_preferred_size(22, 22);
|
||||
|
||||
m_bookmark_button->on_click = [this](auto) {
|
||||
auto url = m_page_view->main_frame().document()->url().to_string();
|
||||
auto url = m_page_view->document()->url().to_string();
|
||||
if (BookmarksBarWidget::the().contains_bookmark(url)) {
|
||||
BookmarksBarWidget::the().remove_bookmark(url);
|
||||
} else {
|
||||
|
@ -195,7 +195,7 @@ Tab::Tab()
|
|||
|
||||
m_page_view->on_title_change = [this](auto& title) {
|
||||
if (title.is_null()) {
|
||||
m_title = m_page_view->main_frame().document()->url().to_string();
|
||||
m_title = m_page_view->document()->url().to_string();
|
||||
} else {
|
||||
m_title = title;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue