Changeset 167425 in webkit


Ignore:
Timestamp:
Apr 17, 2014 7:00:17 AM (10 years ago)
Author:
mitz@apple.com
Message:

Source/WebCore: WebCore part of <rdar://problem/16601336> [Cocoa] _userInitiated is always NO in WKNavigationAction passed to -webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:
https://bugs.webkit.org/show_bug.cgi?id=131783

Reviewed by Tim Horton.

  • loader/NavigationAction.cpp:

(WebCore::NavigationAction::NavigationAction): Initialize m_processingUserGesture to
ScriptController::processingUserGesture() at the time the NavigationAction is constructed.

  • loader/NavigationAction.h:

Added boolean member variable m_processionUserGesture
(WebCore::NavigationAction::processingUserGesture): Added this getter.

Source/WebKit2: WebKit2 part of <rdar://problem/16601336> [Cocoa] _userInitiated is always NO in WKNavigationAction passed to -webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:
https://bugs.webkit.org/show_bug.cgi?id=131783

Reviewed by Tim Horton.

  • WebProcess/WebCoreSupport/WebChromeClient.cpp:

(WebKit::WebChromeClient::createWindow): Set the isProcessingUserGesture field of
the NavigationActionData to the corresponding value in the NavigationAction.

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Ditto.
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.

Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r167424 r167425  
     12014-04-17  Dan Bernstein  <mitz@apple.com>
     2
     3        WebCore part of <rdar://problem/16601336> [Cocoa] _userInitiated is always NO in WKNavigationAction passed to -webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:
     4        https://bugs.webkit.org/show_bug.cgi?id=131783
     5
     6        Reviewed by Tim Horton.
     7
     8        * loader/NavigationAction.cpp:
     9        (WebCore::NavigationAction::NavigationAction): Initialize m_processingUserGesture to
     10        ScriptController::processingUserGesture() at the time the NavigationAction is constructed.
     11        * loader/NavigationAction.h:
     12        Added boolean member variable m_processionUserGesture
     13        (WebCore::NavigationAction::processingUserGesture): Added this getter.
     14
    1152014-04-17  Ion Rosca  <rosca@adobe.com>
    216
  • trunk/Source/WebCore/loader/NavigationAction.cpp

    r165676 r167425  
    3232#include "Event.h"
    3333#include "FrameLoader.h"
     34#include "ScriptController.h"
    3435
    3536namespace WebCore {
     
    5051NavigationAction::NavigationAction()
    5152    : m_type(NavigationTypeOther)
     53    , m_processingUserGesture(ScriptController::processingUserGesture())
    5254{
    5355}
     
    5658    : m_resourceRequest(resourceRequest)
    5759    , m_type(NavigationTypeOther)
     60    , m_processingUserGesture(ScriptController::processingUserGesture())
    5861{
    5962}
     
    6265    : m_resourceRequest(resourceRequest)
    6366    , m_type(type)
     67    , m_processingUserGesture(ScriptController::processingUserGesture())
    6468{
    6569}
     
    6973    : m_resourceRequest(resourceRequest)
    7074    , m_type(navigationType(frameLoadType, isFormSubmission, 0))
     75    , m_processingUserGesture(ScriptController::processingUserGesture())
    7176{
    7277}
     
    7681    , m_type(type)
    7782    , m_event(event)
     83    , m_processingUserGesture(ScriptController::processingUserGesture())
    7884{
    7985}
     
    8490    , m_type(navigationType(frameLoadType, isFormSubmission, event))
    8591    , m_event(event)
     92    , m_processingUserGesture(ScriptController::processingUserGesture())
    8693{
    8794}
  • trunk/Source/WebCore/loader/NavigationAction.h

    r165676 r167425  
    5555        const Event* event() const { return m_event.get(); }
    5656
     57        bool processingUserGesture() const { return m_processingUserGesture; }
     58
    5759    private:
    5860        ResourceRequest m_resourceRequest;
    5961        NavigationType m_type;
    6062        RefPtr<Event> m_event;
     63        bool m_processingUserGesture;
    6164    };
    6265
  • trunk/Source/WebKit2/ChangeLog

    r167412 r167425  
     12014-04-17  Dan Bernstein  <mitz@apple.com>
     2
     3        WebKit2 part of <rdar://problem/16601336> [Cocoa] _userInitiated is always NO in WKNavigationAction passed to -webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:
     4        https://bugs.webkit.org/show_bug.cgi?id=131783
     5
     6        Reviewed by Tim Horton.
     7
     8        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     9        (WebKit::WebChromeClient::createWindow): Set the isProcessingUserGesture field of
     10        the NavigationActionData to the corresponding value in the NavigationAction.
     11        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     12        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Ditto.
     13        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
     14
    1152014-04-16  Benjamin Poulain  <bpoulain@apple.com>
    216
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r167316 r167425  
    211211    navigationActionData.modifiers = InjectedBundleNavigationAction::modifiersForNavigationAction(navigationAction);
    212212    navigationActionData.mouseButton = InjectedBundleNavigationAction::mouseButtonForNavigationAction(navigationAction);
    213     navigationActionData.isProcessingUserGesture = ScriptController::processingUserGesture();
     213    navigationActionData.isProcessingUserGesture = navigationAction.processingUserGesture();
    214214
    215215    uint64_t newPageID = 0;
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r167388 r167425  
    691691    navigationActionData.modifiers = action->modifiers();
    692692    navigationActionData.mouseButton = action->mouseButton();
    693     navigationActionData.isProcessingUserGesture = ScriptController::processingUserGesture();
     693    navigationActionData.isProcessingUserGesture = navigationAction.processingUserGesture();
    694694
    695695    webPage->send(Messages::WebPageProxy::DecidePolicyForNewWindowAction(m_frame->frameID(), navigationActionData, request, frameName, listenerID, InjectedBundleUserMessageEncoder(userData.get())));
     
    745745    navigationActionData.modifiers = action->modifiers();
    746746    navigationActionData.mouseButton = action->mouseButton();
    747     navigationActionData.isProcessingUserGesture = ScriptController::processingUserGesture();
     747    navigationActionData.isProcessingUserGesture = navigationAction.processingUserGesture();
    748748
    749749    // Notify the UIProcess.
Note: See TracChangeset for help on using the changeset viewer.