mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:37:34 +00:00
Browser+LibWeb: Pave the way for using WebContentView in Browser
This commit sets everything up, but we still always instantiate a plain Web::PageView in Browser::Tab..
This commit is contained in:
parent
49b9a0a665
commit
d8be535579
6 changed files with 177 additions and 73 deletions
|
@ -368,9 +368,16 @@ void PageView::keydown_event(GUI::KeyEvent& event)
|
|||
event.accept();
|
||||
}
|
||||
|
||||
URL PageView::url() const
|
||||
{
|
||||
if (page().main_frame().document())
|
||||
return {};
|
||||
return page().main_frame().document()->url();
|
||||
}
|
||||
|
||||
void PageView::reload()
|
||||
{
|
||||
load(page().main_frame().document()->url());
|
||||
load(url());
|
||||
}
|
||||
|
||||
void PageView::load_html(const StringView& html, const URL& url)
|
||||
|
|
|
@ -43,6 +43,7 @@ WebContentView::~WebContentView()
|
|||
|
||||
void WebContentView::load(const URL& url)
|
||||
{
|
||||
m_url = url;
|
||||
client().post_message(Messages::WebContentServer::LoadURL(url));
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ class WebContentView final
|
|||
public:
|
||||
virtual ~WebContentView() override;
|
||||
|
||||
URL url() const { return m_url; }
|
||||
void load(const URL&);
|
||||
|
||||
void notify_server_did_layout(Badge<WebContentClient>, const Gfx::IntSize& content_size);
|
||||
|
@ -71,6 +72,8 @@ private:
|
|||
|
||||
WebContentClient& client();
|
||||
|
||||
URL m_url;
|
||||
|
||||
RefPtr<WebContentClient> m_client;
|
||||
RefPtr<Gfx::Bitmap> m_front_bitmap;
|
||||
RefPtr<Gfx::Bitmap> m_back_bitmap;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue