android-components / mozilla.components.browser.session / SessionManager / Observer

# Observer

`interface Observer` (source)

Interface to be implemented by classes that want to observe the session manager.

### Functions

onAllSessionsRemoved | `open fun onAllSessionsRemoved(): Unit` All sessions have been removed. Note that this will callback will be invoked whenever removeAll() or removeSessions have been called on the SessionManager. This callback will NOT be invoked when just the last session has been removed by calling remove() on the SessionManager.
onSessionAdded | `open fun onSessionAdded(session: Session): Unit` The given session has been added.
onSessionRemoved | `open fun onSessionRemoved(session: Session): Unit` The given session has been removed.
onSessionSelected | `open fun onSessionSelected(session: Session): Unit` The selection has changed and the given session is now the selected session.

### Inheritors

EngineViewPresenter | `class EngineViewPresenter : Observer` Presenter implementation for EngineView.
TabsTrayPresenter | `class TabsTrayPresenter : Observer` Presenter implementation for a tabs tray implementation in order to update the tabs tray whenever the state of the session manager changes.
ToolbarPresenter | `class ToolbarPresenter : Observer, Observer` Presenter implementation for a toolbar implementation in order to update the toolbar whenever the state of the selected session changes.