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 |
---|---|
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 |
onReceivedLoadError(XWalkView view,
int errorCode,
java.lang.String description,
java.lang.String failingUrl)
Report an error to the client.
|
android.webkit.WebResourceResponse |
shouldInterceptLoadRequest(XWalkView view,
java.lang.String url)
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.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)
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 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.