1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 13:35:09 +00:00

LibWeb: Move window.confirm() to using a PageClient callback

This allows us to move the GUI::MessageBox out of DOM::Window and up to
the widget layer.
This commit is contained in:
Andreas Kling 2021-02-10 08:37:13 +01:00
parent 794ebb699c
commit abf7c02acb
4 changed files with 11 additions and 3 deletions

View file

@ -420,4 +420,10 @@ void InProcessWebView::page_did_request_alert(const String& message)
GUI::MessageBox::show(window(), message, "Alert", GUI::MessageBox::Type::Information);
}
bool InProcessWebView::page_did_request_confirm(const String& message)
{
auto confirm_result = GUI::MessageBox::show(window(), message, "Confirm", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OKCancel);
return confirm_result == GUI::Dialog::ExecResult::ExecOK;
}
}