Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/browser-plugin/scriptable.cpp
diff options
context:
space:
mode:
authorTommi Komulainen <tko@litl.com>2009-08-25 10:45:50 (GMT)
committer Marco Pesenti Gritti <marcopg@litl.com>2010-07-27 22:04:22 (GMT)
commitae40e6243010b7049525f02b3d6d6f6497d1a70c (patch)
treea8dab4ec14f013e9a3513e1023290018ec6b33a8 /browser-plugin/scriptable.cpp
parent4ca63208acd85880d873b2e59e6ce42df33f874c (diff)
browser-plugin: add methods for calling browser wrapper functions
Diffstat (limited to 'browser-plugin/scriptable.cpp')
-rw-r--r--browser-plugin/scriptable.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/browser-plugin/scriptable.cpp b/browser-plugin/scriptable.cpp
index 0be9736..ff4f064 100644
--- a/browser-plugin/scriptable.cpp
+++ b/browser-plugin/scriptable.cpp
@@ -293,6 +293,22 @@ ScriptablePluginObject::SetProperty (NPIdentifier name, const NPVariant *value)
return false;
}
+void
+ScriptablePluginObject::CallBrowser (const char *function_name)
+{
+ if (!mMagicWrapper) {
+ return;
+ }
+
+ NPVariant rval;
+
+ if (NPERR_NO_ERROR == NPN_Invoke (mNpp, mMagicWrapper,
+ NPN_GetStringIdentifier (function_name),
+ NULL, 0, &rval)) {
+ NPN_ReleaseVariantValue (&rval);
+ }
+}
+
bool
ScriptablePluginObject::Invoke (NPIdentifier name, const NPVariant *args,
uint32_t argCount, NPVariant *result)