java.lang.Object | |
↳ | android.webkit.WebChromeClient |
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
WebChromeClient.CustomViewCallback | A callback interface used by the host application to notify the current page that its custom view has been dismissed. | ||||||||||
WebChromeClient.FileChooserParams |
Parameters used in the onShowFileChooser(WebView, ValueCallback method.
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
When not playing, video elements are represented by a 'poster' image.
| |||||||||||
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.
| |||||||||||
Obtains a list of all visited history items, used for link coloring
| |||||||||||
Notify the host application to close the given WebView and remove it
from the view system if necessary.
| |||||||||||
This method was deprecated
in API level 8.
Use
onConsoleMessage(ConsoleMessage)
instead.
| |||||||||||
Report a JavaScript console message to the host application.
| |||||||||||
Request the host application to create a new window.
| |||||||||||
This method was deprecated
in API level 19.
This method is no longer called; WebView now uses the HTML5 / JavaScript Quota
Management API.
| |||||||||||
Notify the host application that a request for Geolocation permissions,
made with a previous call to
onGeolocationPermissionsShowPrompt()
has been canceled.
| |||||||||||
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.
| |||||||||||
Notify the host application that the current page would
like to hide its custom view.
| |||||||||||
Tell the client to display a javascript alert dialog.
| |||||||||||
Tell the client to display a dialog to confirm navigation away from the
current page.
| |||||||||||
Tell the client to display a confirm dialog to the user.
| |||||||||||
Tell the client to display a prompt dialog to the user.
| |||||||||||
This method was deprecated
in API level 17.
This method is no longer supported and will not be invoked.
| |||||||||||
Notify the host application that web content is requesting permission to
access the specified resources and the permission currently isn't granted
or denied.
| |||||||||||
Notify the host application that the given permission request
has been canceled.
| |||||||||||
Tell the host application the current progress of loading a page.
| |||||||||||
This method was deprecated
in API level 19.
This method is no longer called; WebView now uses the HTML5 / JavaScript Quota
Management API.
| |||||||||||
Notify the host application of a new favicon for the current page.
| |||||||||||
Notify the host application of a change in the document title.
| |||||||||||
Notify the host application of the url for an apple-touch-icon.
| |||||||||||
Request display and focus for this WebView.
| |||||||||||
Notify the host application that the current page would
like to show a custom View.
| |||||||||||
This method was deprecated
in API level 18.
This method supports the obsolete plugin mechanism,
and will not be invoked in future
| |||||||||||
Tell the client to show a file chooser.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
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.
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.
Obtains a list of all visited history items, used for link coloring
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.
window | The WebView that needs to be closed. |
---|
This method was deprecated
in API level 8.
Use onConsoleMessage(ConsoleMessage)
instead.
Report a JavaScript error message to the host application. The ChromeClient should override this to process the log message as they see fit.
message | The error message to report. |
---|---|
lineNumber | The line number of the error. |
sourceID | The name of the source file that caused the error. |
Report a JavaScript console message to the host application. The ChromeClient should override this to process the log message as they see fit.
consoleMessage | Object containing details of the console message. |
---|
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.
view | The WebView from which the request for a new window originated. |
---|---|
isDialog | True if the new window should be a dialog, rather than a full-size window. |
isUserGesture | True if the request was initiated by a user gesture, such as the user clicking a link. |
resultMsg | The message to send when once a new WebView has been
created. resultMsg.obj is a
WebView.WebViewTransport object. This should be
used to transport the new WebView, by calling
WebView.WebViewTransport.setWebView(WebView) . |
This method was deprecated
in API level 19.
This method is no longer called; WebView now uses the HTML5 / JavaScript Quota
Management API.
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
updateQuota(long)
method of the supplied 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.
url | The URL of the page that triggered the notification |
---|---|
databaseIdentifier | The identifier of the database where the quota was exceeded. |
quota | The quota for the origin, in bytes |
estimatedDatabaseSize | The estimated size of the offending database, in bytes |
totalQuota | The total quota for all origins, in bytes |
quotaUpdater | An instance of WebStorage.QuotaUpdater which
must be used to inform the WebView of the new quota. |
Notify the host application that a request for Geolocation permissions,
made with a previous call to
onGeolocationPermissionsShowPrompt()
has been canceled. Any related UI should therefore be hidden.
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
GeolocationPermissions
for details.
origin | The origin of the web content attempting to use the Geolocation API. |
---|---|
callback | The callback to use to set the permission state for the origin. |
Notify the host application that the current page would like to hide its custom view.
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.
view | The WebView that initiated the callback. |
---|---|
url | The url of the page requesting the dialog. |
message | Message to be displayed in the window. |
result | A JsResult to confirm that the user hit enter. |
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.
view | The WebView that initiated the callback. |
---|---|
url | The url of the page requesting the dialog. |
message | Message to be displayed in the window. |
result | A JsResult used to send the user's response to javascript. |
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.
view | The WebView that initiated the callback. |
---|---|
url | The url of the page requesting the dialog. |
message | Message to be displayed in the window. |
result | A JsResult used to send the user's response to javascript. |
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.
view | The WebView that initiated the callback. |
---|---|
url | The url of the page requesting the dialog. |
message | Message to be displayed in the window. |
defaultValue | The default value displayed in the prompt dialog. |
result | A JsPromptResult used to send the user's reponse to javascript. |
This method was deprecated
in API level 17.
This method is no longer supported and will not be invoked.
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.
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 grant(String[])
or deny()
.
If this method isn't overridden, the permission is denied.
request | the PermissionRequest from current web content. |
---|
Notify the host application that the given permission request has been canceled. Any related UI should therefore be hidden.
request | the PermissionRequest that needs be canceled. |
---|
Tell the host application the current progress of loading a page.
view | The WebView that initiated the callback. |
---|---|
newProgress | Current page loading progress, represented by an integer between 0 and 100. |
This method was deprecated
in API level 19.
This method is no longer called; WebView now uses the HTML5 / JavaScript Quota
Management API.
Notify the host application that the Application Cache has reached the
maximum size. The client must respond by invoking the
updateQuota(long)
method of the supplied 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.
requiredStorage | The amount of storage required by the Application Cache operation that triggered this notification, in bytes. |
---|---|
quota | the current maximum Application Cache size, in bytes |
quotaUpdater | An instance of WebStorage.QuotaUpdater which
must be used to inform the WebView of the new quota. |
Notify the host application of a new favicon for the current page.
view | The WebView that initiated the callback. |
---|---|
icon | A Bitmap containing the favicon for the current page. |
Notify the host application of a change in the document title.
view | The WebView that initiated the callback. |
---|---|
title | A String containing the new title of the document. |
Notify the host application of the url for an apple-touch-icon.
view | The WebView that initiated the callback. |
---|---|
url | The icon url. |
precomposed | True if the url is for a precomposed touch icon. |
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.
view | The WebView that needs to be focused. |
---|
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
WebView
.
view | is the View object to be shown. |
---|---|
callback | is the callback to be invoked if and when the view is dismissed. |
This method was deprecated
in API level 18.
This method supports the obsolete plugin mechanism,
and will not be invoked in future
Notify the host application that the current page would like to show a custom View in a particular orientation.
view | is the View object to be shown. |
---|---|
requestedOrientation | An orientation constant as used in
ActivityInfo.screenOrientation . |
callback | is the callback to be invoked if and when the view is dismissed. |
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.
webView | The WebView instance that is initiating the request. |
---|---|
filePathCallback | Invoke this callback to supply the list of paths to files to upload,
or NULL to cancel. Must only be called if the
showFileChooser implementations returns true. |
fileChooserParams | Describes the mode of file chooser to be opened, and options to be used with it. |