tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit bbbf1876cd8cdf1cdd29667dfd57ea40bb230301
parent 282a5bc016f34bf23cd617f198eb7ecf7c814990
Author: Jared Hirsch <ohai@6a68.net>
Date:   Tue,  2 Dec 2025 23:21:22 +0000

Bug 1997471 - Add telemetry for desktop shortcut toggle on edit profile page r=profiles-reviewers,toolkit-telemetry-reviewers,niklas

Note desktop shortcuts, hence the associated test and telemetry, are
Windows-only.

Differential Revision: https://phabricator.services.mozilla.com/D273935

Diffstat:
Mbrowser/components/profiles/ProfilesParent.sys.mjs | 2++
Mbrowser/components/profiles/metrics.yaml | 23+++++++++++++++++++++++
Mbrowser/components/profiles/tests/browser/browser_desktop_shortcut_test.js | 6++++++
Mtoolkit/components/telemetry/Events.yaml | 3++-
4 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/browser/components/profiles/ProfilesParent.sys.mjs b/browser/components/profiles/ProfilesParent.sys.mjs @@ -377,8 +377,10 @@ export class ProfilesParent extends JSWindowActorParent { let { shouldEnable } = message.data; if (shouldEnable) { await profile.ensureDesktopShortcut(); + Glean.profilesExisting.shortcut.record({ value: "create" }); } else { await profile.removeDesktopShortcut(); + Glean.profilesExisting.shortcut.record({ value: "delete" }); } return { hasDesktopShortcut: profile.hasDesktopShortcut(), diff --git a/browser/components/profiles/metrics.yaml b/browser/components/profiles/metrics.yaml @@ -220,6 +220,29 @@ profiles.existing: expires: never send_in_pings: ['events', 'profiles'] telemetry_mirror: Profiles_Existing_Name + shortcut: + type: event + description: Recorded when the user clicks the desktop shortcut toggle. + extra_keys: + value: + description: > + The `value` of the event. Mirrors to the Legacy Telemetry + event's `value` parameter. If the user changed the toggle to the + "on" position, the `value` will be `create`. If the user changed + the toggle to the "off" position, the `value` will be `delete`. + type: string + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1997471 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1997471 + notification_emails: + - cmkm@mozilla.com + - dtownsend@mozilla.com + - jhirsch@mozilla.com + - nbaumgardner@mozilla.com + expires: never + send_in_pings: ['events', 'profiles'] + telemetry_mirror: Profiles_Existing_Shortcut theme: type: event description: Recorded when the user selects a different theme. diff --git a/browser/components/profiles/tests/browser/browser_desktop_shortcut_test.js b/browser/components/profiles/tests/browser/browser_desktop_shortcut_test.js @@ -79,6 +79,9 @@ add_task(async function test_create_shortcut() { createShortcutCalled, "ShellService.createShortcut should have been called" ); + + await assertGlean("profiles", "existing", "shortcut", "create"); + sandbox.restore(); }); @@ -140,5 +143,8 @@ add_task(async function test_delete_shortcut() { deleteShortcutCalled, "ShellService.deleteShortcut should have been called" ); + + await assertGlean("profiles", "existing", "shortcut", "delete"); + sandbox.restore(); }); diff --git a/toolkit/components/telemetry/Events.yaml b/toolkit/components/telemetry/Events.yaml @@ -3994,7 +3994,7 @@ profiles: products: - "firefox" existing: - objects: ["alert", "avatar", "closed", "deleted", "displayed", "learn_more", "name", "theme"] + objects: ["alert", "avatar", "closed", "deleted", "displayed", "learn_more", "name", "shortcut", "theme"] release_channel_collection: opt-out record_in_processes: - main @@ -4009,6 +4009,7 @@ profiles: - "nbaumgardner@mozilla.com" bug_numbers: - 1927607 + - 1997471 expiry_version: never products: - "firefox"