diff options
author | Leon Scroggins <scroggo@google.com> | 2010-05-06 17:41:43 -0400 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2010-05-06 18:03:30 -0400 |
commit | afbc0998ef990403a8e17efb9a384a46707a328e (patch) | |
tree | a33e01bac0723b6e9e0e4beae0b9a3833a1449a5 /WebKit | |
parent | 5c5475b0621577b1ac7e2bdb3870e3e2253d25c6 (diff) | |
download | external_webkit-afbc0998ef990403a8e17efb9a384a46707a328e.zip external_webkit-afbc0998ef990403a8e17efb9a384a46707a328e.tar.gz external_webkit-afbc0998ef990403a8e17efb9a384a46707a328e.tar.bz2 |
Provide access to current match highlighted.
Part of fix for issue 2663680
Requires a change to frameworks/base.
Change-Id: I79e460867973cbfcb3105d46058de705877f0aa9
Diffstat (limited to 'WebKit')
-rw-r--r-- | WebKit/android/nav/FindCanvas.h | 1 | ||||
-rw-r--r-- | WebKit/android/nav/WebView.cpp | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/WebKit/android/nav/FindCanvas.h b/WebKit/android/nav/FindCanvas.h index b9dbeea..34929ec 100644 --- a/WebKit/android/nav/FindCanvas.h +++ b/WebKit/android/nav/FindCanvas.h @@ -220,6 +220,7 @@ public: virtual ~FindOnPage() { delete m_matches; } void clearCurrentLocation() { m_hasCurrentLocation = false; } IntRect currentMatchBounds() const; + int currentMatchIndex() const { return m_findIndex; } bool currentMatchIsInLayer() const; virtual void draw(SkCanvas* , LayerAndroid* ); void findNext(bool forward); diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index fff0ea3..62bd747 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -1026,6 +1026,11 @@ void setMatches(WTF::Vector<MatchInfo>* matches) viewInvalidate(); } +int currentMatchIndex() +{ + return m_findOnPage.currentMatchIndex(); +} + bool scrollBy(int dx, int dy) { LOG_ASSERT(m_javaGlue.m_obj, "A java object was not associated with this native WebView!"); @@ -1742,6 +1747,13 @@ static void nativeFindNext(JNIEnv *env, jobject obj, bool forward) view->findNext(forward); } +static int nativeFindIndex(JNIEnv *env, jobject obj) +{ + WebView* view = GET_NATIVE_VIEW(env, obj); + LOG_ASSERT(view, "view not set in nativeFindIndex"); + return view->currentMatchIndex(); +} + static void nativeUpdateCachedTextfield(JNIEnv *env, jobject obj, jstring updatedText, jint generation) { WebView* view = GET_NATIVE_VIEW(env, obj); @@ -1948,6 +1960,8 @@ static JNINativeMethod gJavaWebViewMethods[] = { (void*) nativeFindAll }, { "nativeFindNext", "(Z)V", (void*) nativeFindNext }, + { "nativeFindIndex", "()I", + (void*) nativeFindIndex}, { "nativeFocusCandidateFramePointer", "()I", (void*) nativeFocusCandidateFramePointer }, { "nativeFocusCandidateHasNextTextfield", "()Z", |