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

Commit 387b6580 authored by Leon Clarke's avatar Leon Clarke
Browse files

Cancel test selections when they start if the client hasn't overridden the

selection behavior.
http://b/issue?id=2847546

Change-Id: I0d8529add54b3dfbf0af239fda1b15edd7bd32e0
parent ee6aaddb
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -327,14 +327,17 @@ public class WebChromeClient {
     * Tell the client that the selection has been initiated.
     * @hide
     */
    public void onSelectionStart() {
    public void onSelectionStart(WebView view) {
        // By default we cancel the selection again, thus disabling
        // text selection unless the chrome client supports it.
        view.notifySelectDialogDismissed();
    }

    /**
     * Tell the client that the selection has been copied or canceled.
     * @hide
     */
    public void onSelectionDone() {
    public void onSelectionDone(WebView view) {
    }

    /**
+2 −2
Original line number Diff line number Diff line
@@ -3238,7 +3238,7 @@ public class WebView extends AbsoluteLayout
        setUpSelect();
        if (mNativeClass != 0 && nativeWordSelection(x, y)) {
            nativeSetExtendSelection();
            getWebChromeClient().onSelectionStart();
            getWebChromeClient().onSelectionStart(this);
            return true;
        }
        notifySelectDialogDismissed();
@@ -4025,7 +4025,7 @@ public class WebView extends AbsoluteLayout
     */
    public void selectionDone() {
        if (mSelectingText) {
            getWebChromeClient().onSelectionDone();
            getWebChromeClient().onSelectionDone(this);
            invalidate(); // redraw without selection
            notifySelectDialogDismissed();
        }