|
|
|
@ -36,6 +36,7 @@ import mozilla.components.support.webextensions.facts.WebExtensionFacts
|
|
|
|
|
import mozilla.telemetry.glean.private.NoExtras
|
|
|
|
|
import org.mozilla.fenix.BuildConfig
|
|
|
|
|
import org.mozilla.fenix.GleanMetrics.Addons
|
|
|
|
|
import org.mozilla.fenix.GleanMetrics.ContextMenu
|
|
|
|
|
import org.mozilla.fenix.GleanMetrics.CustomTab
|
|
|
|
|
import org.mozilla.fenix.GleanMetrics.Events
|
|
|
|
|
import org.mozilla.fenix.GleanMetrics.LoginDialog
|
|
|
|
@ -145,6 +146,15 @@ internal class ReleaseMetricController(
|
|
|
|
|
CustomTab.closed.record(NoExtras())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component.FEATURE_CONTEXTMENU to ContextMenuFacts.Items.ITEM -> {
|
|
|
|
|
metadata?.get("item")?.let {
|
|
|
|
|
contextMenuAllowList[item]?.let {
|
|
|
|
|
ContextMenu.itemTapped.record(ContextMenu.ItemTappedExtra(it))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Unit
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component.BROWSER_MENU to BrowserMenuFacts.Items.WEB_EXTENSION_MENU_ITEM -> {
|
|
|
|
|
metadata?.get("id")?.let {
|
|
|
|
|
Addons.openAddonInToolbarMenu.record(Addons.OpenAddonInToolbarMenuExtra(it.toString()))
|
|
|
|
@ -229,9 +239,6 @@ internal class ReleaseMetricController(
|
|
|
|
|
Component.FEATURE_PROMPTS == component && CreditCardAutofillDialogFacts.Items.AUTOFILL_CREDIT_CARD_PROMPT_DISMISSED == item ->
|
|
|
|
|
Event.CreditCardAutofillPromptDismissed
|
|
|
|
|
|
|
|
|
|
Component.FEATURE_CONTEXTMENU == component && ContextMenuFacts.Items.ITEM == item -> {
|
|
|
|
|
metadata?.get("item")?.let { Event.ContextMenuItemTapped.create(it.toString()) }
|
|
|
|
|
}
|
|
|
|
|
Component.FEATURE_CONTEXTMENU == component && ContextMenuFacts.Items.TEXT_SELECTION_OPTION == item -> {
|
|
|
|
|
when (metadata?.get("textSelectionOption")?.toString()) {
|
|
|
|
|
CONTEXT_MENU_COPY -> Event.ContextMenuCopyTapped
|
|
|
|
@ -368,5 +375,19 @@ internal class ReleaseMetricController(
|
|
|
|
|
const val CONTEXT_MENU_SEARCH_PRIVATELY = "CUSTOM_CONTEXT_MENU_SEARCH_PRIVATELY"
|
|
|
|
|
const val CONTEXT_MENU_SELECT_ALL = "org.mozilla.geckoview.SELECT_ALL"
|
|
|
|
|
const val CONTEXT_MENU_SHARE = "CUSTOM_CONTEXT_MENU_SHARE"
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Non - Text selection long press context menu items to be tracked.
|
|
|
|
|
*/
|
|
|
|
|
private val contextMenuAllowList = mapOf(
|
|
|
|
|
"mozac.feature.contextmenu.open_in_new_tab" to "open_in_new_tab",
|
|
|
|
|
"mozac.feature.contextmenu.open_in_private_tab" to "open_in_private_tab",
|
|
|
|
|
"mozac.feature.contextmenu.open_image_in_new_tab" to "open_image_in_new_tab",
|
|
|
|
|
"mozac.feature.contextmenu.save_image" to "save_image",
|
|
|
|
|
"mozac.feature.contextmenu.share_link" to "share_link",
|
|
|
|
|
"mozac.feature.contextmenu.copy_link" to "copy_link",
|
|
|
|
|
"mozac.feature.contextmenu.copy_image_location" to "copy_image_location",
|
|
|
|
|
"mozac.feature.contextmenu.share_image" to "share_image"
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|