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

Commit 6312de2a authored by Ben Murdoch's avatar Ben Murdoch
Browse files

Receive notification from native webcore that the page being viewed

has marked itself as being an installable web app. Default implementation
in the WebChromeClient does nothing.

Requires an external/webkit change.

b/2766917

Change-Id: I7aae1b097f866e3d1c6c6a7a31a55bb12ff6a441
parent 9593b2ac
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ class CallbackProxy extends Handler {
    private static final int ADD_HISTORY_ITEM                    = 135;
    private static final int HISTORY_INDEX_CHANGED               = 136;
    private static final int AUTH_CREDENTIALS                    = 137;
    private static final int SET_INSTALLABLE_WEBAPP              = 138;

    // Message triggered by the client to resume execution
    private static final int NOTIFY                              = 200;
@@ -791,6 +792,9 @@ class CallbackProxy extends Handler {
                mWebView.setHttpAuthUsernamePassword(
                        host, realm, username, password);
                break;
            case SET_INSTALLABLE_WEBAPP:
                mWebChromeClient.setInstallableWebApp();
                break;
        }
    }

@@ -1548,4 +1552,11 @@ class CallbackProxy extends Handler {
        Message msg = obtainMessage(HISTORY_INDEX_CHANGED, index, 0, item);
        sendMessage(msg);
    }

    void setInstallableWebApp() {
        if (mWebChromeClient == null) {
            return;
        }
        sendMessage(obtainMessage(SET_INSTALLABLE_WEBAPP));
    }
}
+7 −0
Original line number Diff line number Diff line
@@ -337,4 +337,11 @@ public class WebChromeClient {
    public void onSelectionDone() {
    }

    /**
     * Tell the client that the page being viewed is web app capable,
     * i.e. has specified the fullscreen-web-app-capable meta tag.
     * @hide
     */
    public void setInstallableWebApp() { }

}
+7 −0
Original line number Diff line number Diff line
@@ -424,6 +424,13 @@ final class WebViewCore {
        return mCallbackProxy.onJsTimeout();
    }

    /**
     * Notify the webview that this is an installable web app.
     */
    protected void setInstallableWebApp() {
        mCallbackProxy.setInstallableWebApp();
    }

    //-------------------------------------------------------------------------
    // JNI methods
    //-------------------------------------------------------------------------