Skip to content

Commit 6af84f6

Browse files
Victoria LeaseAndroid (Google) Code Review
authored andcommitted
Merge "move FindListener into WebView"
2 parents c610a6b + d405a43 commit 6af84f6

File tree

4 files changed

+26
-42
lines changed

4 files changed

+26
-42
lines changed

core/java/android/webkit/FindListener.java

Lines changed: 0 additions & 32 deletions
This file was deleted.

core/java/android/webkit/WebView.java

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,24 @@ public synchronized WebView getWebView() {
311311
*/
312312
public static final String SCHEME_GEO = "geo:0,0?q=";
313313

314+
/**
315+
* Interface to listen for find results.
316+
* @hide
317+
*/
318+
public interface FindListener {
319+
/**
320+
* Notify the listener about progress made by a find operation.
321+
*
322+
* @param numberOfMatches How many matches have been found.
323+
* @param activeMatchOrdinal The zero-based ordinal of the currently selected match.
324+
* @param isDoneCounting Whether the find operation has actually completed. The listener
325+
* may be notified multiple times while the operation is underway, and the numberOfMatches
326+
* value should not be considered final unless isDoneCounting is true.
327+
*/
328+
public void onFindResultReceived(int numberOfMatches, int activeMatchOrdinal,
329+
boolean isDoneCounting);
330+
}
331+
314332
/**
315333
* Interface to listen for new pictures as they change.
316334
* @deprecated This interface is now obsolete.
@@ -1228,10 +1246,10 @@ public WebBackForwardList copyBackForwardList() {
12281246
}
12291247

12301248
/**
1231-
* Register the interface to be used when a find-on-page result has become
1232-
* available. This will replace the current handler.
1249+
* Register the listener to be notified as find-on-page operations progress.
1250+
* This will replace the current listener.
12331251
*
1234-
* @param listener An implementation of FindListener
1252+
* @param listener An implementation of {@link WebView#FindListener}.
12351253
* @hide
12361254
*/
12371255
public void setFindListener(FindListener listener) {

core/java/android/webkit/WebViewClassic.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ public void onTrimMemory(int level) {
14401440
private PictureListener mPictureListener;
14411441

14421442
// Used to notify listeners about find-on-page results.
1443-
private FindListener mFindListener;
1443+
private WebView.FindListener mFindListener;
14441444

14451445
/**
14461446
* Refer to {@link WebView#requestFocusNodeHref(Message)} for more information
@@ -3620,12 +3620,10 @@ public WebBackForwardList copyBackForwardList() {
36203620
}
36213621

36223622
/**
3623-
* Register the interface to be used when a find-on-page result has become
3624-
* available. This will replace the current handler.
3625-
*
3626-
* @param listener An implementation of FindListener
3623+
* See {@link WebView#setFindListener(WebView.FindListener)}.
3624+
* @hide
36273625
*/
3628-
public void setFindListener(FindListener listener) {
3626+
public void setFindListener(WebView.FindListener listener) {
36293627
mFindListener = listener;
36303628
}
36313629

core/java/android/webkit/WebViewProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public void loadDataWithBaseURL(String baseUrl, String data,
192192

193193
public WebBackForwardList copyBackForwardList();
194194

195-
public void setFindListener(FindListener listener);
195+
public void setFindListener(WebView.FindListener listener);
196196

197197
public void findNext(boolean forward);
198198

0 commit comments

Comments
 (0)