summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/InProcessWebView.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-02-10 08:37:13 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-10 09:13:30 +0100
commitabf7c02acb4761a833726fed33ad88fc0c8177a3 (patch)
tree3c0d9fcbd660dc54af8bab2821351e45ce4f5211 /Userland/Libraries/LibWeb/InProcessWebView.cpp
parent794ebb699c72e0e2768b7a6380c963150183daa0 (diff)
downloadserenity-abf7c02acb4761a833726fed33ad88fc0c8177a3.zip
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.
Diffstat (limited to 'Userland/Libraries/LibWeb/InProcessWebView.cpp')
-rw-r--r--Userland/Libraries/LibWeb/InProcessWebView.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/InProcessWebView.cpp b/Userland/Libraries/LibWeb/InProcessWebView.cpp
index c0ccaed81f..942a8b62e6 100644
--- a/Userland/Libraries/LibWeb/InProcessWebView.cpp
+++ b/Userland/Libraries/LibWeb/InProcessWebView.cpp
@@ -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;
+}
+
}