mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:27:45 +00:00
LibWeb: Add a FrameLoader class and move PageView's loading logic there
Each Frame now has a FrameLoader which will be responsible for handling loading inside that frame.
This commit is contained in:
parent
0cbef87944
commit
075bd75859
7 changed files with 400 additions and 268 deletions
|
@ -30,8 +30,10 @@
|
|||
#include <AK/Noncopyable.h>
|
||||
#include <AK/RefPtr.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
#include <LibGfx/Size.h>
|
||||
#include <LibWeb/Loader/FrameLoader.h>
|
||||
#include <LibWeb/TreeNode.h>
|
||||
|
||||
namespace Web {
|
||||
|
@ -57,17 +59,29 @@ public:
|
|||
void set_size(const Gfx::Size&);
|
||||
|
||||
void set_needs_display(const Gfx::Rect&);
|
||||
|
||||
Function<void(const Gfx::Rect&)> on_set_needs_display;
|
||||
Function<void(const String&)> on_title_change;
|
||||
Function<void(const URL&)> on_load_start;
|
||||
Function<void(const Gfx::Bitmap&)> on_favicon_change;
|
||||
Function<void(Document*)> on_set_document;
|
||||
|
||||
void set_viewport_rect(const Gfx::Rect&);
|
||||
Gfx::Rect viewport_rect() const { return m_viewport_rect; }
|
||||
|
||||
void did_scroll(Badge<PageView>);
|
||||
|
||||
FrameLoader& loader() { return m_loader; }
|
||||
const FrameLoader& loader() const { return m_loader; }
|
||||
|
||||
void scroll_to_anchor(const String&);
|
||||
|
||||
private:
|
||||
Frame();
|
||||
explicit Frame(PageView&);
|
||||
|
||||
FrameLoader m_loader;
|
||||
|
||||
WeakPtr<PageView> m_page_view;
|
||||
RefPtr<Document> m_document;
|
||||
Gfx::Size m_size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue