[haiku-webkit-commits] r359 - webkit/trunk/WebKit/haiku/WebCoreSupport

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Fri, 02 Apr 2010 12:11:36 +0000

Author: stippi
Date: Fri Apr  2 12:11:35 2010
New Revision: 359
URL: http://mmlr.dyndns.org/changeset/359

Log:
Dispatch "navigation request" events only when really needed. When opening
new tabs, we could wrongly reset the favicon of the current page when receiving
the event, although the navigation was really requested in another page.

Modified:
   webkit/trunk/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
   webkit/trunk/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h

Modified: webkit/trunk/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp Sun Mar 
28 11:32:14 2010        (r358)
+++ webkit/trunk/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp Fri Apr 
 2 12:11:35 2010        (r359)
@@ -468,6 +468,7 @@
     }
 
     if (!m_messenger.IsValid() || !isTertiaryMouseButton(action)) {
+        dispatchNavigationRequested(request);
         callPolicyFunction(function, PolicyUse);
         return;
     }
@@ -475,6 +476,7 @@
     // NOTE: This is what the Qt port does in 
QWebPage::acceptNavigationRequest() if the
     // current delegation policy is "DelegateExternalLinks". Must be good for 
something.
     if 
(WebCore::SecurityOrigin::shouldTreatURLSchemeAsLocal(request.url().protocol()))
 {
+        dispatchNavigationRequested(request);
         callPolicyFunction(function, PolicyUse);
         return;
     }
@@ -502,9 +504,6 @@
 void 
FrameLoaderClientHaiku::dispatchDecidePolicyForNavigationAction(FramePolicyFunction
 function,
     const NavigationAction& action, const ResourceRequest& request, 
PassRefPtr<FormState> formState)
 {
-       BMessage message(NAVIGATION_REQUESTED);
-       message.AddString("url", request.url().string());
-       dispatchMessage(message);
     // Potentially we want to open a new window, when the user clicked with the
     // tertiary mouse button. That's why we can reuse the other method.
        dispatchDecidePolicyForNewWindowAction(function, action, request, 
formState, String());
@@ -1008,12 +1007,6 @@
     view->setTopLevelPlatformWidget(m_webPage->WebView());
 }
 
-status_t FrameLoaderClientHaiku::dispatchMessage(BMessage& message) const
-{
-       message.AddPointer("view", m_webPage->WebView());
-       return m_messenger.SendMessage(&message);
-}
-
 bool FrameLoaderClientHaiku::isTertiaryMouseButton(const NavigationAction& 
action) const
 {
     if (action.event() && action.event()->isMouseEvent()) {
@@ -1023,5 +1016,18 @@
     return false;
 }
 
+status_t FrameLoaderClientHaiku::dispatchNavigationRequested(const 
ResourceRequest& request) const
+{
+       BMessage message(NAVIGATION_REQUESTED);
+       message.AddString("url", request.url().string());
+       return dispatchMessage(message);
+}
+
+status_t FrameLoaderClientHaiku::dispatchMessage(BMessage& message) const
+{
+       message.AddPointer("view", m_webPage->WebView());
+       return m_messenger.SendMessage(&message);
+}
+
 } // namespace WebCore
 

Modified: webkit/trunk/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h
==============================================================================
--- webkit/trunk/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h   Sun Mar 
28 11:32:14 2010        (r358)
+++ webkit/trunk/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h   Fri Apr 
 2 12:11:35 2010        (r359)
@@ -211,6 +211,7 @@
     void postCommitFrameViewSetup(BWebFrame*, FrameView*, bool) const;
     bool isTertiaryMouseButton(const NavigationAction& action) const;
 
+       status_t dispatchNavigationRequested(const ResourceRequest& request) 
const;
     status_t dispatchMessage(BMessage& message) const;
 
 private:

Other related posts:

  • » [haiku-webkit-commits] r359 - webkit/trunk/WebKit/haiku/WebCoreSupport - webkit