Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d405a433 authored by Victoria Lease's avatar Victoria Lease
Browse files

move FindListener into WebView

Also took advantage of the opportunity to adjust the javadoc.

Bug: 6052412
Change-Id: I3de2cc6f2b5af20acb87d6e0a105ac12b1be679b
parent 2e842a58
Loading
Loading
Loading
Loading
+0 −32
Original line number Diff line number Diff line
/*
 * Copyright (C) 2012 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.webkit;

/**
 * @hide
 */
public interface FindListener {
    /**
     * Notify the host application that a find result is available.
     *
     * @param numberOfMatches How many matches have been found
     * @param activeMatchOrdinal The ordinal of the currently selected match
     * @param isDoneCounting Whether we have finished counting matches
     */
    public void onFindResultReceived(int numberOfMatches,
        int activeMatchOrdinal, boolean isDoneCounting);
}
+21 −3
Original line number Diff line number Diff line
@@ -311,6 +311,24 @@ public class WebView extends AbsoluteLayout
     */
    public static final String SCHEME_GEO = "geo:0,0?q=";

    /**
     * Interface to listen for find results.
     * @hide
     */
    public interface FindListener {
        /**
         * Notify the listener about progress made by a find operation.
         *
         * @param numberOfMatches How many matches have been found.
         * @param activeMatchOrdinal The zero-based ordinal of the currently selected match.
         * @param isDoneCounting Whether the find operation has actually completed. The listener
         * may be notified multiple times while the operation is underway, and the numberOfMatches
         * value should not be considered final unless isDoneCounting is true.
         */
        public void onFindResultReceived(int numberOfMatches, int activeMatchOrdinal,
            boolean isDoneCounting);
    }

    /**
     * Interface to listen for new pictures as they change.
     * @deprecated This interface is now obsolete.
@@ -1228,10 +1246,10 @@ 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.
     * Register the listener to be notified as find-on-page operations progress.
     * This will replace the current listener.
     *
     * @param listener An implementation of FindListener
     * @param listener An implementation of {@link WebView#FindListener}.
     * @hide
     */
    public void setFindListener(FindListener listener) {
+4 −6
Original line number Diff line number Diff line
@@ -1440,7 +1440,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
    private PictureListener mPictureListener;

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

    /**
     * Refer to {@link WebView#requestFocusNodeHref(Message)} for more information
@@ -3620,12 +3620,10 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
    }

    /**
     * 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
     * See {@link WebView#setFindListener(WebView.FindListener)}.
     * @hide
     */
     public void setFindListener(FindListener listener) {
     public void setFindListener(WebView.FindListener listener) {
         mFindListener = listener;
     }

+1 −1
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ public interface WebViewProvider {

    public WebBackForwardList copyBackForwardList();

    public void setFindListener(FindListener listener);
    public void setFindListener(WebView.FindListener listener);

    public void findNext(boolean forward);