diff options
Diffstat (limited to 'Userland/Libraries/LibWebView')
5 files changed, 32 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp index f05acd7f7f..7e6422e869 100644 --- a/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp +++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.cpp @@ -421,6 +421,20 @@ Gfx::IntSize OutOfProcessWebView::notify_server_did_request_resize_window(Gfx::I return {}; } +Gfx::IntRect OutOfProcessWebView::notify_server_did_request_maximize_window() +{ + if (on_maximize_window) + return on_maximize_window(); + return {}; +} + +Gfx::IntRect OutOfProcessWebView::notify_server_did_request_minimize_window() +{ + if (on_minimize_window) + return on_minimize_window(); + return {}; +} + void OutOfProcessWebView::notify_server_did_request_file(Badge<WebContentClient>, String const& path, i32 request_id) { auto file = FileSystemAccessClient::Client::the().try_request_file_read_only_approved(window(), path); diff --git a/Userland/Libraries/LibWebView/OutOfProcessWebView.h b/Userland/Libraries/LibWebView/OutOfProcessWebView.h index 830c86c96d..269c5d3313 100644 --- a/Userland/Libraries/LibWebView/OutOfProcessWebView.h +++ b/Userland/Libraries/LibWebView/OutOfProcessWebView.h @@ -115,6 +115,8 @@ public: Function<void()> on_restore_window; Function<Gfx::IntPoint(Gfx::IntPoint const&)> on_reposition_window; Function<Gfx::IntSize(Gfx::IntSize const&)> on_resize_window; + Function<Gfx::IntRect()> on_maximize_window; + Function<Gfx::IntRect()> on_minimize_window; private: OutOfProcessWebView(); @@ -175,6 +177,8 @@ private: virtual void notify_server_did_request_restore_window() override; virtual Gfx::IntPoint notify_server_did_request_reposition_window(Gfx::IntPoint const&) override; virtual Gfx::IntSize notify_server_did_request_resize_window(Gfx::IntSize const&) override; + virtual Gfx::IntRect notify_server_did_request_maximize_window() override; + virtual Gfx::IntRect notify_server_did_request_minimize_window() override; virtual void notify_server_did_request_file(Badge<WebContentClient>, String const& path, i32) override; void request_repaint(); diff --git a/Userland/Libraries/LibWebView/ViewImplementation.h b/Userland/Libraries/LibWebView/ViewImplementation.h index 306442428a..6294114da7 100644 --- a/Userland/Libraries/LibWebView/ViewImplementation.h +++ b/Userland/Libraries/LibWebView/ViewImplementation.h @@ -53,6 +53,8 @@ public: virtual void notify_server_did_request_restore_window() = 0; virtual Gfx::IntPoint notify_server_did_request_reposition_window(Gfx::IntPoint const&) = 0; virtual Gfx::IntSize notify_server_did_request_resize_window(Gfx::IntSize const&) = 0; + virtual Gfx::IntRect notify_server_did_request_maximize_window() = 0; + virtual Gfx::IntRect notify_server_did_request_minimize_window() = 0; virtual void notify_server_did_request_file(Badge<WebContentClient>, String const& path, i32) = 0; }; diff --git a/Userland/Libraries/LibWebView/WebContentClient.cpp b/Userland/Libraries/LibWebView/WebContentClient.cpp index 9edadcdab4..c5bb0a8afd 100644 --- a/Userland/Libraries/LibWebView/WebContentClient.cpp +++ b/Userland/Libraries/LibWebView/WebContentClient.cpp @@ -215,6 +215,16 @@ Messages::WebContentClient::DidRequestResizeWindowResponse WebContentClient::did return m_view.notify_server_did_request_resize_window(size); } +Messages::WebContentClient::DidRequestMaximizeWindowResponse WebContentClient::did_request_maximize_window() +{ + return m_view.notify_server_did_request_maximize_window(); +} + +Messages::WebContentClient::DidRequestMinimizeWindowResponse WebContentClient::did_request_minimize_window() +{ + return m_view.notify_server_did_request_minimize_window(); +} + void WebContentClient::did_request_file(String const& path, i32 request_id) { m_view.notify_server_did_request_file({}, path, request_id); diff --git a/Userland/Libraries/LibWebView/WebContentClient.h b/Userland/Libraries/LibWebView/WebContentClient.h index 9c4c26926d..b8ee9f4ab5 100644 --- a/Userland/Libraries/LibWebView/WebContentClient.h +++ b/Userland/Libraries/LibWebView/WebContentClient.h @@ -64,6 +64,8 @@ private: virtual void did_request_restore_window() override; virtual Messages::WebContentClient::DidRequestRepositionWindowResponse did_request_reposition_window(Gfx::IntPoint const&) override; virtual Messages::WebContentClient::DidRequestResizeWindowResponse did_request_resize_window(Gfx::IntSize const&) override; + virtual Messages::WebContentClient::DidRequestMaximizeWindowResponse did_request_maximize_window() override; + virtual Messages::WebContentClient::DidRequestMinimizeWindowResponse did_request_minimize_window() override; virtual void did_request_file(String const& path, i32) override; ViewImplementation& m_view; |