Merge "webkit: Update documentation for onJsAlert callback method" into rvc-dev am: e0a73b1bb6
Change-Id: I89a6c166e42d5a0bff4a63af609c71521381ad40
This commit is contained in:
@@ -189,14 +189,29 @@ public class WebChromeClient {
|
|||||||
public void onCloseWindow(WebView window) {}
|
public void onCloseWindow(WebView window) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tell the client to display a javascript alert dialog. If the client
|
* Notify the host application that the web page wants to display a
|
||||||
* returns {@code true}, WebView will assume that the client will handle the
|
* JavaScript {@code alert()} dialog.
|
||||||
* dialog. If the client returns {@code false}, it will continue execution.
|
* <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 view The WebView that initiated the callback.
|
||||||
* @param url The url of the page requesting the dialog.
|
* @param url The url of the page requesting the dialog.
|
||||||
* @param message Message to be displayed in the window.
|
* @param message Message to be displayed in the window.
|
||||||
* @param result A JsResult to confirm that the user hit enter.
|
* @param result A JsResult to confirm that the user closed the window.
|
||||||
* @return boolean Whether the client will handle the alert dialog.
|
* @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,
|
public boolean onJsAlert(WebView view, String url, String message,
|
||||||
JsResult result) {
|
JsResult result) {
|
||||||
|
|||||||
Reference in New Issue
Block a user