本文整理汇总了C++中NavigationAction::type方法的典型用法代码示例。如果您正苦于以下问题:C++ NavigationAction::type方法的具体用法?C++ NavigationAction::type怎么用?C++ NavigationAction::type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NavigationAction
的用法示例。
在下文中一共展示了NavigationAction::type方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dispatchDecidePolicyForNavigationAction
void FrameLoaderClientEfl::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const NavigationAction& action, const ResourceRequest& resourceRequest, PassRefPtr<FormState>)
{
ASSERT(function);
ASSERT(m_frame);
if (resourceRequest.isNull()) {
callPolicyFunction(function, PolicyIgnore);
return;
}
// if not acceptNavigationRequest - look at Qt -> PolicyIgnore;
// FIXME: do proper check and only reset forms when on PolicyIgnore
CString url = resourceRequest.url().string().utf8();
CString firstParty = resourceRequest.firstPartyForCookies().string().utf8();
CString httpMethod = resourceRequest.httpMethod().utf8();
Ewk_Frame_Resource_Request request = { url.data(), firstParty.data(), httpMethod.data(), 0, m_frame, false };
bool ret = ewk_view_navigation_policy_decision(m_view, &request, static_cast<Ewk_Navigation_Type>(action.type()));
PolicyAction policy;
if (!ret)
policy = PolicyIgnore;
else {
if (action.type() == NavigationTypeFormSubmitted || action.type() == NavigationTypeFormResubmitted) {
Frame* f = EWKPrivate::coreFrame(m_frame);
f->loader()->resetMultipleFormSubmissionProtection();
}
policy = PolicyUse;
}
callPolicyFunction(function, policy);
}
示例2: dispatchDecidePolicyForNavigationAction
void FrameLoaderClientBlackBerry::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const NavigationAction& action, const ResourceRequest& request, PassRefPtr<FormState>)
{
PolicyAction decision = PolicyIgnore;
const KURL& url = request.url();
if (!url.isNull()) {
// Fragment scrolls on the same page should always be handled internally.
// (Only count as a fragment scroll if we are scrolling to a #fragment url, not back to the top, and reloading
// the same url is not a fragment scroll even if it has a #fragment.)
const KURL& currentUrl = m_frame->document()->url();
bool isFragmentScroll = url.hasFragmentIdentifier() && url != currentUrl && equalIgnoringFragmentIdentifier(currentUrl, url);
decision = decidePolicyForExternalLoad(request, isFragmentScroll);
// Let the client have a chance to say whether this navigation should
// be ignored or not.
NetworkRequest platformRequest;
request.initializePlatformRequest(platformRequest, cookiesEnabled());
if (platformRequest.getTargetType() == NetworkRequest::TargetIsUnknown)
platformRequest.setTargetType(isMainFrame() ? NetworkRequest::TargetIsMainFrame : NetworkRequest::TargetIsSubframe);
if (isMainFrame() && !m_webPagePrivate->m_client->acceptNavigationRequest(
platformRequest, BlackBerry::Platform::NavigationType(action.type()))) {
if (action.type() == NavigationTypeFormSubmitted
|| action.type() == NavigationTypeFormResubmitted)
m_frame->loader()->resetMultipleFormSubmissionProtection();
if (action.type() == NavigationTypeLinkClicked && url.hasFragmentIdentifier()) {
ResourceRequest emptyRequest;
m_frame->loader()->activeDocumentLoader()->setLastCheckedRequest(emptyRequest);
}
decision = PolicyIgnore;
}
}
// If we abort here, dispatchDidCancelClientRedirect will not be called.
// So call it by hand.
if (decision == PolicyIgnore)
dispatchDidCancelClientRedirect();
(m_frame->loader()->policyChecker()->*function)(decision);
if (m_webPagePrivate->m_dumpRenderTree)
m_webPagePrivate->m_dumpRenderTree->didDecidePolicyForNavigationAction(action, request);
}
示例3: dispatchDecidePolicyForNavigationAction
void FrameLoaderClientAndroid::dispatchDecidePolicyForNavigationAction(FramePolicyFunction func,
const NavigationAction& action, const ResourceRequest& request,
PassRefPtr<FormState> formState) {
ASSERT(m_frame);
ASSERT(func);
if (!func)
return;
if (request.isNull()) {
(m_frame->loader()->policyChecker()->*func)(PolicyIgnore);
return;
}
// Reset multiple form submission protection. If this is a resubmission, we check with the
// user and reset the protection if they choose to resubmit the form (see WebCoreFrameBridge.cpp)
if (action.type() == NavigationTypeFormSubmitted)
m_frame->loader()->resetMultipleFormSubmissionProtection();
if (action.type() == NavigationTypeFormResubmitted) {
m_webFrame->decidePolicyForFormResubmission(func);
return;
} else {
(m_frame->loader()->policyChecker()->*func)(PolicyUse);
}
}
示例4: dispatchDecidePolicyForNewWindowAction
void FrameLoaderClientAndroid::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction func,
const NavigationAction& action, const ResourceRequest& request,
PassRefPtr<FormState> formState, const String& frameName) {
ASSERT(m_frame);
ASSERT(func);
if (!func)
return;
if (request.isNull()) {
(m_frame->loader()->policyChecker()->*func)(PolicyIgnore);
return;
}
if (action.type() == NavigationTypeFormSubmitted || action.type() == NavigationTypeFormResubmitted)
m_frame->loader()->resetMultipleFormSubmissionProtection();
// If we get to this point it means that a link has a target that was not
// found by the frame tree. Instead of creating a new frame, return the
// current frame in dispatchCreatePage.
if (canHandleRequest(request))
(m_frame->loader()->policyChecker()->*func)(PolicyUse);
else
(m_frame->loader()->policyChecker()->*func)(PolicyIgnore);
}
示例5: dispatchDecidePolicyForNavigationAction
void FrameLoaderClientWx::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const NavigationAction& action, const ResourceRequest& request, PassRefPtr<FormState>)
{
if (!m_webFrame)
return;
if (m_webView) {
wxWebViewBeforeLoadEvent wkEvent(m_webView);
wkEvent.SetNavigationType(wxNavTypeFromWebNavType(action.type()));
wkEvent.SetURL(request.url().string());
m_webView->GetEventHandler()->ProcessEvent(wkEvent);
if (wkEvent.IsCancelled())
(m_frame->loader()->policyChecker()->*function)(PolicyIgnore);
else
(m_frame->loader()->policyChecker()->*function)(PolicyUse);
}
}
示例6: mouseButtonForMouseEvent
InjectedBundleNavigationAction::InjectedBundleNavigationAction(WebFrame* frame, const NavigationAction& navigationAction, PassRefPtr<FormState> prpFormState)
: m_navigationType(navigationAction.type())
, m_modifiers(modifiersForNavigationAction(navigationAction))
, m_mouseButton(WebMouseEvent::NoButton)
, m_downloadAttribute(navigationAction.downloadAttribute())
, m_shouldOpenExternalURLs(navigationAction.shouldOpenExternalURLsPolicy() == ShouldOpenExternalURLsPolicy::ShouldAllow || navigationAction.shouldOpenExternalURLsPolicy() == ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes)
, m_shouldTryAppLinks(navigationAction.shouldOpenExternalURLsPolicy() == ShouldOpenExternalURLsPolicy::ShouldAllow)
{
if (const MouseEvent* mouseEvent = mouseEventForNavigationAction(navigationAction)) {
m_hitTestResult = InjectedBundleHitTestResult::create(frame->coreFrame()->eventHandler().hitTestResultAtPoint(mouseEvent->absoluteLocation()));
m_mouseButton = mouseButtonForMouseEvent(mouseEvent);
}
RefPtr<FormState> formState = prpFormState;
if (formState) {
ASSERT(formState->form());
m_formElement = InjectedBundleNodeHandle::getOrCreate(formState->form());
}
}