public static interface GeckoSession.ContentDelegate
Modifier and Type | Interface and Description |
---|---|
static class |
GeckoSession.ContentDelegate.ContextElement
Element details for onContextMenu callbacks.
|
Modifier and Type | Method and Description |
---|---|
default void |
onCloseRequest(GeckoSession session)
A page has requested to close
|
default void |
onContextMenu(GeckoSession session,
int screenX,
int screenY,
GeckoSession.ContentDelegate.ContextElement element)
A user has initiated the context menu via long-press.
|
default void |
onCrash(GeckoSession session)
The content process hosting this GeckoSession has crashed.
|
default void |
onExternalResponse(GeckoSession session,
WebResponse response)
This is fired when there is a response that cannot be handled
by Gecko (e.g., a download).
|
default void |
onFirstComposite(GeckoSession session)
Notification that the first content composition has occurred.
|
default void |
onFirstContentfulPaint(GeckoSession session)
Notification that the first content paint has occurred.
|
default void |
onFocusRequest(GeckoSession session)
A page has requested focus.
|
default void |
onFullScreen(GeckoSession session,
boolean fullScreen)
A page has entered or exited full screen mode.
|
default void |
onKill(GeckoSession session)
The content process hosting this GeckoSession has been killed.
|
default void |
onMetaViewportFitChange(GeckoSession session,
String viewportFit)
A viewport-fit was discovered in the content or updated after the content.
|
default void |
onPaintStatusReset(GeckoSession session)
Notification that the paint status has been reset.
|
default GeckoResult<SlowScriptResponse> |
onSlowScript(GeckoSession geckoSession,
String scriptFileName)
A script has exceeded it's execution timeout value
|
default void |
onTitleChange(GeckoSession session,
String title)
A page title was discovered in the content or updated after the content
loaded.
|
default void |
onWebAppManifest(GeckoSession session,
JSONObject manifest)
This is fired when the loaded document has a valid Web App Manifest present.
|
@UiThread default void onTitleChange(@NonNull GeckoSession session, @Nullable String title)
session
- The GeckoSession that initiated the callback.title
- The title sent from the content.@UiThread default void onFocusRequest(@NonNull GeckoSession session)
session
- The GeckoSession that initiated the callback.@UiThread default void onCloseRequest(@NonNull GeckoSession session)
session
- The GeckoSession that initiated the callback.@UiThread default void onFullScreen(@NonNull GeckoSession session, boolean fullScreen)
session
- The GeckoSession that initiated the callback.fullScreen
- True if the page is in full screen mode.@UiThread default void onMetaViewportFitChange(@NonNull GeckoSession session, @NonNull String viewportFit)
session
- The GeckoSession that initiated the callback.viewportFit
- The value of viewport-fit of meta element in content.@UiThread default void onContextMenu(@NonNull GeckoSession session, int screenX, int screenY, @NonNull GeckoSession.ContentDelegate.ContextElement element)
session
- The GeckoSession that initiated the callback.screenX
- The screen coordinates of the press.screenY
- The screen coordinates of the press.element
- The details for the pressed element.@UiThread default void onExternalResponse(@NonNull GeckoSession session, @NonNull WebResponse response)
session
- the GeckoSession that received the external response.response
- the external WebResponse.@UiThread default void onCrash(@NonNull GeckoSession session)
GeckoSession.open(GeckoRuntime)
to recover the session, but no state
is preserved. Most applications will want to call
GeckoSession.load(org.mozilla.geckoview.GeckoSession.Loader)
or GeckoSession.restoreState(SessionState)
at this point.session
- The GeckoSession for which the content process has crashed.@UiThread default void onKill(@NonNull GeckoSession session)
GeckoSession.open(GeckoRuntime)
to recover the session, but no state
is preserved. Most applications will want to call
GeckoSession.load(org.mozilla.geckoview.GeckoSession.Loader)
or GeckoSession.restoreState(SessionState)
at this point.session
- The GeckoSession for which the content process has been killed.@UiThread default void onFirstComposite(@NonNull GeckoSession session)
session
- The GeckoSession that had a first paint event.@UiThread default void onFirstContentfulPaint(@NonNull GeckoSession session)
onPaintStatusReset(GeckoSession)
event. The function onFirstComposite(GeckoSession)
will be called
once the compositor has started rendering. However, it is possible for the
compositor to start rendering before there is any content to render.
onFirstContentfulPaint() is called once some content has been rendered. It may be nothing
more than the page background color. It is not an indication that the whole page has
been rendered.session
- The GeckoSession that had a first paint event.@UiThread default void onPaintStatusReset(@NonNull GeckoSession session)
onFirstContentfulPaint(GeckoSession)
to determine when there is
valid content being rendered.session
- The GeckoSession that had the paint status reset event.@UiThread default void onWebAppManifest(@NonNull GeckoSession session, @NonNull JSONObject manifest)
session
- The GeckoSession that contains the Web App Manifestmanifest
- A parsed and validated JSONObject
containing the manifest contents.@UiThread @Nullable default GeckoResult<SlowScriptResponse> onSlowScript(@NonNull GeckoSession geckoSession, @NonNull String scriptFileName)
geckoSession
- GeckoSession that initiated the callback.scriptFileName
- Filename of the slow scriptGeckoResult
with a SlowScriptResponse value which indicates whether to
allow the Slow Script to continue processing. Stop will halt the slow script.
Continue will pause notifications for a period of time before resuming.