mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibWeb+LibWebView+WebContent: Add an IPC call for Navigable::reload()
This commit is contained in:
committed by
Alexander Kalenik
parent
88f3145f8a
commit
bfef08177e
@@ -74,6 +74,11 @@ void Page::load_html(StringView html)
|
||||
.user_involvement = HTML::UserNavigationInvolvement::BrowserUI });
|
||||
}
|
||||
|
||||
void Page::reload()
|
||||
{
|
||||
top_level_traversable()->reload();
|
||||
}
|
||||
|
||||
Gfx::Palette Page::palette() const
|
||||
{
|
||||
return m_client->palette();
|
||||
|
||||
@@ -76,6 +76,8 @@ public:
|
||||
|
||||
void load_html(StringView);
|
||||
|
||||
void reload();
|
||||
|
||||
CSSPixelPoint device_to_css_point(DevicePixelPoint) const;
|
||||
DevicePixelPoint css_to_device_point(CSSPixelPoint) const;
|
||||
DevicePixelRect css_to_device_rect(CSSPixelRect) const;
|
||||
|
||||
@@ -90,6 +90,11 @@ void ViewImplementation::load_empty_document()
|
||||
load_html(""sv);
|
||||
}
|
||||
|
||||
void ViewImplementation::reload()
|
||||
{
|
||||
client().async_reload(page_id());
|
||||
}
|
||||
|
||||
void ViewImplementation::zoom_in()
|
||||
{
|
||||
if (m_zoom_level >= ZOOM_MAX_LEVEL)
|
||||
|
||||
@@ -49,6 +49,7 @@ public:
|
||||
void load(URL::URL const&);
|
||||
void load_html(StringView);
|
||||
void load_empty_document();
|
||||
void reload();
|
||||
|
||||
void zoom_in();
|
||||
void zoom_out();
|
||||
|
||||
@@ -156,6 +156,12 @@ void ConnectionFromClient::load_html(u64 page_id, ByteString const& html)
|
||||
page->page().load_html(html);
|
||||
}
|
||||
|
||||
void ConnectionFromClient::reload(u64 page_id)
|
||||
{
|
||||
if (auto page = this->page(page_id); page.has_value())
|
||||
page->page().reload();
|
||||
}
|
||||
|
||||
void ConnectionFromClient::set_viewport_rect(u64 page_id, Web::DevicePixelRect const& rect)
|
||||
{
|
||||
if (auto page = this->page(page_id); page.has_value())
|
||||
|
||||
@@ -57,6 +57,7 @@ private:
|
||||
virtual void update_screen_rects(u64 page_id, Vector<Web::DevicePixelRect> const&, u32) override;
|
||||
virtual void load_url(u64 page_id, URL::URL const&) override;
|
||||
virtual void load_html(u64 page_id, ByteString const&) override;
|
||||
virtual void reload(u64 page_id) override;
|
||||
virtual void set_viewport_rect(u64 page_id, Web::DevicePixelRect const&) override;
|
||||
virtual void key_event(u64 page_id, Web::KeyEvent const&) override;
|
||||
virtual void mouse_event(u64 page_id, Web::MouseEvent const&) override;
|
||||
|
||||
@@ -24,6 +24,7 @@ endpoint WebContentServer
|
||||
|
||||
load_url(u64 page_id, URL::URL url) =|
|
||||
load_html(u64 page_id, ByteString html) =|
|
||||
reload(u64 page_id) =|
|
||||
|
||||
add_backing_store(u64 page_id, i32 front_bitmap_id, Gfx::ShareableBitmap front_bitmap, i32 back_bitmap_id, Gfx::ShareableBitmap back_bitmap) =|
|
||||
ready_to_paint(u64 page_id) =|
|
||||
|
||||
Reference in New Issue
Block a user