diff options
author | alokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-29 20:55:00 +0000 |
---|---|---|
committer | alokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-29 20:55:00 +0000 |
commit | dcaeb85d3d88fbfb40f1451f9a40fac19e9885f4 (patch) | |
tree | a752bca659e29da7f3c34654233f03fc400b32c3 /webkit/tools/npapi_pepper_test_plugin | |
parent | eb36f0d7ef6296cf4e7b251d64633c4eaf3ea312 (diff) | |
download | chromium_src-dcaeb85d3d88fbfb40f1451f9a40fac19e9885f4.zip chromium_src-dcaeb85d3d88fbfb40f1451f9a40fac19e9885f4.tar.gz chromium_src-dcaeb85d3d88fbfb40f1451f9a40fac19e9885f4.tar.bz2 |
Changes to get npapi_pepper_test_plugin recognized on linux.
Review URL: http://codereview.chromium.org/2819071
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54186 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/npapi_pepper_test_plugin')
-rw-r--r-- | webkit/tools/npapi_pepper_test_plugin/main.cc | 51 |
1 files changed, 45 insertions, 6 deletions
diff --git a/webkit/tools/npapi_pepper_test_plugin/main.cc b/webkit/tools/npapi_pepper_test_plugin/main.cc index 4560a79..78faa99 100644 --- a/webkit/tools/npapi_pepper_test_plugin/main.cc +++ b/webkit/tools/npapi_pepper_test_plugin/main.cc @@ -11,15 +11,54 @@ #include "webkit/glue/plugins/test/plugin_client.h" extern "C" { -EXPORT NPError API_CALL NP_GetEntryPoints(NPPluginFuncs* pFuncs) { - return NPAPIClient::PluginClient::GetEntryPoints(pFuncs); -} - -EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* pFuncs) { - return NPAPIClient::PluginClient::Initialize(pFuncs); +EXPORT NPError API_CALL NP_GetEntryPoints(NPPluginFuncs* nppFuncs) { + return NPAPIClient::PluginClient::GetEntryPoints(nppFuncs); } EXPORT NPError API_CALL NP_Shutdown() { return NPAPIClient::PluginClient::Shutdown(); } + +#if defined(OS_POSIX) && !defined(OS_MACOSX) +EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* npnFuncs, + NPPluginFuncs* nppFuncs) { + NPError error = NPAPIClient::PluginClient::Initialize(npnFuncs); + if (error == NPERR_NO_ERROR) { + error = NP_GetEntryPoints(nppFuncs); + } + return error; +} + +EXPORT NPError API_CALL NP_GetValue(NPP instance, NPPVariable variable, + void* value) { + NPError err = NPERR_NO_ERROR; + + switch (variable) { + case NPPVpluginNameString: + *(static_cast<const char**>(value)) = "NPAPI Pepper Test Plugin"; + break; + case NPPVpluginDescriptionString: + *(static_cast<const char**>(value)) = "NPAPI Pepper Test Plugin"; + break; + case NPPVpluginNeedsXEmbed: + *(static_cast<NPBool*>(value)) = true; + break; + default: + err = NPERR_GENERIC_ERROR; + break; + } + + return err; +} + +EXPORT const char* API_CALL NP_GetMIMEDescription() { + return "pepper-application/x-pepper-test:pepper:NPAPI Pepper Test Plugin"; +} +#else // OS_POSIX +EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* npnFuncs) { + return NPAPIClient::PluginClient::Initialize(npnFuncs); +} +#endif // OS_POSIX + } // extern "C" + |