Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #24210: Remove wrapper from displaying toolbar menu event.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarare authored and mergify[bot] committed Apr 6, 2022
1 parent 1d457a8 commit 6f2de0e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ sealed class Event {
object OpenedTabSuggestionClicked : Event()

// Set default browser experiment metrics
object ToolbarMenuShown : Event()
object SetDefaultBrowserToolbarMenuClicked : Event()

// Home menu interaction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ private val Event.wrapper: EventWrapper<*>?
is Event.SetDefaultBrowserToolbarMenuClicked -> EventWrapper<NoExtraKeys>(
{ ExperimentsDefaultBrowser.toolbarMenuClicked.record(it) }
)
is Event.ToolbarMenuShown -> EventWrapper<NoExtraKeys>(
{ Events.toolbarMenuVisible.record(it) }
)

is Event.CustomTabsMenuOpened -> EventWrapper<NoExtraKeys>(
{ CustomTab.menu.record(it) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import mozilla.components.support.base.facts.Facts
import mozilla.components.support.base.log.logger.Logger
import mozilla.components.support.webextensions.facts.WebExtensionFacts
import org.mozilla.fenix.BuildConfig
import org.mozilla.fenix.GleanMetrics.Events
import org.mozilla.fenix.GleanMetrics.LoginDialog
import org.mozilla.fenix.GleanMetrics.PerfAwesomebar
import org.mozilla.fenix.search.awesomebar.ShortcutsSuggestionProvider
Expand Down Expand Up @@ -114,6 +115,10 @@ internal class ReleaseMetricController(
Component.FEATURE_PROMPTS to LoginDialogFacts.Items.SAVE -> {
LoginDialog.saved.record(NoExtras())
}

Component.BROWSER_TOOLBAR to ToolbarFacts.Items.MENU -> {
Events.toolbarMenuVisible.record(NoExtras())
}
else -> {
this.toEvent()?.also {
track(it)
Expand Down Expand Up @@ -204,9 +209,6 @@ internal class ReleaseMetricController(
}
}

Component.BROWSER_TOOLBAR == component && ToolbarFacts.Items.MENU == item -> {
metadata?.get("customTab")?.let { Event.CustomTabsMenuOpened } ?: Event.ToolbarMenuShown
}
Component.BROWSER_MENU == component && BrowserMenuFacts.Items.WEB_EXTENSION_MENU_ITEM == item -> {
metadata?.get("id")?.let { Event.AddonsOpenInToolbarMenu(it.toString()) }
}
Expand Down

0 comments on commit 6f2de0e

Please sign in to comment.