Reviewed by Adam and Jon.
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Dec 2007 00:44:21 +0000 (00:44 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Dec 2007 00:44:21 +0000 (00:44 +0000)
commitcedf76287f5543f13f33ddb67a211277b86e2b95
tree3f68e921d405d54207351e370603fe3a4fcdbc2c
parent7eaac1fcf74ffe210bcf9bbce5d50ebe2965791d
    Reviewed by Adam and Jon.

        <rdar://problem/5349282>
        popup blocking is not applied to plugins on Windows.

        Implement popup blocking. If the plug-in supports the new
        NPN_PushPopupsEnabledState/NPN_PopPopupsEnabledState API we just use that
        to determine if a plug-in request can open new windows.

        If a plug-in does not support the new API, we assume that a plug-in can open new windows
        in response to either mouse click or key press events.

        * plugins/win/PluginViewWin.cpp:
        (WebCore::PluginRequestWin::PluginRequestWin):
        (WebCore::PluginRequestWin::shouldAllowPopups):
        Add new shouldAllowPopups member.

        (WebCore::PluginViewWin::popPopupsStateTimerFired):
        Reset the popup state.

        (WebCore::isWindowsMessageUserGesture):
        New function that given a windows message id returns whether it's a user gesture or not.

        (WebCore::PluginViewWin::wndProc):
        Allow popups if the window message is a user gesture.

        (WebCore::PluginViewWin::dispatchNPEvent):
        New method that dispatches an NPEvent, turning on popups if necessary.

        (WebCore::PluginViewWin::paint):
        (WebCore::PluginViewWin::handleKeyboardEvent):
        (WebCore::PluginViewWin::handleMouseEvent):
        Call dispatchNPEvent().

        (WebCore::PluginViewWin::performRequest):
        (WebCore::PluginViewWin::load):
        Add calls to shouldAllowPopups().

        (WebCore::PluginViewWin::pushPopupsEnabledState):
        (WebCore::PluginViewWin::popPopupsEnabledState):
        New methods that maintain the popup state stack.

        (WebCore::PluginViewWin::arePopupsAllowed):
        New method that returns whether popups are allowed.

        (WebCore::PluginViewWin::PluginViewWin):
        * plugins/win/PluginViewWin.h:
        Add new instance variables.

        * plugins/win/npapi.cpp:
        (NPN_PushPopupsEnabledState):
        (NPN_PopPopupsEnabledState):
        Implement these.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28667 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/plugins/win/PluginViewWin.cpp
WebCore/plugins/win/PluginViewWin.h
WebCore/plugins/win/npapi.cpp