+2012-02-24 Charles Wei <charles.wei@torchmobile.com.cn>
+
+ [BlackBerry] Anchor mailto: with target set won't launch Messaging application when clicked
+ https://bugs.webkit.org/show_bug.cgi?id=79318
+
+ Need to give the client a chance to decide how to handle the new window request.
+
+ Reviewed by Rob Buis.
+
+ * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+ (WebCore::FrameLoaderClientBlackBerry::dispatchDecidePolicyForNewWindowAction):
+
2012-02-23 Mike Fenton <mifenton@rim.com>
[BlackBerry] Selection handler has compile failure with logs enabled.
delayPolicyCheckUntilFragmentExists(fragment, function);
}
-void FrameLoaderClientBlackBerry::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const NavigationAction&, const ResourceRequest& request, PassRefPtr<FormState>, const String& frameName)
+void FrameLoaderClientBlackBerry::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const NavigationAction& action, const ResourceRequest& request, PassRefPtr<FormState>, const String& frameName)
{
if (request.isRequestedByPlugin() && ScriptController::processingUserGesture() && !m_webPagePrivate->m_pluginMayOpenNewTab)
(m_frame->loader()->policyChecker()->*function)(PolicyIgnore);
// A new window can never be a fragment scroll.
PolicyAction decision = decidePolicyForExternalLoad(request, false);
+ // Let the client have a chance to say whether this navigation should
+ // be ignored or not.
+ BlackBerry::Platform::NetworkRequest platformRequest;
+ request.initializePlatformRequest(platformRequest, false /*isInitial*/);
+ 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 && request.url().hasFragmentIdentifier()) {
+ ResourceRequest emptyRequest;
+ m_frame->loader()->activeDocumentLoader()->setLastCheckedRequest(emptyRequest);
+ }
+ decision = PolicyIgnore;
+ }
+
(m_frame->loader()->policyChecker()->*function)(decision);
}