Fix bug 306177: fix the "click here to get the plugin" action of the Default Plugin by enabling popups from the plugin. r=mark, sr=jst.

This commit is contained in:
smfr%smfr.org 2005-09-04 19:30:32 +00:00
Родитель f6055ed791
Коммит 16f1158f3b
2 изменённых файлов: 19 добавлений и 1 удалений

Просмотреть файл

@ -1211,6 +1211,8 @@ void CPlugin::AskAndLoadURL()
// is arbitrary since it has nothing to do with the actual
// window title shown to the user (itÕs only used internally).
//
NPN_PushPopupsEnabledState(fInstance, true);
if (fFileURL != NULL) {
(void) NPN_GetURL(fInstance, fFileURL, "_current");
} else if (fPageURL != NULL) {
@ -1225,6 +1227,8 @@ void CPlugin::AskAndLoadURL()
NPN_MemFree(pTheURL);
}
NPN_PopPopupsEnabledState(fInstance);
fUserInstalledPlugin = true;
if (FocusDraw()) {
Draw(kUnhilited);

Просмотреть файл

@ -85,7 +85,7 @@
#if PLUGIN_TRACE
#define PLUGINDEBUGSTR(msg) ::DebugStr(msg)
#else
#define PLUGINDEBUGSTR
#define PLUGINDEBUGSTR(msg) ((void) 0)
#endif
@ -150,6 +150,8 @@ struct {
TTVtoFPGlue invalidaterect;
TTVtoFPGlue invalidateregion;
TTVtoFPGlue forceredraw;
TTVtoFPGlue pushpopupsenabledstate;
TTVtoFPGlue poppopupsenabledstate;
} gNetscapeFuncsGlueTable;
static void* SetupTVtoFPGlue(TTVtoFPGlue* functionGlue, void* tvp)
@ -369,6 +371,16 @@ void NPN_ForceRedraw(NPP instance)
CallNPN_ForceRedrawProc( gNetscapeFuncs.forceredraw, instance);
}
void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled)
{
CallNPN_PushPopupsEnabledStateProc( gNetscapeFuncs.pushpopupsenabledstate, instance, enabled);
}
void NPN_PopPopupsEnabledState(NPP instance)
{
CallNPN_PopPopupsEnabledStateProc( gNetscapeFuncs.poppopupsenabledstate, instance);
}
#pragma mark -
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@ -728,6 +740,8 @@ DEFINE_API_C(NPError) main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs,
gNetscapeFuncs.invalidaterect = (NPN_InvalidateRectUPP)HOST_TO_PLUGIN_GLUE(invalidaterect, nsTable->invalidaterect);
gNetscapeFuncs.invalidateregion = (NPN_InvalidateRegionUPP)HOST_TO_PLUGIN_GLUE(invalidateregion, nsTable->invalidateregion);
gNetscapeFuncs.forceredraw = (NPN_ForceRedrawUPP)HOST_TO_PLUGIN_GLUE(forceredraw, nsTable->forceredraw);
gNetscapeFuncs.pushpopupsenabledstate = (NPN_PushPopupsEnabledStateUPP)HOST_TO_PLUGIN_GLUE(pushpopupsenabledstate, nsTable->pushpopupsenabledstate);
gNetscapeFuncs.poppopupsenabledstate = (NPN_PopPopupsEnabledStateUPP)HOST_TO_PLUGIN_GLUE(poppopupsenabledstate, nsTable->poppopupsenabledstate);
//
// Set up the plugin function table that Netscape will use to