Title: [108763] trunk/Source/WebKit/blackberry
Revision
108763
Author
commit-qu...@webkit.org
Date
2012-02-24 02:54:35 -0800 (Fri, 24 Feb 2012)

Log Message

[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.

Patch by Charles Wei <charles....@torchmobile.com.cn> on 2012-02-24
Reviewed by Rob Buis.

* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::dispatchDecidePolicyForNewWindowAction):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/ChangeLog (108762 => 108763)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-02-24 10:40:38 UTC (rev 108762)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-02-24 10:54:35 UTC (rev 108763)
@@ -1,3 +1,15 @@
+2012-02-24  Charles Wei  <charles....@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  <mifen...@rim.com>
 
         [BlackBerry] Selection handler has compile failure with logs enabled.

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp (108762 => 108763)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp	2012-02-24 10:40:38 UTC (rev 108762)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp	2012-02-24 10:54:35 UTC (rev 108763)
@@ -270,13 +270,29 @@
     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);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to