summaryrefslogtreecommitdiffstats
path: root/WebCore/plugins/android/PluginViewAndroid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/plugins/android/PluginViewAndroid.cpp')
-rw-r--r--WebCore/plugins/android/PluginViewAndroid.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/WebCore/plugins/android/PluginViewAndroid.cpp b/WebCore/plugins/android/PluginViewAndroid.cpp
index 5b7aea9..452c9fb 100644
--- a/WebCore/plugins/android/PluginViewAndroid.cpp
+++ b/WebCore/plugins/android/PluginViewAndroid.cpp
@@ -369,11 +369,22 @@ NPError PluginView::getValueStatic(NPNVariable variable, void* value)
{
// our interface query is valid with no NPP instance
NPError error = NPERR_GENERIC_ERROR;
- if ((value != NULL) && (variable == NPNVisOfflineBool)) {
- bool* retValue = static_cast<bool*>(value);
- *retValue = !networkStateNotifier().onLine();
- return NPERR_NO_ERROR;
+
+ switch (variable) {
+ case NPNVisOfflineBool: {
+ if (value != NULL) {
+ bool* retValue = static_cast<bool*>(value);
+ *retValue = !networkStateNotifier().onLine();
+ return NPERR_NO_ERROR;
+ }
+ }
+ case kJavaContext_ANPGetValue: {
+ jobject* retObject = static_cast<jobject*>(value);
+ *retObject = android::WebViewCore::getApplicationContext();
+ return NPERR_NO_ERROR;
+ }
}
+
(void)anp_getInterface(variable, value, &error);
return error;
}