public class XWalkResourceClient
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
ERROR_AUTHENTICATION
User authentication failed on server
|
static int |
ERROR_BAD_URL
Malformed URL
|
static int |
ERROR_CONNECT
Failed to connect to the server
|
static int |
ERROR_FAILED_SSL_HANDSHAKE
Failed to perform SSL handshake
|
static int |
ERROR_FILE
Generic file error
|
static int |
ERROR_FILE_NOT_FOUND
File not found
|
static int |
ERROR_HOST_LOOKUP
Server or proxy hostname lookup failed
|
static int |
ERROR_IO
Failed to read or write to the server
|
static int |
ERROR_OK
Success
|
static int |
ERROR_PROXY_AUTHENTICATION
User authentication failed on proxy
|
static int |
ERROR_REDIRECT_LOOP
Too many redirects
|
static int |
ERROR_TIMEOUT
Connection timed out
|
static int |
ERROR_TOO_MANY_REQUESTS
Too many requests during this load
|
static int |
ERROR_UNKNOWN
Generic error
|
static int |
ERROR_UNSUPPORTED_AUTH_SCHEME
Unsupported authentication scheme (not basic or digest)
|
static int |
ERROR_UNSUPPORTED_SCHEME
Unsupported URI scheme
|
| Constructor and Description |
|---|
XWalkResourceClient(XWalkView view)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
XWalkWebResourceResponse |
createXWalkWebResourceResponse(java.lang.String mimeType,
java.lang.String encoding,
java.io.InputStream data)
Construct an instance of XWalkWebResourceResponse
for application usage.
|
XWalkWebResourceResponse |
createXWalkWebResourceResponse(java.lang.String mimeType,
java.lang.String encoding,
java.io.InputStream data,
int statusCode,
java.lang.String reasonPhrase,
java.util.Map<java.lang.String,java.lang.String> responseHeaders)
Construct an instance of XWalkWebResourceResponse
for application usage.
|
void |
doUpdateVisitedHistory(XWalkView view,
java.lang.String url,
boolean isReload)
Notify the host application to update its visited links database.
|
protected java.lang.Object |
getBridge() |
void |
onDocumentLoadedInFrame(XWalkView view,
long frameId)
Notify the client that initial HTML document has been completely loaded and
parsed, without waiting for stylesheets, images, and subframes to finish loading.
|
void |
onLoadFinished(XWalkView view,
java.lang.String url)
Notify the client that the XWalkView completes to load the resource
specified by the given url.
|
void |
onLoadStarted(XWalkView view,
java.lang.String url)
Notify the client that the XWalkView will load the resource specified
by the given url.
|
void |
onProgressChanged(XWalkView view,
int progressInPercent)
Notify the client the progress info of loading a specific url.
|
void |
onReceivedClientCertRequest(XWalkView view,
ClientCertRequest handler)
Notify the host application to handle a SSL client certificate request.
|
void |
onReceivedHttpAuthRequest(XWalkView view,
XWalkHttpAuthHandler handler,
java.lang.String host,
java.lang.String realm)
Notify the host application to handle an authentication request.
|
void |
onReceivedLoadError(XWalkView view,
int errorCode,
java.lang.String description,
java.lang.String failingUrl)
Report an error to the client.
|
void |
onReceivedResponseHeaders(XWalkView view,
XWalkWebResourceRequest request,
XWalkWebResourceResponse response)
Notify the host application that an HTTP response has been received from the server while loading a resource.
|
void |
onReceivedSslError(XWalkView view,
android.webkit.ValueCallback<java.lang.Boolean> callback,
android.net.http.SslError error)
Notify the host application that an SSL error occurred while loading a
resource.
|
android.webkit.WebResourceResponse |
shouldInterceptLoadRequest(XWalkView view,
java.lang.String url)
Deprecated.
|
XWalkWebResourceResponse |
shouldInterceptLoadRequest(XWalkView view,
XWalkWebResourceRequest request)
Notify the client of a resource request and allow the client to return
the data.
|
boolean |
shouldOverrideUrlLoading(XWalkView view,
java.lang.String url)
Give the host application a chance to take over the control when a new
url is about to be loaded in the current XWalkView.
|
public static final int ERROR_OK
public static final int ERROR_UNKNOWN
public static final int ERROR_HOST_LOOKUP
public static final int ERROR_UNSUPPORTED_AUTH_SCHEME
public static final int ERROR_AUTHENTICATION
public static final int ERROR_PROXY_AUTHENTICATION
public static final int ERROR_CONNECT
public static final int ERROR_IO
public static final int ERROR_TIMEOUT
public static final int ERROR_REDIRECT_LOOP
public static final int ERROR_UNSUPPORTED_SCHEME
public static final int ERROR_FAILED_SSL_HANDSHAKE
public static final int ERROR_BAD_URL
public static final int ERROR_FILE
public static final int ERROR_FILE_NOT_FOUND
public static final int ERROR_TOO_MANY_REQUESTS
public XWalkResourceClient(XWalkView view)
view - the owner XWalkView instance.protected java.lang.Object getBridge()
public void onDocumentLoadedInFrame(XWalkView view, long frameId)
view - the owner XWalkView instance.frameId - the loaded and parsed frame.public void onLoadStarted(XWalkView view, java.lang.String url)
view - the owner XWalkView instance.url - the url for the resource to be loaded.public void onLoadFinished(XWalkView view, java.lang.String url)
view - the owner XWalkView instance.url - the url for the resource done for loading.public void onProgressChanged(XWalkView view, int progressInPercent)
view - the owner XWalkView instance.progressInPercent - the loading process in percent.public android.webkit.WebResourceResponse shouldInterceptLoadRequest(XWalkView view, java.lang.String url)
shouldInterceptLoadRequest(XWalkView, XWalkWebResourceRequest)
instead.view - The owner XWalkView instance that is requesting the
resource.url - The raw url of the resource.WebResourceResponse containing the
response information or null if the XWalkView should load the
resource itself.public XWalkWebResourceResponse shouldInterceptLoadRequest(XWalkView view, XWalkWebResourceRequest request)
view - The owner XWalkView instance that is requesting the
resource.request - Object containing the details of the request..XWalkWebResourceResponse containing the
response information or null if the XWalkView should load the
resource itself.public void onReceivedLoadError(XWalkView view, int errorCode, java.lang.String description, java.lang.String failingUrl)
view - the owner XWalkView instance.errorCode - the error id.description - A String describing the error.failingUrl - The url that failed to load.public boolean shouldOverrideUrlLoading(XWalkView view, java.lang.String url)
view - The XWalkView that is initiating the callback.url - The url to be loaded.public void onReceivedSslError(XWalkView view, android.webkit.ValueCallback<java.lang.Boolean> callback, android.net.http.SslError error)
view - the xwalkview that is initiating the callbackcallback - passing 'true' means accepting the ssl error and continue to load.
passing 'false' means forbidding to load the web page.error - the SSL error objectpublic void onReceivedClientCertRequest(XWalkView view, ClientCertRequest handler)
view - The XWalkView that is initiating the callbackhandler - An instance of a ClientCertRequestHandlerInternalpublic void onReceivedResponseHeaders(XWalkView view, XWalkWebResourceRequest request, XWalkWebResourceResponse response)
response contains the cookies set by the HTTP response.view - The XWalkView that is initiating the callbackrequest - The originating requestresponse - The response informationpublic void doUpdateVisitedHistory(XWalkView view, java.lang.String url, boolean isReload)
view - The XWalkView that is initiating the callback.url - The url being visited.isReload - True if this url is being reloaded.public void onReceivedHttpAuthRequest(XWalkView view, XWalkHttpAuthHandler handler, java.lang.String host, java.lang.String realm)
view - The XWalkView that is initiating the callback.handler - The XWalkHttpAuthHandler that will handle the user's response.host - The host requiring authentication.realm - A description to help store user credentials for future
visits.public XWalkWebResourceResponse createXWalkWebResourceResponse(java.lang.String mimeType, java.lang.String encoding, java.io.InputStream data)
public XWalkWebResourceResponse createXWalkWebResourceResponse(java.lang.String mimeType, java.lang.String encoding, java.io.InputStream data, int statusCode, java.lang.String reasonPhrase, java.util.Map<java.lang.String,java.lang.String> responseHeaders)