diff options
Diffstat (limited to 'browser-plugin')
-rw-r--r-- | browser-plugin/scriptable.cpp | 37 |
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; |