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

Commit

Permalink
For #15369: Add synced tabs usage metrics.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarare committed Nov 24, 2020
1 parent 4615aba commit b4e7d64
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ sealed class Event {

object TabSettingsOpened : Event()

object SyncedTabOpened : Event()

// Interaction events with extras

data class TopSiteSwipeCarousel(val page: Int) : Event() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,12 @@ private val Event.wrapper: EventWrapper<*>?
{ ProgressiveWebApp.backgroundKeys.valueOf(it) }
)

Event.SyncedTabOpened -> EventWrapper<NoExtraKeys>(
{ Metrics.syncedTabsOpenedCount.add(1) }
).also {
Metrics.hasOpenedSyncedTabs.set(true)
}

Event.MasterPasswordMigrationDisplayed -> EventWrapper<NoExtraKeys>(
{ MasterPassword.displayed.record(it) }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ class DefaultTabTrayController(
newTab = true,
from = BrowserDirection.FromTabTray
)
metrics.track(Event.SyncedTabOpened)
}

@OptIn(ExperimentalCoroutinesApi::class)
Expand Down

0 comments on commit b4e7d64

Please sign in to comment.