Skip to content

Commit

Permalink
WebContent+LibWebView: Add IPC call to reload top level traversable
Browse files Browse the repository at this point in the history
  • Loading branch information
kalenikaliaksandr committed Apr 15, 2023
1 parent 0a6bdf4 commit a9a737b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Userland/Libraries/LibWebView/ViewImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ void ViewImplementation::traverse_the_history_by_delta(i32 delta)
client().async_traverse_the_history_by_delta(delta);
}

void ViewImplementation::reload()
{
client().async_reload();
}

void ViewImplementation::load_empty_document()
{
load_html(""sv, {});
Expand Down
1 change: 1 addition & 0 deletions Userland/Libraries/LibWebView/ViewImplementation.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class ViewImplementation {
void load_html(StringView, AK::URL const&);
void load_empty_document();
void traverse_the_history_by_delta(i32);
void reload();

void zoom_in();
void zoom_out();
Expand Down
5 changes: 5 additions & 0 deletions Userland/Services/WebContent/ConnectionFromClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ void ConnectionFromClient::traverse_the_history_by_delta(i32 delta)
m_page_host->page().top_level_traversable()->traverse_the_history_by_delta(delta);
}

void ConnectionFromClient::reload()
{
m_page_host->page().top_level_traversable()->reload();
}

void ConnectionFromClient::set_viewport_rect(Gfx::IntRect const& rect)
{
dbgln_if(SPAM_DEBUG, "handle: WebContentServer::SetViewportRect: rect={}", rect);
Expand Down
1 change: 1 addition & 0 deletions Userland/Services/WebContent/ConnectionFromClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class ConnectionFromClient final
virtual void load_url(URL const&) override;
virtual void load_html(DeprecatedString const&, URL const&) override;
virtual void traverse_the_history_by_delta(i32) override;
virtual void reload() override;
virtual void paint(Gfx::IntRect const&, i32) override;
virtual void set_viewport_rect(Gfx::IntRect const&) override;
virtual void mouse_down(Gfx::IntPoint, unsigned, unsigned, unsigned) override;
Expand Down
1 change: 1 addition & 0 deletions Userland/Services/WebContent/WebContentServer.ipc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ endpoint WebContentServer
load_url(URL url) =|
load_html(DeprecatedString html, URL url) =|
traverse_the_history_by_delta(i32 delta) =|
reload() =|

add_backing_store(i32 backing_store_id, Gfx::ShareableBitmap bitmap) =|
remove_backing_store(i32 backing_store_id) =|
Expand Down

0 comments on commit a9a737b

Please sign in to comment.