Skip to content

Commit

Permalink
For mozilla-mobile#26502: Add time group and private extras in histor…
Browse files Browse the repository at this point in the history
…y telemetry
  • Loading branch information
rocketsroger authored and mergify[bot] committed Sep 8, 2022
1 parent 9ed3e8e commit 3081488
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 45 deletions.
52 changes: 13 additions & 39 deletions app/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3238,37 +3238,30 @@ history:
type: boolean
description: |
True if the history item is synced from other devices otherwise false.
time_group:
type: string
description: |
What time group does the history item belongs to.
Possible values: [Today], [Yesterday], [ThisWeek], [ThisMonth],
[Older].
is_private:
type: boolean
description: |
True if the history item is opened in a private tab, otherwise false.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/18178
- https://github.com/mozilla-mobile/fenix/issues/26502
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/18261
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/fenix/pull/21038#issuecomment-906757301
- https://github.com/mozilla-mobile/fenix/pull/26503#issuecomment-1219761407
- https://github.com/mozilla-mobile/fenix/pull/26863
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
- mavduevskiy@mozilla.com
expires: never
metadata:
tags:
- History
opened_item_in_new_tab:
type: event
description: |
A user opened a history item in a new tab
bugs:
- https://github.com/mozilla-mobile/fenix/issues/18178
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/18261
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/fenix/pull/21038#issuecomment-906757301
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
- erichards@mozilla.com
- royang@mozilla.com
expires: never
metadata:
tags:
Expand All @@ -3293,25 +3286,6 @@ history:
metadata:
tags:
- History
opened_item_in_private_tab:
type: event
description: |
A user opened a history item in a private tab
bugs:
- https://github.com/mozilla-mobile/fenix/issues/18178
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/18261
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
- https://github.com/mozilla-mobile/fenix/pull/21038#issuecomment-906757301
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
- erichards@mozilla.com
expires: never
metadata:
tags:
- History
opened_items_in_private_tabs:
type: event
description: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,33 +333,39 @@ class HistoryFragment : LibraryPageFragment<History>(), UserInteractionHandler {
}

private fun openItem(item: History.Regular) {
GleanHistory.openedItem.record(GleanHistory.OpenedItemExtra(item.isRemote))
GleanHistory.openedItem.record(
GleanHistory.OpenedItemExtra(
isRemote = item.isRemote,
timeGroup = item.historyTimeGroup.toString(),
isPrivate = (activity as HomeActivity).browsingModeManager.mode == BrowsingMode.Private,
),
)

(activity as HomeActivity).openToBrowserAndLoad(
searchTermOrURL = item.url,
newTab = true,
from = BrowserDirection.FromHistory
from = BrowserDirection.FromHistory,
)
}

private fun displayDeleteTimeRange() {
DeleteConfirmationDialogFragment(
historyInteractor = historyInteractor
historyInteractor = historyInteractor,
).show(childFragmentManager, null)
}

private fun share(data: List<ShareData>) {
GleanHistory.shared.record(NoExtras())
val directions = HistoryFragmentDirections.actionGlobalShareFragment(
data = data.toTypedArray()
data = data.toTypedArray(),
)
navigateToHistoryFragment(directions)
}

private fun navigateToHistoryFragment(directions: NavDirections) {
findNavController().nav(
R.id.historyFragment,
directions
directions,
)
}

Expand All @@ -371,7 +377,7 @@ class HistoryFragment : LibraryPageFragment<History>(), UserInteractionHandler {
}

internal class DeleteConfirmationDialogFragment(
private val historyInteractor: HistoryInteractor
private val historyInteractor: HistoryInteractor,
) : DialogFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog =
AlertDialog.Builder(requireContext()).apply {
Expand Down

0 comments on commit 3081488

Please sign in to comment.