From ba96c5ad9d140287cc378faec6bd9384836a00e6 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Mon, 9 Mar 2009 11:52:12 -0700 Subject: auto import from //branches/cupcake/...@137197 --- WebCore/plugins/android/PluginViewAndroid.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'WebCore/plugins') diff --git a/WebCore/plugins/android/PluginViewAndroid.cpp b/WebCore/plugins/android/PluginViewAndroid.cpp index fc7bf86..09117ae 100644 --- a/WebCore/plugins/android/PluginViewAndroid.cpp +++ b/WebCore/plugins/android/PluginViewAndroid.cpp @@ -43,6 +43,7 @@ #include "KeyboardEvent.h" #include "MIMETypeRegistry.h" #include "MouseEvent.h" +#include "NetworkStateNotifier.h" #include "NotImplemented.h" #include "Page.h" #include "PlatformGraphicsContext.h" @@ -290,6 +291,11 @@ 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(value); + *retValue = !networkStateNotifier().onLine(); + return NPERR_NO_ERROR; + } (void)anp_getInterface(variable, value, &error); return error; } @@ -431,6 +437,15 @@ NPError PluginView::getValue(NPNVariable variable, void* value) *retObject = android::WebViewCore::getWebViewCore(parent())->getWebViewJavaObject(); return NPERR_NO_ERROR; } + + case NPNVisOfflineBool: { + if (value == NULL) { + return NPERR_GENERIC_ERROR; + } + bool* retValue = static_cast(value); + *retValue = !networkStateNotifier().onLine(); + return NPERR_NO_ERROR; + } case kSupportedDrawingModel_ANPGetValue: { uint32_t* bits = reinterpret_cast(value); @@ -549,4 +564,3 @@ void PluginView::setParentVisible(bool) { } } // namespace WebCore - -- cgit v1.1