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:
authorMarco Pesenti Gritti <marcopg@litl.com>2010-04-23 10:28:14 (GMT)
committer Marco Pesenti Gritti <marcopg@litl.com>2010-07-27 22:04:23 (GMT)
commit58cabe30a23a9d640c6cbbc78ae0c4477dba7efe (patch)
tree2d89e708f3358d9ef6e6c3eb269551f56dc1e332 /browser-plugin/scriptable.cpp
parent64edc353390ba3d92707c7457208c60e8103122a (diff)
Drop the properties hack
We don't need it anymore with chrome, we can call methods.
Diffstat (limited to 'browser-plugin/scriptable.cpp')
-rw-r--r--browser-plugin/scriptable.cpp37
1 files changed, 0 insertions, 37 deletions
diff --git a/browser-plugin/scriptable.cpp b/browser-plugin/scriptable.cpp
index 2c03ee8..7715134 100644
--- a/browser-plugin/scriptable.cpp
+++ b/browser-plugin/scriptable.cpp
@@ -23,10 +23,6 @@
#include "plugin.h"
#include <string.h>
-// FIXME: attempts to call methods are resulting in
-// Error: NPMethod called on non-NPObject wrapped JSObject!
-#define CAN_CALL_METHODS 0
-
void
ScriptablePluginObjectBase::Invalidate ()
{
@@ -216,7 +212,6 @@ ScriptablePluginObject::ScriptablePluginObject (NPP npp) :
bool
ScriptablePluginObject::HasMethod (NPIdentifier name)
{
-#if CAN_CALL_METHODS
NPIdentifier methods[] = {
mZoomInID,
mZoomOutID,
@@ -230,7 +225,6 @@ ScriptablePluginObject::HasMethod (NPIdentifier name)
return true;
}
}
-#endif
return false;
}
@@ -239,11 +233,6 @@ bool
ScriptablePluginObject::HasProperty (NPIdentifier name)
{
NPIdentifier properties[] = {
-#if !CAN_CALL_METHODS
- mFindTermsID,
- mFindNextID,
- mFindPreviousID,
-#endif
mTitleID,
mZoomID,
mCanCopyID,
@@ -284,14 +273,6 @@ ScriptablePluginObject::GetProperty (NPIdentifier name, NPVariant *result)
} else if (name == mCanFindOnPageID) {
BOOLEAN_TO_NPVARIANT (plugin->mCanFindOnPage, *result);
return true;
-#if !CAN_CALL_METHODS
- } else if (name == mFindTermsID) {
- NULL_TO_NPVARIANT (*result);
- return true;
- } else if (name == mFindNextID || name == mFindPreviousID) {
- INT32_TO_NPVARIANT (42, *result);
- return true;
-#endif
}
return false;
@@ -351,22 +332,6 @@ ScriptablePluginObject::SetProperty (NPIdentifier name, const NPVariant *value)
plugin->CopyClipboard ();
return true;
-#if !CAN_CALL_METHODS
- } else if (name == mFindTermsID) {
- if (!NPVARIANT_IS_STRING (*value)) {
- NPN_SetException (this, "Invalid type for findTerms, expected a string");
- return false;
- }
-
- plugin->Find (NPVARIANT_TO_STRING (*value).utf8characters);
- return true;
- } else if (name == mFindNextID) {
- plugin->FindNext ();
- return true;
- } else if (name == mFindPreviousID) {
- plugin->FindPrevious ();
- return true;
-#endif
}
return false;
@@ -400,7 +365,6 @@ ScriptablePluginObject::Invoke (NPIdentifier name, const NPVariant *args,
} else if (name == mZoomOutID) {
plugin->ZoomOut ();
return true;
-#if CAN_CALL_METHODS
} else if (name == mFindTermsID) {
if (argCount < 1 || !NPVARIANT_IS_STRING (args[0])) {
return false;
@@ -413,7 +377,6 @@ ScriptablePluginObject::Invoke (NPIdentifier name, const NPVariant *args,
} else if (name == mFindPreviousID) {
plugin->FindPrevious ();
return true;
-#endif
}
return false;