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

Commit a4eddb57 authored by John Reck's avatar John Reck
Browse files

Set initial focus

 Bug: 6108927

Change-Id: I8f9356c41700b05ca36d106b1db34e3a7630b125
parent f804ba13
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -7144,7 +7144,8 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
        if (mFindIsUp) return false;
        boolean result = false;
        result = mWebViewPrivate.super_requestFocus(direction, previouslyFocusedRect);
        if (mWebViewCore.getSettings().getNeedInitialFocus() && !mWebView.isInTouchMode()) {
        if (mWebViewCore.getSettings().getNeedInitialFocus()
                && !mWebView.isInTouchMode()) {
            // For cases such as GMail, where we gain focus from a direction,
            // we want to move to the first available link.
            // FIXME: If there are no visible links, we may not want to
@@ -7165,7 +7166,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
                default:
                    return result;
            }
            // TODO: Send initial focus request to webkit (b/6108927)
            mWebViewCore.sendMessage(EventHub.SET_INITIAL_FOCUS, fakeKeyDirection);
        }
        return result;
    }
+5 −0
Original line number Diff line number Diff line
@@ -1176,6 +1176,7 @@ public final class WebViewCore {

        // key was pressed (down and up)
        static final int KEY_PRESS = 223;
        static final int SET_INITIAL_FOCUS = 224;

        // Private handler for WebCore messages.
        private Handler mHandler;
@@ -1748,6 +1749,9 @@ public final class WebViewCore {
                                    WebViewClassic.UPDATE_MATCH_COUNT, request).sendToTarget();
                            break;
                        }
                        case SET_INITIAL_FOCUS:
                            nativeSetInitialFocus(mNativeClass, msg.arg1);
                            break;
                    }
                }
            };
@@ -3071,6 +3075,7 @@ public final class WebViewCore {
    private native void nativeClearTextSelection(int nativeClass);
    private native boolean nativeSelectWordAt(int nativeClass, int x, int y);
    private native void nativeSelectAll(int nativeClass);
    private native void nativeSetInitialFocus(int nativeClass, int keyDirection);

    private static native void nativeCertTrustChanged();
}