Selaa lähdekoodia

WebContent: Add IPC call to get window handle from WebContent client

Aliaksandr Kalenik 2 vuotta sitten
vanhempi
commit
48e0789a17

+ 5 - 0
Userland/Services/WebContent/ConnectionFromClient.cpp

@@ -61,6 +61,11 @@ Web::Page const& ConnectionFromClient::page() const
     return m_page_host->page();
     return m_page_host->page();
 }
 }
 
 
+Messages::WebContentServer::GetWindowHandleResponse ConnectionFromClient::get_window_handle()
+{
+    return m_page_host->page().top_level_browsing_context().window_handle();
+}
+
 void ConnectionFromClient::connect_to_webdriver(DeprecatedString const& webdriver_ipc_path)
 void ConnectionFromClient::connect_to_webdriver(DeprecatedString const& webdriver_ipc_path)
 {
 {
     // FIXME: Propagate this error back to the browser.
     // FIXME: Propagate this error back to the browser.

+ 1 - 0
Userland/Services/WebContent/ConnectionFromClient.h

@@ -48,6 +48,7 @@ private:
     Web::Page& page();
     Web::Page& page();
     Web::Page const& page() const;
     Web::Page const& page() const;
 
 
+    virtual Messages::WebContentServer::GetWindowHandleResponse get_window_handle() override;
     virtual void connect_to_webdriver(DeprecatedString const& webdriver_ipc_path) override;
     virtual void connect_to_webdriver(DeprecatedString const& webdriver_ipc_path) override;
     virtual void update_system_theme(Core::AnonymousBuffer const&) override;
     virtual void update_system_theme(Core::AnonymousBuffer const&) override;
     virtual void update_system_fonts(DeprecatedString const&, DeprecatedString const&, DeprecatedString const&) override;
     virtual void update_system_fonts(DeprecatedString const&, DeprecatedString const&, DeprecatedString const&) override;

+ 2 - 0
Userland/Services/WebContent/WebContentServer.ipc

@@ -9,6 +9,8 @@
 
 
 endpoint WebContentServer
 endpoint WebContentServer
 {
 {
+    get_window_handle() => (String handle)
+
     connect_to_webdriver(DeprecatedString webdriver_ipc_path) =|
     connect_to_webdriver(DeprecatedString webdriver_ipc_path) =|
 
 
     update_system_theme(Core::AnonymousBuffer theme_buffer) =|
     update_system_theme(Core::AnonymousBuffer theme_buffer) =|