2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-05 21:20:45 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/16827: Add copy url from long press metrics.

This commit is contained in:
mcarare 2020-12-08 13:14:48 +02:00 committed by Mihai Adrian Carare
parent 20cff480b7
commit 8ad1fdea2d
3 changed files with 7 additions and 0 deletions

View File

@ -187,6 +187,8 @@ sealed class Event {
object TabSettingsOpened : Event()
object CopyUrlUsed : Event()
object SyncedTabOpened : Event()
object RecentlyClosedTabsOpened : Event()

View File

@ -673,6 +673,9 @@ private val Event.wrapper: EventWrapper<*>?
{ ProgressiveWebApp.background.record(it) },
{ ProgressiveWebApp.backgroundKeys.valueOf(it) }
)
is Event.CopyUrlUsed -> EventWrapper<NoExtraKeys>(
{ Events.copyUrlTapped.record(it) }
)
is Event.SyncedTabOpened -> EventWrapper<NoExtraKeys>(
{ Events.syncedTabOpened.record(it) }

View File

@ -20,6 +20,7 @@ import mozilla.components.browser.state.selector.selectedTab
import mozilla.components.browser.state.store.BrowserStore
import org.mozilla.fenix.R
import org.mozilla.fenix.components.FenixSnackbar
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.components
import java.lang.ref.WeakReference
@ -74,6 +75,7 @@ object ToolbarPopupWindow {
.setText(context.getString(R.string.browser_toolbar_url_copied_to_clipboard_snackbar))
.show()
}
context.components.analytics.metrics.track(Event.CopyUrlUsed)
}
customView.paste.setOnClickListener {