summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/WebFormClient.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebKit2/UIProcess/WebFormClient.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebKit2/UIProcess/WebFormClient.cpp')
-rw-r--r--Source/WebKit2/UIProcess/WebFormClient.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/Source/WebKit2/UIProcess/WebFormClient.cpp b/Source/WebKit2/UIProcess/WebFormClient.cpp
index 271e9eaa2..716b7bd60 100644
--- a/Source/WebKit2/UIProcess/WebFormClient.cpp
+++ b/Source/WebKit2/UIProcess/WebFormClient.cpp
@@ -26,24 +26,31 @@
#include "config.h"
#include "WebFormClient.h"
+#include "APIDictionary.h"
#include "APIString.h"
-#include "ImmutableDictionary.h"
#include "WKAPICast.h"
+#include "WebFormSubmissionListenerProxy.h"
+#include "WebPageProxy.h"
namespace WebKit {
-bool WebFormClient::willSubmitForm(WebPageProxy* page, WebFrameProxy* frame, WebFrameProxy* sourceFrame, const Vector<std::pair<String, String>>& textFieldValues, API::Object* userData, WebFormSubmissionListenerProxy* listener)
+WebFormClient::WebFormClient(const WKPageFormClientBase* wkClient)
{
- if (!m_client.willSubmitForm)
- return false;
+ initialize(wkClient);
+}
+
+void WebFormClient::willSubmitForm(WebPageProxy& page, WebFrameProxy& frame, WebFrameProxy& sourceFrame, const Vector<std::pair<String, String>>& textFieldValues, API::Object* userData, Ref<WebFormSubmissionListenerProxy>&& listener)
+{
+ if (!m_client.willSubmitForm) {
+ listener->continueSubmission();
+ return;
+ }
- ImmutableDictionary::MapType map;
+ API::Dictionary::MapType map;
for (size_t i = 0; i < textFieldValues.size(); ++i)
map.set(textFieldValues[i].first, API::String::create(textFieldValues[i].second));
- RefPtr<ImmutableDictionary> textFieldsMap = ImmutableDictionary::create(std::move(map));
-
- m_client.willSubmitForm(toAPI(page), toAPI(frame), toAPI(sourceFrame), toAPI(textFieldsMap.get()), toAPI(userData), toAPI(listener), m_client.base.clientInfo);
- return true;
+ Ref<API::Dictionary> textFieldsMap = API::Dictionary::create(WTFMove(map));
+ m_client.willSubmitForm(toAPI(&page), toAPI(&frame), toAPI(&sourceFrame), toAPI(textFieldsMap.ptr()), toAPI(userData), toAPI(&listener.get()), m_client.base.clientInfo);
}
} // namespace WebKit