diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-30 12:48:17 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-30 12:48:17 +0200 |
commit | 881da28418d380042aa95a97f0cbd42560a64f7c (patch) | |
tree | a794dff3274695e99c651902dde93d934ea7a5af /Source/WebKit2/UIProcess/WebFormClient.cpp | |
parent | 7e104c57a70fdf551bb3d22a5d637cdcbc69dbea (diff) | |
parent | 0fcedcd17cc00d3dd44c718b3cb36c1033319671 (diff) | |
download | qtwebkit-881da28418d380042aa95a97f0cbd42560a64f7c.tar.gz |
Merge 'wip/next' into dev
Change-Id: Iff9ee5e23bb326c4371ec8ed81d56f2f05d680e9
Diffstat (limited to 'Source/WebKit2/UIProcess/WebFormClient.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/WebFormClient.cpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/Source/WebKit2/UIProcess/WebFormClient.cpp b/Source/WebKit2/UIProcess/WebFormClient.cpp index ecddbcc42..716b7bd60 100644 --- a/Source/WebKit2/UIProcess/WebFormClient.cpp +++ b/Source/WebKit2/UIProcess/WebFormClient.cpp @@ -26,25 +26,31 @@ #include "config.h" #include "WebFormClient.h" -#include "ImmutableDictionary.h" +#include "APIDictionary.h" +#include "APIString.h" #include "WKAPICast.h" -#include "WebString.h" -#include <wtf/text/WTFString.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, APIObject* userData, WebFormSubmissionListenerProxy* listener) +WebFormClient::WebFormClient(const WKPageFormClientBase* wkClient) { - if (!m_client.willSubmitForm) - return false; + initialize(wkClient); +} - ImmutableDictionary::MapType map; - for (size_t i = 0; i < textFieldValues.size(); ++i) - map.set(textFieldValues[i].first, WebString::create(textFieldValues[i].second)); - RefPtr<ImmutableDictionary> textFieldsMap = ImmutableDictionary::adopt(map); +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; + } - m_client.willSubmitForm(toAPI(page), toAPI(frame), toAPI(sourceFrame), toAPI(textFieldsMap.get()), toAPI(userData), toAPI(listener), m_client.clientInfo); - return true; + API::Dictionary::MapType map; + for (size_t i = 0; i < textFieldValues.size(); ++i) + map.set(textFieldValues[i].first, API::String::create(textFieldValues[i].second)); + 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 |