Updating samplePlugin to use java surface views.
Change-Id: I1b925ce3a6aeb0bd5464a7d5711449029944d7de
diff --git a/samples/BrowserPlugin/jni/main.cpp b/samples/BrowserPlugin/jni/main.cpp
index b5aea95..7f7496b 100644
--- a/samples/BrowserPlugin/jni/main.cpp
+++ b/samples/BrowserPlugin/jni/main.cpp
@@ -33,7 +33,6 @@
#include "BackgroundPlugin.h"
#include "FormPlugin.h"
#include "PaintPlugin.h"
-#include "android_npapi.h"
NPNetscapeFuncs* browser;
#define EXPORT __attribute__((visibility("default")))
@@ -173,6 +172,15 @@
}
}
+ // notify the plugin API of the location of the java interface
+ char* className = "com.android.sampleplugin.SamplePluginStub";
+ NPError npErr = browser->setvalue(instance, kSetJavaClassName_ANPSetValue,
+ reinterpret_cast<void*>(className));
+ if (npErr) {
+ gLogI.log(instance, kError_ANPLogType, "set class err %d", npErr);
+ return npErr;
+ }
+
// notify the plugin API of the drawing model we wish to use. This must be
// done prior to creating certain subPlugin objects (e.g. surfaceViews)
NPError err = browser->setvalue(instance, kRequestDrawingModel_ANPSetValue,