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

HistoryDelegate

class HistoryDelegate : HistoryTrackingDelegate (source)

Implementation of the HistoryTrackingDelegate which delegates work to an instance of HistoryStorage.

Constructors

Name Summary
<init> HistoryDelegate(historyStorage: HistoryStorage)
Implementation of the HistoryTrackingDelegate which delegates work to an instance of HistoryStorage.

Functions

Name Summary
getVisited suspend fun getVisited(uris: List<String>): List<Boolean>
An engine needs to know “visited” (true/false) status for provided URIs.suspend fun getVisited(): List<String>
An engine needs to know a list of all visited URIs.
onTitleChanged suspend fun onTitleChanged(uri: String, title: String): Unit
Title changed for a given URI.
onVisited suspend fun onVisited(uri: String, visit: PageVisit): Unit
A URI visit happened that an engine considers worthy of being recorded in browser’s history.
shouldStoreUri fun shouldStoreUri(uri: String): Boolean
Filter out unwanted URIs, such as “chrome:”, “about:”, etc. Ported from nsAndroidHistory::CanAddURI See https://dxr.mozilla.org/mozilla-central/source/mobile/android/components/build/nsAndroidHistory.cpp#326

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.