void WebFrameLoaderClient::dispatchWillSubmitForm(PassRefPtr<FormState> formState, FramePolicyFunction function) { WebView* webView = m_webFrame->webView(); Frame* coreFrame = core(m_webFrame); ASSERT(coreFrame); COMPtr<IWebFormDelegate> formDelegate; if (FAILED(webView->formDelegate(&formDelegate))) { function(PolicyUse); return; } COMPtr<IDOMElement> formElement(AdoptCOM, DOMElement::createInstance(formState->form())); HashMap<String, String> formValuesMap; const StringPairVector& textFieldValues = formState->textFieldValues(); size_t size = textFieldValues.size(); for (size_t i = 0; i < size; ++i) formValuesMap.add(textFieldValues[i].first, textFieldValues[i].second); COMPtr<IPropertyBag> formValuesPropertyBag(AdoptCOM, COMPropertyBag<String>::createInstance(formValuesMap)); COMPtr<WebFrame> sourceFrame(kit(formState->sourceDocument()->frame())); if (SUCCEEDED(formDelegate->willSubmitForm(m_webFrame, sourceFrame.get(), formElement.get(), formValuesPropertyBag.get(), setUpPolicyListener(function).get()))) return; // FIXME: Add a sane default implementation function(PolicyUse); }
void FrameLoaderClientBlackBerry::dispatchWillSendSubmitEvent(PassRefPtr<FormState> prpFormState) { if (!m_webPagePrivate->m_webSettings->isPrivateBrowsingEnabled()) { m_webPagePrivate->m_autofillManager->saveTextFields(prpFormState->form()); #if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST) credentialManager().saveCredentialIfConfirmed(m_webPagePrivate, CredentialTransformData(prpFormState->form())); #endif } }
void FrameLoaderClientBlackBerry::dispatchWillSubmitForm(FramePolicyFunction function, PassRefPtr<FormState> formState) { if (!m_webPagePrivate->m_webSettings->isPrivateBrowsingEnabled()) { m_webPagePrivate->m_autofillManager->saveTextFields(formState->form()); #if ENABLE(BLACKBERRY_CREDENTIAL_PERSIST) credentialManager().saveCredentialIfConfirmed(m_webPagePrivate, CredentialTransformData(formState->form())); #endif } // FIXME: Stub. (m_frame->loader()->policyChecker()->*function)(PolicyUse); }
void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(const NavigationAction& action, const ResourceRequest& request, PassRefPtr<FormState> formState, FramePolicyFunction function) { WebView* webView = m_webFrame->webView(); Frame* coreFrame = core(m_webFrame); ASSERT(coreFrame); COMPtr<IWebPolicyDelegate> policyDelegate; if (FAILED(webView->policyDelegate(&policyDelegate))) policyDelegate = DefaultPolicyDelegate::sharedInstance(); COMPtr<IWebURLRequest> urlRequest(AdoptCOM, WebMutableURLRequest::createInstance(request)); COMPtr<WebActionPropertyBag> actionInformation(AdoptCOM, WebActionPropertyBag::createInstance(action, formState ? formState->form() : 0, coreFrame)); if (SUCCEEDED(policyDelegate->decidePolicyForNavigationAction(webView, actionInformation.get(), urlRequest.get(), m_webFrame, setUpPolicyListener(function).get()))) return; function(PolicyUse); }
void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const NavigationAction& action, const ResourceRequest& request, PassRefPtr<FormState> formState) { SharedPtr<WebPolicyDelegate> policyDelegate = m_webFrame->webView()->policyDelegate(); if (!policyDelegate) { policyDelegate = DefaultPolicyDelegate::sharedInstance(); m_webFrame->webView()->setPolicyDelegate(policyDelegate); } WebMutableURLRequest* urlRequest = WebMutableURLRequest::createInstance(request); WebNavigationAction* actionInformation = WebNavigationAction::createInstance(&action, formState ? formState->form() : 0, m_webFrame); policyDelegate->decidePolicyForNavigationAction(m_webFrame->webView(), actionInformation, urlRequest, m_webFrame, setUpPolicyListener(function)); delete urlRequest; delete actionInformation; }
void WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const NavigationAction& action, const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName) { Frame* coreFrame = core(m_webFrame); ASSERT(coreFrame); SharedPtr<WebPolicyDelegate> policyDelegate = m_webFrame->webView()->policyDelegate(); if (!policyDelegate) policyDelegate = DefaultPolicyDelegate::sharedInstance(); WebMutableURLRequest* urlRequest = WebMutableURLRequest::createInstance(request); WebNavigationAction* actionInformation = WebNavigationAction::createInstance(&action, formState ? formState->form() : 0, m_webFrame); //policyDelegate->decidePolicyForNewWindowAction(d->webView, actionInformation, urlRequest, frameName, setUpPolicyListener(function)); (coreFrame->loader()->policyChecker()->*function)(PolicyUse); delete urlRequest; delete actionInformation; }
void FrameLoaderClientImpl::dispatchWillSubmitForm(PassRefPtr<FormState> formState) { if (m_webFrame->client()) m_webFrame->client()->willSubmitForm(m_webFrame, WebFormElement(formState->form())); }