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

Commit 508f6e6d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "webkit: Update documentation for onJsAlert callback method" into rvc-dev am: e0a73b1b

Change-Id: Ic2b8a24d4ec983e467733f1ead9557ee0f62d54e
parents 9ee7f45f e0a73b1b
Loading
Loading
Loading
Loading
+20 −5
Original line number Diff line number Diff line
@@ -189,14 +189,29 @@ public class WebChromeClient {
    public void onCloseWindow(WebView window) {}

    /**
     * Tell the client to display a javascript alert dialog.  If the client
     * returns {@code true}, WebView will assume that the client will handle the
     * dialog.  If the client returns {@code false}, it will continue execution.
     * Notify the host application that the web page wants to display a
     * JavaScript {@code alert()} dialog.
     * <p>The default behavior if this method returns {@code false} or is not
     * overridden is to show a dialog containing the alert message and suspend
     * JavaScript execution until the dialog is dismissed.
     * <p>To show a custom dialog, the app should return {@code true} from this
     * method, in which case the default dialog will not be shown and JavaScript
     * execution will be suspended. The app should call
     * {@code JsResult.confirm()} when the custom dialog is dismissed such that
     * JavaScript execution can be resumed.
     * <p>To suppress the dialog and allow JavaScript execution to
     * continue, call {@code JsResult.confirm()} immediately and then return
     * {@code true}.
     * <p>Note that if the {@link WebChromeClient} is {@code null}, the default
     * dialog will be suppressed and Javascript execution will continue
     * immediately.
     *
     * @param view The WebView that initiated the callback.
     * @param url The url of the page requesting the dialog.
     * @param message Message to be displayed in the window.
     * @param result A JsResult to confirm that the user hit enter.
     * @return boolean Whether the client will handle the alert dialog.
     * @param result A JsResult to confirm that the user closed the window.
     * @return boolean {@code true} if the request is handled or ignored.
     * {@code false} if WebView needs to show the default dialog.
     */
    public boolean onJsAlert(WebView view, String url, String message,
            JsResult result) {