Interface WebExtension.ActionDelegate
- Enclosing class:
- WebExtension
This delegate will receive the default action when registered with WebExtension.setActionDelegate(org.mozilla.geckoview.WebExtension.ActionDelegate)
. To receive GeckoSession
-specific overrides you can use
WebExtension.SessionController.setActionDelegate(org.mozilla.geckoview.WebExtension, org.mozilla.geckoview.WebExtension.ActionDelegate)
.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
onBrowserAction
(WebExtension extension, GeckoSession session, WebExtension.Action action) Called whenever a browser action is defined or updated.default GeckoResult<GeckoSession>
onOpenPopup
(WebExtension extension, WebExtension.Action action) Called whenever the action wants to open a popup view.default void
onPageAction
(WebExtension extension, GeckoSession session, WebExtension.Action action) Called whenever a page action is defined or updated.default GeckoResult<GeckoSession>
onTogglePopup
(WebExtension extension, WebExtension.Action action) Called whenever the action wants to toggle a popup view.
-
Method Details
-
onBrowserAction
@UiThread default void onBrowserAction(@NonNull WebExtension extension, @Nullable GeckoSession session, @NonNull WebExtension.Action action) Called whenever a browser action is defined or updated.This method will be called whenever an extension that defines a browser action is registered or the properties of the Action are updated.
See also WebExtensions/API/browserAction , WebExtensions/manifest.json/browser_action .
- Parameters:
extension
- The extension that defined this browser action.session
- Either theGeckoSession
corresponding to the tab to which this Action override applies.null
ifaction
is the new default value.action
-WebExtension.Action
containing the override values for thisGeckoSession
or the default value ifsession
isnull
.
-
onPageAction
@UiThread default void onPageAction(@NonNull WebExtension extension, @Nullable GeckoSession session, @NonNull WebExtension.Action action) Called whenever a page action is defined or updated.This method will be called whenever an extension that defines a page action is registered or the properties of the Action are updated.
See also WebExtensions/API/pageAction , WebExtensions/manifest.json/page_action .
- Parameters:
extension
- The extension that defined this page action.session
- Either theGeckoSession
corresponding to the tab to which this Action override applies.null
ifaction
is the new default value.action
-WebExtension.Action
containing the override values for thisGeckoSession
or the default value ifsession
isnull
.
-
onTogglePopup
@UiThread @Nullable default GeckoResult<GeckoSession> onTogglePopup(@NonNull WebExtension extension, @NonNull WebExtension.Action action) Called whenever the action wants to toggle a popup view.- Parameters:
extension
- The extension that wants to display a popupaction
- The action where the popup is defined- Returns:
- A GeckoSession that will be used to display the pop-up, null if no popup will be displayed.
-
onOpenPopup
@UiThread @Nullable default GeckoResult<GeckoSession> onOpenPopup(@NonNull WebExtension extension, @NonNull WebExtension.Action action) Called whenever the action wants to open a popup view.- Parameters:
extension
- The extension that wants to display a popupaction
- The action where the popup is defined- Returns:
- A GeckoSession that will be used to display the pop-up, null if no popup will be displayed.
-