android-components / mozilla.components.browser.session / SelectionAwareSessionObserver

SelectionAwareSessionObserver

abstract class SelectionAwareSessionObserver : Observer, Observer (source)

This class is a combination of Session.Observer and SessionManager.Observer. It provides functionality to observe changes to a specified or selected session, and can automatically take care of switching over the observer in case a different session gets selected (see observeFixed and observeSelected).

Constructors

Name Summary
<init> SelectionAwareSessionObserver(sessionManager: SessionManager)
This class is a combination of Session.Observer and SessionManager.Observer. It provides functionality to observe changes to a specified or selected session, and can automatically take care of switching over the observer in case a different session gets selected (see observeFixed and observeSelected).

Properties

Name Summary
activeSession open var activeSession: Session?
the currently observed session

Functions

Name Summary
observeFixed fun observeFixed(session: Session): Unit
Starts observing changes to the specified session.
observeIdOrSelected fun observeIdOrSelected(sessionId: String?): Unit
Starts observing changes to the session matching the sessionId. If the session does not exist, then observe the selected session.
observeSelected fun observeSelected(): Unit
Starts observing changes to the selected session (see SessionManager.selectedSession). If a different session is selected the observer will automatically be switched over and only notified of changes to the newly selected session.
onSessionSelected open fun onSessionSelected(session: Session): Unit
The selection has changed and the given session is now the selected session.
stop open fun stop(): Unit
Stops the observer.

Inherited Functions

Name Summary
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.
onAppPermissionRequested open fun onAppPermissionRequested(session: Session, permissionRequest: PermissionRequest): Boolean
onCloseWindowRequested open fun onCloseWindowRequested(session: Session, windowRequest: WindowRequest): Boolean
onContentPermissionRequested open fun onContentPermissionRequested(session: Session, permissionRequest: PermissionRequest): Boolean
onCrashStateChanged open fun onCrashStateChanged(session: Session, crashed: Boolean): Unit
onCustomTabConfigChanged open fun onCustomTabConfigChanged(session: Session, customTabConfig: CustomTabConfig?): Unit
onDesktopModeChanged open fun onDesktopModeChanged(session: Session, enabled: Boolean): Unit
onFindResult open fun onFindResult(session: Session, result: FindResult): Unit
onFullScreenChanged open fun onFullScreenChanged(session: Session, enabled: Boolean): Unit
onIconChanged open fun onIconChanged(session: Session, icon: <ERROR CLASS>?): Unit
onLoadRequest open fun onLoadRequest(session: Session, url: String, triggeredByRedirect: Boolean, triggeredByWebContent: Boolean): Unit
onLoadingStateChanged open fun onLoadingStateChanged(session: Session, loading: Boolean): Unit
onLongPress open fun onLongPress(session: Session, hitResult: HitResult): Boolean
onMediaAdded open fun onMediaAdded(session: Session, media: List<Media>, added: Media): Unit
onMediaRemoved open fun onMediaRemoved(session: Session, media: List<Media>, removed: Media): Unit
onNavigationStateChanged open fun onNavigationStateChanged(session: Session, canGoBack: Boolean, canGoForward: Boolean): Unit
onOpenWindowRequested open fun onOpenWindowRequested(session: Session, windowRequest: WindowRequest): Boolean
onProgress open fun onProgress(session: Session, progress: Int): Unit
onReaderModeChanged open fun onReaderModeChanged(session: Session, enabled: Boolean): Unit
onReaderableStateUpdated open fun onReaderableStateUpdated(session: Session, readerable: Boolean): Unit
onRecordingDevicesChanged open fun onRecordingDevicesChanged(session: Session, devices: List<RecordingDevice>): Unit
onSearch open fun onSearch(session: Session, searchTerms: String): Unit
onSecurityChanged open fun onSecurityChanged(session: Session, securityInfo: SecurityInfo): Unit
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.
onSessionsRestored open fun onSessionsRestored(): Unit
Sessions have been restored via a snapshot. This callback is invoked at the end of the call to read, after every session in the snapshot was added, and appropriate session was selected.
onThumbnailChanged open fun onThumbnailChanged(session: Session, bitmap: <ERROR CLASS>?): Unit
onTitleChanged open fun onTitleChanged(session: Session, title: String): Unit
onTrackerBlocked open fun onTrackerBlocked(session: Session, tracker: Tracker, all: List<Tracker>): Unit
onTrackerBlockingEnabledChanged open fun onTrackerBlockingEnabledChanged(session: Session, blockingEnabled: Boolean): Unit
onTrackerLoaded open fun onTrackerLoaded(session: Session, tracker: Tracker, all: List<Tracker>): Unit
onUrlChanged open fun onUrlChanged(session: Session, url: String): Unit
onWebAppManifestChanged open fun onWebAppManifestChanged(session: Session, manifest: WebAppManifest?): Unit

Inheritors

Name Summary
CoordinateScrollingFeature class CoordinateScrollingFeature : SelectionAwareSessionObserver, LifecycleAwareFeature
Feature implementation for connecting an EngineView with any View that you want to coordinate scrolling behavior with.
FullScreenFeature open class FullScreenFeature : SelectionAwareSessionObserver, LifecycleAwareFeature, BackHandler
Feature implementation for handling fullscreen mode (exiting and back button presses).
FxaWebChannelFeature class FxaWebChannelFeature : SelectionAwareSessionObserver, LifecycleAwareFeature
Feature implementation that provides Firefox Accounts WebChannel support. For more information https://github.com/mozilla/fxa/blob/master/packages/fxa-content-server/docs/relier-communication-protocols/fx-webchannel.md This feature uses a web extension to communicate with FxA Web Content.
ReaderViewFeature class ReaderViewFeature : SelectionAwareSessionObserver, LifecycleAwareFeature, BackHandler
Feature implementation that provides a reader view for the selected session, based on a web extension.
SwipeRefreshFeature class SwipeRefreshFeature : SelectionAwareSessionObserver, LifecycleAwareFeature, OnChildScrollUpCallback, OnRefreshListener
Feature implementation to add pull to refresh functionality to browsers.