Methods Summary |
---|
public android.graphics.Bitmap | getDefaultVideoPoster()When not playing, video elements are represented by a 'poster' image. The
image to use can be specified by the poster attribute of the video tag in
HTML. If the attribute is absent, then a default poster will be used. This
method allows the ChromeClient to provide that default image.
return null;
|
public android.view.View | getVideoLoadingProgressView()When the user starts to playback a video element, it may take time for enough
data to be buffered before the first frames can be rendered. While this buffering
is taking place, the ChromeClient can use this function to provide a View to be
displayed. For example, the ChromeClient could show a spinner animation.
return null;
|
public void | getVisitedHistory(ValueCallback callback)Obtains a list of all visited history items, used for link coloring
|
public void | onCloseWindow(WebView window)Notify the host application to close the given WebView and remove it
from the view system if necessary. At this point, WebCore has stopped
any loading in this window and has removed any cross-scripting ability
in javascript.
|
public void | onConsoleMessage(java.lang.String message, int lineNumber, java.lang.String sourceID)Report a JavaScript error message to the host application. The ChromeClient
should override this to process the log message as they see fit.
|
public boolean | onConsoleMessage(ConsoleMessage consoleMessage)Report a JavaScript console message to the host application. The ChromeClient
should override this to process the log message as they see fit.
// Call the old version of this function for backwards compatability.
onConsoleMessage(consoleMessage.message(), consoleMessage.lineNumber(),
consoleMessage.sourceId());
return false;
|
public boolean | onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, android.os.Message resultMsg)Request the host application to create a new window. If the host
application chooses to honor this request, it should return true from
this method, create a new WebView to host the window, insert it into the
View system and send the supplied resultMsg message to its target with
the new WebView as an argument. If the host application chooses not to
honor the request, it should return false from this method. The default
implementation of this method does nothing and hence returns false.
return false;
|
public void | onExceededDatabaseQuota(java.lang.String url, java.lang.String databaseIdentifier, long quota, long estimatedDatabaseSize, long totalQuota, WebStorage.QuotaUpdater quotaUpdater)Tell the client that the quota has been exceeded for the Web SQL Database
API for a particular origin and request a new quota. The client must
respond by invoking the
{@link WebStorage.QuotaUpdater#updateQuota(long) updateQuota(long)}
method of the supplied {@link WebStorage.QuotaUpdater} instance. The
minimum value that can be set for the new quota is the current quota. The
default implementation responds with the current quota, so the quota will
not be increased.
// This default implementation passes the current quota back to WebCore.
// WebCore will interpret this that new quota was declined.
quotaUpdater.updateQuota(quota);
|
public void | onGeolocationPermissionsHidePrompt()Notify the host application that a request for Geolocation permissions,
made with a previous call to
{@link #onGeolocationPermissionsShowPrompt(String,GeolocationPermissions.Callback) onGeolocationPermissionsShowPrompt()}
has been canceled. Any related UI should therefore be hidden.
|
public void | onGeolocationPermissionsShowPrompt(java.lang.String origin, GeolocationPermissions.Callback callback)Notify the host application that web content from the specified origin
is attempting to use the Geolocation API, but no permission state is
currently set for that origin. The host application should invoke the
specified callback with the desired permission state. See
{@link GeolocationPermissions} for details.
|
public void | onHideCustomView()Notify the host application that the current page would
like to hide its custom view.
|
public boolean | onJsAlert(WebView view, java.lang.String url, java.lang.String message, JsResult result)Tell the client to display a javascript alert dialog. If the client
returns true, WebView will assume that the client will handle the
dialog. If the client returns false, it will continue execution.
return false;
|
public boolean | onJsBeforeUnload(WebView view, java.lang.String url, java.lang.String message, JsResult result)Tell the client to display a dialog to confirm navigation away from the
current page. This is the result of the onbeforeunload javascript event.
If the client returns true, WebView will assume that the client will
handle the confirm dialog and call the appropriate JsResult method. If
the client returns false, a default value of true will be returned to
javascript to accept navigation away from the current page. The default
behavior is to return false. Setting the JsResult to true will navigate
away from the current page, false will cancel the navigation.
return false;
|
public boolean | onJsConfirm(WebView view, java.lang.String url, java.lang.String message, JsResult result)Tell the client to display a confirm dialog to the user. If the client
returns true, WebView will assume that the client will handle the
confirm dialog and call the appropriate JsResult method. If the
client returns false, a default value of false will be returned to
javascript. The default behavior is to return false.
return false;
|
public boolean | onJsPrompt(WebView view, java.lang.String url, java.lang.String message, java.lang.String defaultValue, JsPromptResult result)Tell the client to display a prompt dialog to the user. If the client
returns true, WebView will assume that the client will handle the
prompt dialog and call the appropriate JsPromptResult method. If the
client returns false, a default value of false will be returned to to
javascript. The default behavior is to return false.
return false;
|
public boolean | onJsTimeout()Tell the client that a JavaScript execution timeout has occured. And the
client may decide whether or not to interrupt the execution. If the
client returns true, the JavaScript will be interrupted. If the client
returns false, the execution will continue. Note that in the case of
continuing execution, the timeout counter will be reset, and the callback
will continue to occur if the script does not finish at the next check
point.
return true;
|
public void | onPermissionRequest(PermissionRequest request)Notify the host application that web content is requesting permission to
access the specified resources and the permission currently isn't granted
or denied. The host application must invoke {@link PermissionRequest#grant(String[])}
or {@link PermissionRequest#deny()}.
If this method isn't overridden, the permission is denied.
request.deny();
|
public void | onPermissionRequestCanceled(PermissionRequest request)Notify the host application that the given permission request
has been canceled. Any related UI should therefore be hidden.
|
public void | onProgressChanged(WebView view, int newProgress)Tell the host application the current progress of loading a page.
|
public void | onReachedMaxAppCacheSize(long requiredStorage, long quota, WebStorage.QuotaUpdater quotaUpdater)Notify the host application that the Application Cache has reached the
maximum size. The client must respond by invoking the
{@link WebStorage.QuotaUpdater#updateQuota(long) updateQuota(long)}
method of the supplied {@link WebStorage.QuotaUpdater} instance. The
minimum value that can be set for the new quota is the current quota. The
default implementation responds with the current quota, so the quota will
not be increased.
quotaUpdater.updateQuota(quota);
|
public void | onReceivedIcon(WebView view, android.graphics.Bitmap icon)Notify the host application of a new favicon for the current page.
|
public void | onReceivedTitle(WebView view, java.lang.String title)Notify the host application of a change in the document title.
|
public void | onReceivedTouchIconUrl(WebView view, java.lang.String url, boolean precomposed)Notify the host application of the url for an apple-touch-icon.
|
public void | onRequestFocus(WebView view)Request display and focus for this WebView. This may happen due to
another WebView opening a link in this WebView and requesting that this
WebView be displayed.
|
public void | onShowCustomView(android.view.View view, android.webkit.WebChromeClient$CustomViewCallback callback)Notify the host application that the current page would
like to show a custom View. This is used for Fullscreen
video playback; see "HTML5 Video support" documentation on
{@link WebView}.
|
public void | onShowCustomView(android.view.View view, int requestedOrientation, android.webkit.WebChromeClient$CustomViewCallback callback)Notify the host application that the current page would
like to show a custom View in a particular orientation.
|
public boolean | onShowFileChooser(WebView webView, ValueCallback filePathCallback, android.webkit.WebChromeClient$FileChooserParams fileChooserParams)Tell the client to show a file chooser.
This is called to handle HTML forms with 'file' input type, in response to the
user pressing the "Select File" button.
To cancel the request, call filePathCallback.onReceiveValue(null) and
return true.
return false;
|
public void | openFileChooser(ValueCallback uploadFile, java.lang.String acceptType, java.lang.String capture)Tell the client to open a file chooser.
uploadFile.onReceiveValue(null);
|
public void | setupAutoFill(android.os.Message msg)Tell the client that the page being viewed has an autofillable
form and the user would like to set a profile up.
|