LibWeb: Support window.alert() in multi-process context

Alerts are now delegated to the embedding GUI process.
This commit is contained in:
Andreas Kling 2020-09-12 11:56:13 +02:00
parent aba793fb3e
commit d9e39cb82d
Notes: sideshowbarker 2024-07-19 02:43:50 +09:00
11 changed files with 33 additions and 2 deletions

View file

@ -27,6 +27,7 @@
#include "OutOfProcessWebView.h"
#include "WebContentClient.h"
#include <AK/SharedBuffer.h>
#include <LibGUI/MessageBox.h>
#include <LibGUI/Painter.h>
#include <LibGUI/ScrollBar.h>
#include <LibGUI/Window.h>
@ -179,6 +180,11 @@ void OutOfProcessWebView::notify_server_did_request_link_context_menu(Badge<WebC
on_link_context_menu_request(url, screen_relative_rect().location().translated(to_widget_position(content_position)));
}
void OutOfProcessWebView::notify_server_did_request_alert(Badge<WebContentClient>, const String& message)
{
GUI::MessageBox::show(window(), message, "Alert", GUI::MessageBox::Type::Information);
}
void OutOfProcessWebView::did_scroll()
{
client().post_message(Messages::WebContentServer::SetViewportRect(visible_content_rect()));