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

Commit 04022aad authored by qqzhou's avatar qqzhou Committed by Gerrit - the friendly Code Review server
Browse files

Webkit: add to support file uploading

This change adds one function in WebChromeClient for supporting
uploading file in browser. In Android 4.4, browser is based on
chromium not webkit engine, chromium engine support uploading file
and will callback to client to show file chooser, but android_webview
client has empty implementation within this callback for file chooser.

So we solve this issue by adding implementation in framework chromium
client which extends android_webview client, function in framework
webkit client and corresponding functions in browser app.

Change-Id: I6baef44eef28eb2b380ab6181200bf0b9cc0316c
parent 9aafd361
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -383,6 +383,22 @@ public class WebChromeClient {
        uploadFile.onReceiveValue(null);
    }

    /**
     * Tell the client to show a file chooser.
     * @param uploadFilePaths A ValueCallback to set paths of the files to upload.
     *      onReceiveValue must be called to wake up the thread.a
     * @param acceptType The value of the 'accept' attribute of the input tag
     *         associated with this file picker.
     * @param capture Whether the 'capture' attribute exists in the input tag
     *         associated with this file picker.
     * @hide
     */
    public void showFileChooser(ValueCallback<String[]> uploadFilePaths,
                                String acceptTypes,
                                boolean capture) {
        uploadFilePaths.onReceiveValue(null);
    }

    /**
     * Tell the client that the page being viewed has an autofillable
     * form and the user would like to set a profile up.