diff options
Diffstat (limited to 'WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp')
-rw-r--r-- | WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp index 08a2f6a..eeacb7e 100644 --- a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp +++ b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp @@ -6,7 +6,7 @@ redistribute this Apple software. In consideration of your agreement to abide by the following terms, and subject to these - terms, Apple grants you a personal, non-exclusive license, under AppleÕs copyrights in + terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the Apple Software, with or without modifications, in source and/or binary forms; provided that if you redistribute the Apple Software in its entirety and without @@ -89,7 +89,8 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, ch { if (browser->version >= 14) { PluginObject* obj = (PluginObject*)browser->createobject(instance, getPluginClass()); - + instance->pdata = obj; + for (int16 i = 0; i < argc; i++) { if (_stricmp(argn[i], "onstreamload") == 0 && !obj->onStreamLoad) obj->onStreamLoad = _strdup(argv[i]); @@ -107,9 +108,11 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, ch obj->testDocumentOpenInDestroyStream = TRUE; else if (_stricmp(argn[i], "testwindowopen") == 0) obj->testWindowOpen = TRUE; + else if (_stricmp(argn[i], "onSetWindow") == 0 && !obj->onSetWindow) + obj->onSetWindow = strdup(argv[i]); } - - instance->pdata = obj; + + browser->getvalue(instance, NPNVprivateModeBool, (void *)&obj->cachedPrivateBrowsingMode); } return NPERR_NO_ERROR; @@ -136,6 +139,9 @@ NPError NPP_Destroy(NPP instance, NPSavedData **save) if (obj->logDestroy) printf("PLUGIN: NPP_Destroy\n"); + if (obj->onSetWindow) + free(obj->onSetWindow); + browser->releaseobject(&obj->header); } return NPERR_NO_ERROR; @@ -146,6 +152,11 @@ NPError NPP_SetWindow(NPP instance, NPWindow *window) PluginObject* obj = static_cast<PluginObject*>(instance->pdata); if (obj) { + obj->lastWindow = *window; + + if (obj->onSetWindow) + executeScript(obj, obj->onSetWindow); + if (obj->testWindowOpen) { testWindowOpen(instance); obj->testWindowOpen = FALSE; @@ -238,5 +249,13 @@ NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value) NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value) { - return NPERR_GENERIC_ERROR; + PluginObject* obj = static_cast<PluginObject*>(instance->pdata); + + switch (variable) { + case NPNVprivateModeBool: + obj->cachedPrivateBrowsingMode = *(NPBool*)value; + return NPERR_NO_ERROR; + default: + return NPERR_GENERIC_ERROR; + } } |