From abeb6a791501151308d06db6aebb438e16c1a784 Mon Sep 17 00:00:00 2001 From: Victoria Lease Date: Mon, 5 Mar 2012 16:29:12 -0800 Subject: proposed public API for asynchronous find-on-page Bug: 6052412 Change-Id: I63bff3bfda50eede958cb885f5068ae94bdcfe7d --- core/java/android/webkit/WebView.java | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'core/java/android/webkit/WebView.java') diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index a561577f576e..5e094161a848 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -1226,7 +1226,19 @@ public class WebView extends AbsoluteLayout } - /* + /** + * Register the interface to be used when a find-on-page result has become + * available. This will replace the current handler. + * + * @param listener An implementation of FindListener + * @hide + */ + public void setFindListener(FindListener listener) { + checkThread(); + mProvider.setFindListener(listener); + } + + /** * Highlight and scroll to the next occurance of String in findAll. * Wraps the page infinitely, and scrolls. Must be called after * calling findAll. @@ -1238,8 +1250,9 @@ public class WebView extends AbsoluteLayout mProvider.findNext(forward); } - /* + /** * Find all instances of find on the page and highlight them. + * * @param find String to find. * @return int The number of occurances of the String "find" * that were found. @@ -1249,6 +1262,18 @@ public class WebView extends AbsoluteLayout return mProvider.findAll(find); } + /** + * Find all instances of find on the page and highlight them, + * asynchronously. + * + * @param find String to find. + * @hide + */ + public void findAllAsync(String find) { + checkThread(); + mProvider.findAllAsync(find); + } + /** * Start an ActionMode for finding text in this WebView. Only works if this * WebView is attached to the view system. -- cgit v1.2.3