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

Commit

Permalink
For #3174: Adds telemetry for bookmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
sblatz committed Jun 27, 2019
1 parent c9962a7 commit 3b77914
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
11 changes: 11 additions & 0 deletions app/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,17 @@ bookmarks_management:
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
folder_remove:
type: event
description: >
A user removed a bookmark folder.
bugs:
- 3174
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/3724
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"

custom_tab:
closed:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ private val Event.wrapper
is Event.AddBookmarkFolder -> EventWrapper<NoExtraKeys>(
{ BookmarksManagement.folderAdd.record(it) }
)
is Event.RemoveBookmarkFolder -> EventWrapper<NoExtraKeys>(
{ BookmarksManagement.folderRemove.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 @@ -65,6 +65,7 @@ sealed class Event {
object ShareBookmark : Event()
object CopyBookmark : Event()
object AddBookmarkFolder : Event()
object RemoveBookmarkFolder : Event()
object RemoveBookmarks : Event()
object QuickActionSheetOpened : Event()
object QuickActionSheetClosed : Event()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,11 @@ class BookmarkFragment : Fragment(), BackHandler, AccountObserver {

val deleteOperation: (suspend () -> Unit) = {
bookmarkStorage?.deleteNode(bookmarkNode.guid)
metrics()?.track(Event.RemoveBookmark)
when (bookmarkNode.type) {
BookmarkNodeType.FOLDER -> metrics()?.track(Event.RemoveBookmarkFolder)
BookmarkNodeType.ITEM -> metrics()?.track(Event.RemoveBookmark)
else -> { }
}
pendingBookmarkDeletionJob = null
refreshBookmarks()
}
Expand Down

0 comments on commit 3b77914

Please sign in to comment.