diff options
author | Mike Reed <reed@google.com> | 2009-05-26 16:35:00 -0400 |
---|---|---|
committer | Mike Reed <reed@google.com> | 2009-05-28 08:59:58 -0400 |
commit | be9123233ec803662e74d4333c1aab0bb201bb84 (patch) | |
tree | 67ebf0636023f4f0b48b62a8681cd6e0e50ce77a /WebKit/android/jni/WebViewCore.cpp | |
parent | ea2ac40c875b133ef9d88dfbbbb587364eac8e07 (diff) | |
download | external_webkit-be9123233ec803662e74d4333c1aab0bb201bb84.zip external_webkit-be9123233ec803662e74d4333c1aab0bb201bb84.tar.gz external_webkit-be9123233ec803662e74d4333c1aab0bb201bb84.tar.bz2 |
add pause/resume events for plugins
add sendEvent() api to widget
add jni pause/resume functions to be called from java
Diffstat (limited to 'WebKit/android/jni/WebViewCore.cpp')
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 823a30f..89013ff 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -81,6 +81,7 @@ #include "ResourceRequest.h" #include "SelectionController.h" #include "Settings.h" +#include "SkANP.h" #include "SkTemplates.h" #include "SkTypes.h" #include "SkCanvas.h" @@ -1194,6 +1195,15 @@ void WebViewCore::drawPlugins() } } +void WebViewCore::sendPluginEvent(const ANPEvent& evt) +{ + PluginWidgetAndroid** iter = m_plugins.begin(); + PluginWidgetAndroid** stop = m_plugins.end(); + for (; iter < stop; ++iter) { + (*iter)->sendEvent(evt); + } +} + /////////////////////////////////////////////////////////////////////////////// void WebViewCore::setFinalFocus(WebCore::Frame* frame, WebCore::Node* node, @@ -2568,6 +2578,20 @@ static bool PictureReady(JNIEnv* env, jobject obj) return GET_NATIVE_VIEW(env, obj)->pictureReady(); } +static void Pause(JNIEnv* env, jobject obj) +{ + ANPEvent event; + SkANP::InitEvent(&event, kPause_ANPEventType); + GET_NATIVE_VIEW(env, obj)->sendPluginEvent(event); +} + +static void Resume(JNIEnv* env, jobject obj) +{ + ANPEvent event; + SkANP::InitEvent(&event, kResume_ANPEventType); + GET_NATIVE_VIEW(env, obj)->sendPluginEvent(event); +} + // ---------------------------------------------------------------------------- /* @@ -2649,7 +2673,9 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { { "nativeDumpNavTree", "()V", (void*) DumpNavTree }, { "nativeSetDatabaseQuota", "(J)V", - (void*) SetDatabaseQuota } + (void*) SetDatabaseQuota }, + { "nativePause", "()V", (void*) Pause }, + { "nativeResume", "()V", (void*) Resume }, }; int register_webviewcore(JNIEnv* env) |