recognize when plugin is eligable for user events and then notify the plugin.
This commit is contained in:
@@ -4504,6 +4504,15 @@ public class WebView extends AbsoluteLayout
|
||||
mCallbackProxy.uiOverrideUrlLoading(url);
|
||||
}
|
||||
|
||||
// called by JNI
|
||||
private void sendPluginState(int state) {
|
||||
WebViewCore.PluginStateData psd = new WebViewCore.PluginStateData();
|
||||
psd.mFrame = nativeCursorFramePointer();
|
||||
psd.mNode = nativeCursorNodePointer();
|
||||
psd.mState = state;
|
||||
mWebViewCore.sendMessage(EventHub.PLUGIN_STATE, psd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requestFocus(int direction, Rect previouslyFocusedRect) {
|
||||
boolean result = false;
|
||||
|
||||
@@ -440,6 +440,8 @@ final class WebViewCore {
|
||||
*/
|
||||
private native void nativeSetDatabaseQuota(long quota);
|
||||
|
||||
private native void nativeUpdatePluginState(int framePtr, int nodePtr, int state);
|
||||
|
||||
// EventHub for processing messages
|
||||
private final EventHub mEventHub;
|
||||
// WebCore thread handler
|
||||
@@ -570,6 +572,12 @@ final class WebViewCore {
|
||||
int mY;
|
||||
}
|
||||
|
||||
static class PluginStateData {
|
||||
int mFrame;
|
||||
int mNode;
|
||||
int mState;
|
||||
}
|
||||
|
||||
static final String[] HandlerDebugString = {
|
||||
"LOAD_URL", // = 100;
|
||||
"STOP_LOADING", // = 101;
|
||||
@@ -598,7 +606,7 @@ final class WebViewCore {
|
||||
"SINGLE_LISTBOX_CHOICE", // = 124;
|
||||
"MESSAGE_RELAY", // = 125;
|
||||
"SET_BACKGROUND_COLOR", // = 126;
|
||||
"127", // = 127;
|
||||
"PLUGIN_STATE", // = 127;
|
||||
"SAVE_DOCUMENT_STATE", // = 128;
|
||||
"GET_SELECTION", // = 129;
|
||||
"WEBKIT_DRAW", // = 130;
|
||||
@@ -648,6 +656,7 @@ final class WebViewCore {
|
||||
static final int SINGLE_LISTBOX_CHOICE = 124;
|
||||
static final int MESSAGE_RELAY = 125;
|
||||
static final int SET_BACKGROUND_COLOR = 126;
|
||||
static final int PLUGIN_STATE = 127; // plugin notifications
|
||||
static final int SAVE_DOCUMENT_STATE = 128;
|
||||
static final int GET_SELECTION = 129;
|
||||
static final int WEBKIT_DRAW = 130;
|
||||
@@ -885,6 +894,11 @@ final class WebViewCore {
|
||||
nativeFreeMemory();
|
||||
break;
|
||||
|
||||
case PLUGIN_STATE:
|
||||
PluginStateData psd = (PluginStateData) msg.obj;
|
||||
nativeUpdatePluginState(psd.mFrame, psd.mNode, psd.mState);
|
||||
break;
|
||||
|
||||
case SET_NETWORK_STATE:
|
||||
if (BrowserFrame.sJavaBridge == null) {
|
||||
throw new IllegalStateException("No WebView " +
|
||||
|
||||
Reference in New Issue
Block a user