am 5de6389f: DO NOT MERGE. Send a message when the picture changes and find is up to search again.

Merge commit '5de6389f2252cb6e39918e21f80a08918e0c2c02' into eclair-mr2-plus-aosp

* commit '5de6389f2252cb6e39918e21f80a08918e0c2c02':
  DO NOT MERGE. Send a message when the picture changes and find is up to search again.
This commit is contained in:
Leon Scroggins
2009-10-29 10:10:00 -07:00
committed by Android Git Automerger
2 changed files with 20 additions and 1 deletions

View File

@@ -462,6 +462,7 @@ public class WebView extends AbsoluteLayout
static final int UPDATE_TEXT_ENTRY_MSG_ID = 15; static final int UPDATE_TEXT_ENTRY_MSG_ID = 15;
static final int WEBCORE_INITIALIZED_MSG_ID = 16; static final int WEBCORE_INITIALIZED_MSG_ID = 16;
static final int UPDATE_TEXTFIELD_TEXT_MSG_ID = 17; static final int UPDATE_TEXTFIELD_TEXT_MSG_ID = 17;
static final int FIND_AGAIN = 18;
static final int MOVE_OUT_OF_PLUGIN = 19; static final int MOVE_OUT_OF_PLUGIN = 19;
static final int CLEAR_TEXT_ENTRY = 20; static final int CLEAR_TEXT_ENTRY = 20;
static final int UPDATE_TEXT_SELECTION_MSG_ID = 21; static final int UPDATE_TEXT_SELECTION_MSG_ID = 21;
@@ -491,7 +492,7 @@ public class WebView extends AbsoluteLayout
"UPDATE_TEXT_ENTRY_MSG_ID", // = 15; "UPDATE_TEXT_ENTRY_MSG_ID", // = 15;
"WEBCORE_INITIALIZED_MSG_ID", // = 16; "WEBCORE_INITIALIZED_MSG_ID", // = 16;
"UPDATE_TEXTFIELD_TEXT_MSG_ID", // = 17; "UPDATE_TEXTFIELD_TEXT_MSG_ID", // = 17;
"18", // = 18; "FIND_AGAIN", // = 18;
"MOVE_OUT_OF_PLUGIN", // = 19; "MOVE_OUT_OF_PLUGIN", // = 19;
"CLEAR_TEXT_ENTRY", // = 20; "CLEAR_TEXT_ENTRY", // = 20;
"UPDATE_TEXT_SELECTION_MSG_ID", // = 21; "UPDATE_TEXT_SELECTION_MSG_ID", // = 21;
@@ -2362,6 +2363,7 @@ public class WebView extends AbsoluteLayout
} }
int result = nativeFindAll(find.toLowerCase(), find.toUpperCase()); int result = nativeFindAll(find.toLowerCase(), find.toUpperCase());
invalidate(); invalidate();
mLastFind = find;
return result; return result;
} }
@@ -2369,6 +2371,9 @@ public class WebView extends AbsoluteLayout
// or not we draw the highlights for matches. // or not we draw the highlights for matches.
private boolean mFindIsUp; private boolean mFindIsUp;
private int mFindHeight; private int mFindHeight;
// Keep track of the last string sent, so we can search again after an
// orientation change or the dismissal of the soft keyboard.
private String mLastFind;
/** /**
* Return the first substring consisting of the address of a physical * Return the first substring consisting of the address of a physical
@@ -5261,6 +5266,13 @@ public class WebView extends AbsoluteLayout
} }
break; break;
case FIND_AGAIN:
// Ignore if find has been dismissed.
if (mFindIsUp) {
findAll(mLastFind);
}
break;
case DRAG_HELD_MOTIONLESS: case DRAG_HELD_MOTIONLESS:
mHeldMotionless = MOTIONLESS_TRUE; mHeldMotionless = MOTIONLESS_TRUE;
invalidate(); invalidate();

View File

@@ -2115,6 +2115,13 @@ final class WebViewCore {
WebView.CLEAR_TEXT_ENTRY).sendToTarget(); WebView.CLEAR_TEXT_ENTRY).sendToTarget();
} }
// called by JNI
private void sendFindAgain() {
if (mWebView == null) return;
Message.obtain(mWebView.mPrivateHandler,
WebView.FIND_AGAIN).sendToTarget();
}
private native void nativeUpdateFrameCacheIfLoading(); private native void nativeUpdateFrameCacheIfLoading();
/** /**