From 6aea935727a8a65d023b3aa91d0cfce0d8f74845 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 2 Nov 2010 13:48:07 +0000 Subject: [PATCH] Chromium support for web plugin --- direct/src/plugin_npapi/startup.cxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/direct/src/plugin_npapi/startup.cxx b/direct/src/plugin_npapi/startup.cxx index 79b54d8666..7d8f0318d7 100644 --- a/direct/src/plugin_npapi/startup.cxx +++ b/direct/src/plugin_npapi/startup.cxx @@ -131,11 +131,6 @@ NP_GetValue(void*, NPPVariable variable, void* value) { case NPPVpluginDescriptionString: *(const char **)value = "Runs 3-D games and interactive applets"; break; - /* - case NPPVpluginNeedsXEmbed: - *((NPBool *)value) = false; - break; - */ default: nout << "Ignoring GetValue request " << variable << "\n"; return NPERR_INVALID_PARAM; @@ -567,6 +562,16 @@ NPP_GetValue(NPP instance, NPPVariable variable, void *value) { *(NPObject **)value = obj; return NPERR_NO_ERROR; } + } else if (variable == NPPVpluginNeedsXEmbed) { + // We'll say yes if the browser supports it. + // This is necessary to support Chromium. + NPBool supports_xembed = false; + NPError err = browser->getvalue(instance, NPNVSupportsXEmbedBool, &supports_xembed); + if (err != NPERR_NO_ERROR) { + supports_xembed = false; + } + *((NPBool *)value) = supports_xembed; + return NPERR_NO_ERROR; } else { return NP_GetValue(NULL, variable, value); }