Changeset 68891 in webkit


Ignore:
Timestamp:
Oct 1, 2010 9:16:03 AM (14 years ago)
Author:
Adam Roben
Message:

Implement NPN_GetValue(NPNVnetscapeWindow)

Fixes <http://webkit.org/b/46726> <rdar://problem/8486319>
Right-clicking on windowless Flash plugin in WebKit2 makes a context
menu appear in the bottom-right corner of the screen

Test: platform/win/plugins/get-value-netscape-window.html

Reviewed by Anders Carlsson.

WebKit2:

  • WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:

(WebKit::NPN_GetValue): Added case for NPNVnetscapeWindow that calls
through to NetscapePlugin::containingWindow.

  • WebProcess/Plugins/Netscape/NetscapePlugin.h: Added containingWindow

on Windows.

  • WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:

(WebKit::NetscapePlugin::containingWindow): Added. Calls through to
the PluginController.
(WebKit::NetscapePlugin::platformPostInitialize): Changed to use
containingWindow.

WebKitTools:

Test NPN_GetValue(NPNVnetscapeWindow)

  • DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:

(PluginTest::NPN_GetValue): Added. Calls through to the browser.

  • DumpRenderTree/TestNetscapePlugIn/PluginTest.h: Added NPN_GetValue.
  • DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp: Added.

(GetValueNetscapeWindow::GetValueNetscapeWindow): Initialize members.
(GetValueNetscapeWindow::NPP_SetWindow): Test that
NPN_GetValue(NPNVnetscapeWindow) returns a valid HWND and that it
isn't our HWND.

  • DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:

Added GetValueNetscapeWindow.

LayoutTests:

Support for testing NPN_GetValue(NPNVnetscapeWindow)

  • platform/win/plugins/get-value-netscape-window-expected.txt: Added.
  • platform/win/plugins/get-value-netscape-window.html: Added.
Location:
trunk
Files:
3 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r68888 r68891  
     12010-10-01  Adam Roben  <aroben@apple.com>
     2
     3        Support for testing NPN_GetValue(NPNVnetscapeWindow)
     4
     5        Test for <http://webkit.org/b/46726> <rdar://problem/8486319>
     6        Right-clicking on windowless Flash plugin in WebKit2 makes a context
     7        menu appear in the bottom-right corner of the screen
     8
     9        Reviewed by Anders Carlsson.
     10
     11        * platform/win/plugins/get-value-netscape-window-expected.txt: Added.
     12        * platform/win/plugins/get-value-netscape-window.html: Added.
     13
    1142010-10-01  Adam Roben  <aroben@apple.com>
    215
  • trunk/WebKit2/ChangeLog

    r68851 r68891  
     12010-10-01  Adam Roben  <aroben@apple.com>
     2
     3        Implement NPN_GetValue(NPNVnetscapeWindow)
     4
     5        Fixes <http://webkit.org/b/46726> <rdar://problem/8486319>
     6        Right-clicking on windowless Flash plugin in WebKit2 makes a context
     7        menu appear in the bottom-right corner of the screen
     8
     9        Test: platform/win/plugins/get-value-netscape-window.html
     10
     11        Reviewed by Anders Carlsson.
     12
     13        * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
     14        (WebKit::NPN_GetValue): Added case for NPNVnetscapeWindow that calls
     15        through to NetscapePlugin::containingWindow.
     16
     17        * WebProcess/Plugins/Netscape/NetscapePlugin.h: Added containingWindow
     18        on Windows.
     19
     20        * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
     21        (WebKit::NetscapePlugin::containingWindow): Added. Calls through to
     22        the PluginController.
     23        (WebKit::NetscapePlugin::platformPostInitialize): Changed to use
     24        containingWindow.
     25
    1262010-09-30  Simon Fraser  <simon.fraser@apple.com>
    227
  • trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp

    r68048 r68891  
    442442#endif
    443443#elif PLATFORM(WIN)
     444       case NPNVnetscapeWindow: {
     445           RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp);
     446           *reinterpret_cast<HWND*>(value) = plugin->containingWindow();
     447           break;
     448       }
    444449       case NPNVSupportsWindowless:
    445450           *(NPBool*)value = true;
  • trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h

    r68299 r68891  
    5656    NPError setDrawingModel(NPDrawingModel);
    5757    NPError setEventModel(NPEventModel);
     58#elif PLATFORM(WIN)
     59    HWND containingWindow() const;
    5860#endif
    5961
  • trunk/WebKit2/WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp

    r68299 r68891  
    5555}
    5656
     57HWND NetscapePlugin::containingWindow() const
     58{
     59    return m_pluginController->nativeParentWindow();
     60}
     61
    5762bool NetscapePlugin::platformPostInitialize()
    5863{
     
    6469    registerPluginView();
    6570
    66     m_window = ::CreateWindowExW(0, windowClassName, 0, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, m_pluginController->nativeParentWindow(), 0, 0, 0);
     71    m_window = ::CreateWindowExW(0, windowClassName, 0, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, containingWindow(), 0, 0, 0);
    6772    if (!m_window)
    6873        return false;
  • trunk/WebKitTools/ChangeLog

    r68880 r68891  
     12010-10-01  Adam Roben  <aroben@apple.com>
     2
     3        Test NPN_GetValue(NPNVnetscapeWindow)
     4
     5        Test for <http://webkit.org/b/46726> <rdar://problem/8486319>
     6        Right-clicking on windowless Flash plugin in WebKit2 makes a context
     7        menu appear in the bottom-right corner of the screen
     8
     9        Reviewed by Anders Carlsson.
     10
     11        * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
     12        (PluginTest::NPN_GetValue): Added. Calls through to the browser.
     13
     14        * DumpRenderTree/TestNetscapePlugIn/PluginTest.h: Added NPN_GetValue.
     15
     16        * DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp: Added.
     17        (GetValueNetscapeWindow::GetValueNetscapeWindow): Initialize members.
     18        (GetValueNetscapeWindow::NPP_SetWindow): Test that
     19        NPN_GetValue(NPNVnetscapeWindow) returns a valid HWND and that it
     20        isn't our HWND.
     21
     22        * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
     23        Added GetValueNetscapeWindow.
     24
    1252010-10-01  Andreas Kling  <andreas.kling@nokia.com>
    226
  • trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp

    r68520 r68891  
    7676}
    7777
     78NPError PluginTest::NPN_GetValue(NPNVariable variable, void* value)
     79{
     80    return browser->getvalue(m_npp, variable, value);
     81}
     82
    7883NPObject* PluginTest::NPN_CreateObject(NPClass* npClass)
    7984{
  • trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h

    r68520 r68891  
    6363    NPIdentifier NPN_GetStringIdentifier(const NPUTF8* name);
    6464    NPIdentifier NPN_GetIntIdentifier(int32_t intid);
     65    NPError NPN_GetValue(NPNVariable, void* value);
    6566    NPObject* NPN_CreateObject(NPClass*);
    6667    bool NPN_RemoveProperty(NPObject*, NPIdentifier propertyName);
  • trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj

    r68520 r68891  
    391391                                >
    392392                                <File
     393                                        RelativePath="..\Tests\win\GetValueNetscapeWindow.cpp"
     394                                        >
     395                                </File>
     396                                <File
    393397                                        RelativePath="..\Tests\win\WindowGeometryInitializedBeforeSetWindow.cpp"
    394398                                        >
Note: See TracChangeset for help on using the changeset viewer.