summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-11-01 14:55:53 -0400
committerLinus Groh <mail@linusgroh.de>2022-11-01 21:16:50 +0000
commit6aea60e6eecbeb078afc8fd9ba6b30aae3d07238 (patch)
tree6bbc4023d253b83fff0d6e3a1504cdb3994206b1 /Userland/Services
parentf7e747b68e5f5dd44f4fb9462ff8bf16a5630c0c (diff)
downloadserenity-6aea60e6eecbeb078afc8fd9ba6b30aae3d07238.zip
LibWeb+LibWebView+WebContent: Add IPC to receive window position/size
This information will have to come from the Browser application. This adds IPCs to receive that information when it is available or changes.
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/WebContent/ConnectionFromClient.cpp10
-rw-r--r--Userland/Services/WebContent/ConnectionFromClient.h2
-rw-r--r--Userland/Services/WebContent/PageHost.cpp10
-rw-r--r--Userland/Services/WebContent/PageHost.h2
-rw-r--r--Userland/Services/WebContent/WebContentServer.ipc3
5 files changed, 27 insertions, 0 deletions
diff --git a/Userland/Services/WebContent/ConnectionFromClient.cpp b/Userland/Services/WebContent/ConnectionFromClient.cpp
index 92512b0b26..71c632c05a 100644
--- a/Userland/Services/WebContent/ConnectionFromClient.cpp
+++ b/Userland/Services/WebContent/ConnectionFromClient.cpp
@@ -655,6 +655,16 @@ void ConnectionFromClient::set_is_webdriver_active(bool is_webdriver_active)
m_page_host->set_is_webdriver_active(is_webdriver_active);
}
+void ConnectionFromClient::set_window_position(Gfx::IntPoint const& position)
+{
+ m_page_host->set_window_position(position);
+}
+
+void ConnectionFromClient::set_window_size(Gfx::IntSize const& size)
+{
+ m_page_host->set_window_size(size);
+}
+
Messages::WebContentServer::GetLocalStorageEntriesResponse ConnectionFromClient::get_local_storage_entries()
{
auto* document = page().top_level_browsing_context().active_document();
diff --git a/Userland/Services/WebContent/ConnectionFromClient.h b/Userland/Services/WebContent/ConnectionFromClient.h
index 4916ee8460..bdbcf85b73 100644
--- a/Userland/Services/WebContent/ConnectionFromClient.h
+++ b/Userland/Services/WebContent/ConnectionFromClient.h
@@ -72,6 +72,8 @@ private:
virtual void set_has_focus(bool) override;
virtual void set_is_scripting_enabled(bool) override;
virtual void set_is_webdriver_active(bool) override;
+ virtual void set_window_position(Gfx::IntPoint const&) override;
+ virtual void set_window_size(Gfx::IntSize const&) override;
virtual void handle_file_return(i32 error, Optional<IPC::File> const& file, i32 request_id) override;
virtual void set_system_visibility_state(bool visible) override;
diff --git a/Userland/Services/WebContent/PageHost.cpp b/Userland/Services/WebContent/PageHost.cpp
index 30c820dab2..c1b819035d 100644
--- a/Userland/Services/WebContent/PageHost.cpp
+++ b/Userland/Services/WebContent/PageHost.cpp
@@ -76,6 +76,16 @@ void PageHost::set_is_webdriver_active(bool is_webdriver_active)
page().set_is_webdriver_active(is_webdriver_active);
}
+void PageHost::set_window_position(Gfx::IntPoint const& position)
+{
+ page().set_window_position(position);
+}
+
+void PageHost::set_window_size(Gfx::IntSize const& size)
+{
+ page().set_window_size(size);
+}
+
Web::Layout::InitialContainingBlock* PageHost::layout_root()
{
auto* document = page().top_level_browsing_context().active_document();
diff --git a/Userland/Services/WebContent/PageHost.h b/Userland/Services/WebContent/PageHost.h
index b145675379..c70efb4942 100644
--- a/Userland/Services/WebContent/PageHost.h
+++ b/Userland/Services/WebContent/PageHost.h
@@ -35,6 +35,8 @@ public:
void set_has_focus(bool);
void set_is_scripting_enabled(bool);
void set_is_webdriver_active(bool);
+ void set_window_position(Gfx::IntPoint const&);
+ void set_window_size(Gfx::IntSize const&);
private:
// ^PageClient
diff --git a/Userland/Services/WebContent/WebContentServer.ipc b/Userland/Services/WebContent/WebContentServer.ipc
index 125be1ba68..9302fd27be 100644
--- a/Userland/Services/WebContent/WebContentServer.ipc
+++ b/Userland/Services/WebContent/WebContentServer.ipc
@@ -60,6 +60,9 @@ endpoint WebContentServer
set_is_scripting_enabled(bool is_scripting_enabled) =|
set_is_webdriver_active(bool is_webdriver_active) =|
+ set_window_position(Gfx::IntPoint position) =|
+ set_window_size(Gfx::IntSize size) =|
+
get_local_storage_entries() => (OrderedHashMap<String,String> entries)
get_session_storage_entries() => (OrderedHashMap<String,String> entries)