diff options
author | Konstantin Tokarev <annulen@yandex.ru> | 2016-08-25 19:20:41 +0300 |
---|---|---|
committer | Konstantin Tokarev <annulen@yandex.ru> | 2017-02-02 12:30:55 +0000 |
commit | 6882a04fb36642862b11efe514251d32070c3d65 (patch) | |
tree | b7959826000b061fd5ccc7512035c7478742f7b0 /Source/WebKit2/UIProcess/WebFormClient.cpp | |
parent | ab6df191029eeeb0b0f16f127d553265659f739e (diff) | |
download | qtwebkit-6882a04fb36642862b11efe514251d32070c3d65.tar.gz |
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
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 |