android-components / mozilla.components.feature.session / SessionUseCases


class SessionUseCases (source)

Contains use cases related to the session feature.


sessionManager - the application’s SessionManager.

onNoSession - When invoking a use case that requires a (selected) Session and when no Session is available this (optional) lambda will be invoked to create a Session. The default implementation creates a Session and adds it to the SessionManager.


Name Summary
ClearDataUseCase class ClearDataUseCase
CrashRecoveryUseCase class CrashRecoveryUseCase
Tries to recover from a crash by restoring the last know state.
DefaultLoadUrlUseCase class DefaultLoadUrlUseCase : LoadUrlUseCase
ExitFullScreenUseCase class ExitFullScreenUseCase
GoBackUseCase class GoBackUseCase
GoForwardUseCase class GoForwardUseCase
LoadDataUseCase class LoadDataUseCase
LoadUrlUseCase interface LoadUrlUseCase
Contract for use cases that load a provided URL.
ReloadUrlUseCase class ReloadUrlUseCase
RequestDesktopSiteUseCase class RequestDesktopSiteUseCase
StopLoadingUseCase class StopLoadingUseCase


| Name | Summary | |—|—| | <init> | SessionUseCases(sessionManager: SessionManager, onNoSession: (String) -> Session = { url -> Session(url).apply { sessionManager.add(this) } })
Contains use cases related to the session feature. |


Name Summary
clearData val clearData: ClearDataUseCase
crashRecovery val crashRecovery: CrashRecoveryUseCase
exitFullscreen val exitFullscreen: ExitFullScreenUseCase
goBack val goBack: GoBackUseCase
goForward val goForward: GoForwardUseCase
loadData val loadData: LoadDataUseCase
loadUrl val loadUrl: DefaultLoadUrlUseCase
reload val reload: ReloadUrlUseCase
requestDesktopSite val requestDesktopSite: RequestDesktopSiteUseCase
stopLoading val stopLoading: StopLoadingUseCase

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.