android-components / mozilla.components.concept.awesomebar / AwesomeBar / SuggestionProvider

SuggestionProvider

interface SuggestionProvider (source)

A SuggestionProvider is queried by an AwesomeBar whenever the text in the address bar is changed by the user. It returns a list of Suggestions to be displayed by the AwesomeBar.

Properties

Name Summary
id abstract val id: String
A unique ID used for identifying this provider.
shouldClearSuggestions open val shouldClearSuggestions: Boolean
If true an AwesomeBar implementation can clear the previous suggestions of this provider as soon as the user continues to type. If this is false an AwesomeBar implementation is allowed to keep the previous suggestions around until the provider returns a new list of suggestions for the updated text.

Functions

Name Summary
onInputCancelled open fun onInputCancelled(): Unit
Fired when the user has cancelled their interaction with the awesome bar.
onInputChanged abstract suspend fun onInputChanged(text: String): List<Suggestion>
Fired whenever the user changes their input, after they have started interacting with the awesome bar.
onInputStarted open fun onInputStarted(): List<Suggestion>
Fired when the user starts interacting with the awesome bar by entering text in the toolbar.

Inheritors

Name Summary
BookmarksStorageSuggestionProvider class BookmarksStorageSuggestionProvider : SuggestionProvider
A AwesomeBar.SuggestionProvider implementation that provides suggestions based on the bookmarks stored in the BookmarksStorage.
ClipboardSuggestionProvider class ClipboardSuggestionProvider : SuggestionProvider
An AwesomeBar.SuggestionProvider implementation that returns a suggestions for an URL in the clipboard (if there’s any).
HistoryStorageSuggestionProvider class HistoryStorageSuggestionProvider : SuggestionProvider
A AwesomeBar.SuggestionProvider implementation that provides suggestions based on the browsing history stored in the HistoryStorage.
SearchSuggestionProvider class SearchSuggestionProvider : SuggestionProvider
A AwesomeBar.SuggestionProvider implementation that provides a suggestion containing search engine suggestions (as chips) from the passed in SearchEngine.
SessionSuggestionProvider class SessionSuggestionProvider : SuggestionProvider
A AwesomeBar.SuggestionProvider implementation that provides suggestions based on the sessions in the SessionManager (Open tabs).