AuthTabCallback
interface AuthTabCallback
A callback class for Auth Tab clients to get messages regarding events in their Auth Tabs. In the implementation, all callbacks are sent to the Executor provided by the client to newAuthTabSession or its UI thread if one is not provided.
Summary
Public functions |
|
|---|---|
Unit |
onExtraCallback(callbackName: String, args: Bundle)Unsupported callbacks that may be provided by the implementation. |
Bundle |
onExtraCallbackWithResult(callbackName: String, args: Bundle)The same as |
Unit |
onNavigationEvent(navigationEvent: Int, extras: Bundle)To be called when a navigation event happens. |
Unit |
onWarmupCompleted(extras: Bundle)Called when the browser process finished warming up initiated by warmup. |
Public functions
onExtraCallback
fun onExtraCallback(callbackName: String, args: Bundle): Unit
Unsupported callbacks that may be provided by the implementation.
Note:Clients should never rely on this callback to be called and/or to have a defined behavior, as it is entirely implementation-defined and not supported.
This can be used by implementations to add extra callbacks, for testing or experimental purposes.
onExtraCallbackWithResult
fun onExtraCallbackWithResult(callbackName: String, args: Bundle): Bundle
The same as onExtraCallback, except that this method allows the Auth Tab provider to return a result. A return value of EMPTY will be used to signify that the client does not know how to handle the callback. As optional best practices, KEY_SUCCESS could be use to identify that callback was *successfully* handled. For example, when returning a message with result:
Bundle result = new Bundle(); result.putString("message", message); if (success) result.putBoolean(CustomTabsService#KEY_SUCCESS, true); return result;
Bundle result = extraCallbackWithResult(callbackName, args); if (result.getBoolean(CustomTabsService#KEY_SUCCESS)) { // callback was successfully handled }
onNavigationEvent
fun onNavigationEvent(navigationEvent: Int, extras: Bundle): Unit
To be called when a navigation event happens.
onWarmupCompleted
fun onWarmupCompleted(extras: Bundle): Unit
Called when the browser process finished warming up initiated by warmup.
| Parameters | |
|---|---|
extras: Bundle |
Reserved for future use. |