mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 20:45:14 +00:00
LibWeb: Unbreak favicon notifications after Page refactoring
Favicon updates now get plumbed from FrameLoader to the PageClient.
This commit is contained in:
parent
e04d68a03a
commit
883dc9260d
Notes:
sideshowbarker
2024-07-19 05:44:39 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/883dc9260d8
5 changed files with 9 additions and 4 deletions
|
@ -60,8 +60,6 @@ public:
|
|||
|
||||
void set_needs_display(const Gfx::Rect&);
|
||||
|
||||
Function<void(const Gfx::Bitmap&)> on_favicon_change;
|
||||
|
||||
void set_viewport_rect(const Gfx::Rect&);
|
||||
Gfx::Rect viewport_rect() const { return m_viewport_rect; }
|
||||
|
||||
|
|
|
@ -172,8 +172,7 @@ bool FrameLoader::load(const URL& url)
|
|||
return;
|
||||
}
|
||||
dbg() << "Decoded favicon, " << bitmap->size();
|
||||
if (frame().on_favicon_change)
|
||||
frame().on_favicon_change(*bitmap);
|
||||
frame().page().client().page_did_change_favicon(*bitmap);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -82,6 +82,7 @@ public:
|
|||
virtual void page_did_unhover_link() { }
|
||||
virtual void page_did_request_scroll_to_anchor([[maybe_unused]] const String& fragment) { }
|
||||
virtual void page_did_invalidate(const Gfx::Rect&) { }
|
||||
virtual void page_did_change_favicon(const Gfx::Bitmap&) { }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -145,6 +145,12 @@ void PageView::page_did_invalidate(const Gfx::Rect&)
|
|||
update();
|
||||
}
|
||||
|
||||
void PageView::page_did_change_favicon(const Gfx::Bitmap& bitmap)
|
||||
{
|
||||
if (on_favicon_change)
|
||||
on_favicon_change(bitmap);
|
||||
}
|
||||
|
||||
void PageView::layout_and_sync_size()
|
||||
{
|
||||
if (!document())
|
||||
|
|
|
@ -105,6 +105,7 @@ private:
|
|||
virtual void page_did_unhover_link() override;
|
||||
virtual void page_did_request_scroll_to_anchor(const String& fragment) override;
|
||||
virtual void page_did_invalidate(const Gfx::Rect&) override;
|
||||
virtual void page_did_change_favicon(const Gfx::Bitmap&) override;
|
||||
|
||||
void layout_and_sync_size();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue