mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
LibWebView+WebContent: Add IPC to update a document's cookie
This commit is contained in:
parent
18abc6c85d
commit
d202999853
6 changed files with 16 additions and 0 deletions
|
@ -409,6 +409,12 @@ void OutOfProcessWebView::notify_server_did_set_cookie(Badge<WebContentClient>,
|
|||
on_set_cookie(url, cookie, source);
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::notify_server_did_update_cookie(Badge<WebContentClient>, AK::URL const& url, Web::Cookie::Cookie const& cookie)
|
||||
{
|
||||
if (on_update_cookie)
|
||||
on_update_cookie(url, cookie);
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::notify_server_did_update_resource_count(i32 count_waiting)
|
||||
{
|
||||
if (on_resource_status_change)
|
||||
|
|
|
@ -96,6 +96,7 @@ public:
|
|||
Function<Optional<Web::Cookie::Cookie>(AK::URL const& url, String const& name)> on_get_named_cookie;
|
||||
Function<String(const AK::URL& url, Web::Cookie::Source source)> on_get_cookie;
|
||||
Function<void(const AK::URL& url, Web::Cookie::ParsedCookie const& cookie, Web::Cookie::Source source)> on_set_cookie;
|
||||
Function<void(AK::URL const& url, Web::Cookie::Cookie const& cookie)> on_update_cookie;
|
||||
Function<void(i32 count_waiting)> on_resource_status_change;
|
||||
Function<void()> on_restore_window;
|
||||
Function<Gfx::IntPoint(Gfx::IntPoint const&)> on_reposition_window;
|
||||
|
@ -160,6 +161,7 @@ private:
|
|||
virtual Optional<Web::Cookie::Cookie> notify_server_did_request_named_cookie(Badge<WebContentClient>, AK::URL const& url, String const& name) override;
|
||||
virtual String notify_server_did_request_cookie(Badge<WebContentClient>, const AK::URL& url, Web::Cookie::Source source) override;
|
||||
virtual void notify_server_did_set_cookie(Badge<WebContentClient>, const AK::URL& url, Web::Cookie::ParsedCookie const& cookie, Web::Cookie::Source source) override;
|
||||
virtual void notify_server_did_update_cookie(Badge<WebContentClient>, AK::URL const& url, Web::Cookie::Cookie const& cookie) override;
|
||||
virtual void notify_server_did_update_resource_count(i32 count_waiting) override;
|
||||
virtual void notify_server_did_request_restore_window() override;
|
||||
virtual Gfx::IntPoint notify_server_did_request_reposition_window(Gfx::IntPoint const&) override;
|
||||
|
|
|
@ -51,6 +51,7 @@ public:
|
|||
virtual Optional<Web::Cookie::Cookie> notify_server_did_request_named_cookie(Badge<WebContentClient>, AK::URL const& url, String const& name) = 0;
|
||||
virtual String notify_server_did_request_cookie(Badge<WebContentClient>, const AK::URL& url, Web::Cookie::Source source) = 0;
|
||||
virtual void notify_server_did_set_cookie(Badge<WebContentClient>, const AK::URL& url, Web::Cookie::ParsedCookie const& cookie, Web::Cookie::Source source) = 0;
|
||||
virtual void notify_server_did_update_cookie(Badge<WebContentClient>, AK::URL const& url, Web::Cookie::Cookie const& cookie) = 0;
|
||||
virtual void notify_server_did_update_resource_count(i32 count_waiting) = 0;
|
||||
virtual void notify_server_did_request_restore_window() = 0;
|
||||
virtual Gfx::IntPoint notify_server_did_request_reposition_window(Gfx::IntPoint const&) = 0;
|
||||
|
|
|
@ -205,6 +205,11 @@ void WebContentClient::did_set_cookie(AK::URL const& url, Web::Cookie::ParsedCoo
|
|||
m_view.notify_server_did_set_cookie({}, url, cookie, static_cast<Web::Cookie::Source>(source));
|
||||
}
|
||||
|
||||
void WebContentClient::did_update_cookie(AK::URL const& url, Web::Cookie::Cookie const& cookie)
|
||||
{
|
||||
m_view.notify_server_did_update_cookie({}, url, cookie);
|
||||
}
|
||||
|
||||
void WebContentClient::did_update_resource_count(i32 count_waiting)
|
||||
{
|
||||
m_view.notify_server_did_update_resource_count(count_waiting);
|
||||
|
|
|
@ -62,6 +62,7 @@ private:
|
|||
virtual Messages::WebContentClient::DidRequestNamedCookieResponse did_request_named_cookie(AK::URL const&, String const&) override;
|
||||
virtual Messages::WebContentClient::DidRequestCookieResponse did_request_cookie(AK::URL const&, u8) override;
|
||||
virtual void did_set_cookie(AK::URL const&, Web::Cookie::ParsedCookie const&, u8) override;
|
||||
virtual void did_update_cookie(AK::URL const&, Web::Cookie::Cookie const&) override;
|
||||
virtual void did_update_resource_count(i32 count_waiting) override;
|
||||
virtual void did_request_restore_window() override;
|
||||
virtual Messages::WebContentClient::DidRequestRepositionWindowResponse did_request_reposition_window(Gfx::IntPoint const&) override;
|
||||
|
|
|
@ -40,6 +40,7 @@ endpoint WebContentClient
|
|||
did_request_named_cookie(URL url, String name) => (Optional<Web::Cookie::Cookie> cookie)
|
||||
did_request_cookie(URL url, u8 source) => (String cookie)
|
||||
did_set_cookie(URL url, Web::Cookie::ParsedCookie cookie, u8 source) =|
|
||||
did_update_cookie(URL url, Web::Cookie::Cookie cookie) =|
|
||||
did_update_resource_count(i32 count_waiting) =|
|
||||
did_request_restore_window() =|
|
||||
did_request_reposition_window(Gfx::IntPoint position) => (Gfx::IntPoint window_position)
|
||||
|
|
Loading…
Reference in a new issue