am 718d69f9: changing how plugins gain/lose focus.
Merge commit '718d69f931e320b9a8d98371a0b4925d7c2e83f4' into eclair-mr2-plus-aosp * commit '718d69f931e320b9a8d98371a0b4925d7c2e83f4': changing how plugins gain/lose focus.
This commit is contained in:
@@ -3355,10 +3355,7 @@ public class WebView extends AbsoluteLayout
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nativeFocusCandidateIsPlugin()) {
|
if (nativeCursorIsTextInput()) {
|
||||||
nativeUpdatePluginReceivesEvents();
|
|
||||||
invalidate();
|
|
||||||
} else if (nativeCursorIsTextInput()) {
|
|
||||||
// This message will put the node in focus, for the DOM's notion
|
// This message will put the node in focus, for the DOM's notion
|
||||||
// of focus, and make the focuscontroller active
|
// of focus, and make the focuscontroller active
|
||||||
mWebViewCore.sendMessage(EventHub.CLICK, nativeCursorFramePointer(),
|
mWebViewCore.sendMessage(EventHub.CLICK, nativeCursorFramePointer(),
|
||||||
@@ -3457,7 +3454,6 @@ public class WebView extends AbsoluteLayout
|
|||||||
if (!nativeCursorIntersects(visibleRect)) {
|
if (!nativeCursorIntersects(visibleRect)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
nativeUpdatePluginReceivesEvents();
|
|
||||||
WebViewCore.CursorData data = cursorData();
|
WebViewCore.CursorData data = cursorData();
|
||||||
mWebViewCore.sendMessage(EventHub.SET_MOVE_MOUSE, data);
|
mWebViewCore.sendMessage(EventHub.SET_MOVE_MOUSE, data);
|
||||||
playSoundEffect(SoundEffectConstants.CLICK);
|
playSoundEffect(SoundEffectConstants.CLICK);
|
||||||
@@ -4793,19 +4789,6 @@ public class WebView extends AbsoluteLayout
|
|||||||
mCallbackProxy.uiOverrideUrlLoading(url);
|
mCallbackProxy.uiOverrideUrlLoading(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// called by JNI
|
|
||||||
private void sendPluginState(int state) {
|
|
||||||
WebViewCore.PluginStateData psd = new WebViewCore.PluginStateData();
|
|
||||||
psd.mFrame = nativeFocusCandidateFramePointer();
|
|
||||||
psd.mNode = nativeFocusCandidatePointer();
|
|
||||||
if (DebugFlags.WEB_VIEW) {
|
|
||||||
Log.v(LOGTAG, "sendPluginState frame=" + psd.mFrame
|
|
||||||
+ " node=" + psd.mNode);
|
|
||||||
}
|
|
||||||
psd.mState = state;
|
|
||||||
mWebViewCore.sendMessage(EventHub.PLUGIN_STATE, psd);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requestFocus(int direction, Rect previouslyFocusedRect) {
|
public boolean requestFocus(int direction, Rect previouslyFocusedRect) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
@@ -5201,9 +5184,7 @@ public class WebView extends AbsoluteLayout
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MOVE_OUT_OF_PLUGIN:
|
case MOVE_OUT_OF_PLUGIN:
|
||||||
if (nativePluginEatsNavKey()) {
|
navHandledKey(msg.arg1, 1, false, 0, true);
|
||||||
navHandledKey(msg.arg1, 1, false, 0, true);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case UPDATE_TEXT_ENTRY_MSG_ID:
|
case UPDATE_TEXT_ENTRY_MSG_ID:
|
||||||
// this is sent after finishing resize in WebViewCore. Make
|
// this is sent after finishing resize in WebViewCore. Make
|
||||||
@@ -5697,7 +5678,7 @@ public class WebView extends AbsoluteLayout
|
|||||||
if (mNativeClass == 0) {
|
if (mNativeClass == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (ignorePlugin == false && nativePluginEatsNavKey()) {
|
if (ignorePlugin == false && nativeFocusIsPlugin()) {
|
||||||
KeyEvent event = new KeyEvent(time, time, KeyEvent.ACTION_DOWN
|
KeyEvent event = new KeyEvent(time, time, KeyEvent.ACTION_DOWN
|
||||||
, keyCode, count, (mShiftIsPressed ? KeyEvent.META_SHIFT_ON : 0)
|
, keyCode, count, (mShiftIsPressed ? KeyEvent.META_SHIFT_ON : 0)
|
||||||
| (false ? KeyEvent.META_ALT_ON : 0) // FIXME
|
| (false ? KeyEvent.META_ALT_ON : 0) // FIXME
|
||||||
@@ -5831,6 +5812,7 @@ public class WebView extends AbsoluteLayout
|
|||||||
/* package */ native int nativeFocusCandidatePointer();
|
/* package */ native int nativeFocusCandidatePointer();
|
||||||
private native String nativeFocusCandidateText();
|
private native String nativeFocusCandidateText();
|
||||||
private native int nativeFocusCandidateTextSize();
|
private native int nativeFocusCandidateTextSize();
|
||||||
|
private native boolean nativeFocusIsPlugin();
|
||||||
/* package */ native int nativeFocusNodePointer();
|
/* package */ native int nativeFocusNodePointer();
|
||||||
private native Rect nativeGetCursorRingBounds();
|
private native Rect nativeGetCursorRingBounds();
|
||||||
private native Region nativeGetSelection();
|
private native Region nativeGetSelection();
|
||||||
@@ -5848,7 +5830,6 @@ public class WebView extends AbsoluteLayout
|
|||||||
private native int nativeMoveGeneration();
|
private native int nativeMoveGeneration();
|
||||||
private native void nativeMoveSelection(int x, int y,
|
private native void nativeMoveSelection(int x, int y,
|
||||||
boolean extendSelection);
|
boolean extendSelection);
|
||||||
private native boolean nativePluginEatsNavKey();
|
|
||||||
// Like many other of our native methods, you must make sure that
|
// Like many other of our native methods, you must make sure that
|
||||||
// mNativeClass is not null before calling this method.
|
// mNativeClass is not null before calling this method.
|
||||||
private native void nativeRecordButtons(boolean focused,
|
private native void nativeRecordButtons(boolean focused,
|
||||||
@@ -5870,7 +5851,6 @@ public class WebView extends AbsoluteLayout
|
|||||||
// we always want to pass in our generation number.
|
// we always want to pass in our generation number.
|
||||||
private native void nativeUpdateCachedTextfield(String updatedText,
|
private native void nativeUpdateCachedTextfield(String updatedText,
|
||||||
int generation);
|
int generation);
|
||||||
private native void nativeUpdatePluginReceivesEvents();
|
|
||||||
// return NO_LEFTEDGE means failure.
|
// return NO_LEFTEDGE means failure.
|
||||||
private static final int NO_LEFTEDGE = -1;
|
private static final int NO_LEFTEDGE = -1;
|
||||||
private native int nativeGetBlockLeftEdge(int x, int y, float scale);
|
private native int nativeGetBlockLeftEdge(int x, int y, float scale);
|
||||||
|
|||||||
@@ -560,8 +560,6 @@ final class WebViewCore {
|
|||||||
*/
|
*/
|
||||||
private native void nativeSetNewStorageLimit(long limit);
|
private native void nativeSetNewStorageLimit(long limit);
|
||||||
|
|
||||||
private native void nativeUpdatePluginState(int framePtr, int nodePtr, int state);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provide WebCore with a Geolocation permission state for the specified
|
* Provide WebCore with a Geolocation permission state for the specified
|
||||||
* origin.
|
* origin.
|
||||||
@@ -716,12 +714,6 @@ final class WebViewCore {
|
|||||||
int mY;
|
int mY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class PluginStateData {
|
|
||||||
int mFrame;
|
|
||||||
int mNode;
|
|
||||||
int mState;
|
|
||||||
}
|
|
||||||
|
|
||||||
static class GeolocationPermissionsData {
|
static class GeolocationPermissionsData {
|
||||||
String mOrigin;
|
String mOrigin;
|
||||||
boolean mAllow;
|
boolean mAllow;
|
||||||
@@ -758,7 +750,7 @@ final class WebViewCore {
|
|||||||
"SINGLE_LISTBOX_CHOICE", // = 124;
|
"SINGLE_LISTBOX_CHOICE", // = 124;
|
||||||
"MESSAGE_RELAY", // = 125;
|
"MESSAGE_RELAY", // = 125;
|
||||||
"SET_BACKGROUND_COLOR", // = 126;
|
"SET_BACKGROUND_COLOR", // = 126;
|
||||||
"PLUGIN_STATE", // = 127;
|
"127", // = 127
|
||||||
"SAVE_DOCUMENT_STATE", // = 128;
|
"SAVE_DOCUMENT_STATE", // = 128;
|
||||||
"GET_SELECTION", // = 129;
|
"GET_SELECTION", // = 129;
|
||||||
"WEBKIT_DRAW", // = 130;
|
"WEBKIT_DRAW", // = 130;
|
||||||
@@ -809,7 +801,6 @@ final class WebViewCore {
|
|||||||
static final int SINGLE_LISTBOX_CHOICE = 124;
|
static final int SINGLE_LISTBOX_CHOICE = 124;
|
||||||
static final int MESSAGE_RELAY = 125;
|
static final int MESSAGE_RELAY = 125;
|
||||||
static final int SET_BACKGROUND_COLOR = 126;
|
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 SAVE_DOCUMENT_STATE = 128;
|
||||||
static final int GET_SELECTION = 129;
|
static final int GET_SELECTION = 129;
|
||||||
static final int WEBKIT_DRAW = 130;
|
static final int WEBKIT_DRAW = 130;
|
||||||
@@ -1069,11 +1060,6 @@ final class WebViewCore {
|
|||||||
nativeFreeMemory();
|
nativeFreeMemory();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLUGIN_STATE:
|
|
||||||
PluginStateData psd = (PluginStateData) msg.obj;
|
|
||||||
nativeUpdatePluginState(psd.mFrame, psd.mNode, psd.mState);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SET_NETWORK_STATE:
|
case SET_NETWORK_STATE:
|
||||||
if (BrowserFrame.sJavaBridge == null) {
|
if (BrowserFrame.sJavaBridge == null) {
|
||||||
throw new IllegalStateException("No WebView " +
|
throw new IllegalStateException("No WebView " +
|
||||||
|
|||||||
Reference in New Issue
Block a user