Bug 1917838 - Remove expired telemetry event close_tab_warning.shown, r=chutten,tabbrowser-reviewers,firefox-desktop-core-reviewers ,dao.
Differential Revision: https://phabricator.services.mozilla.com/D221650
This commit is contained in:
@@ -5851,10 +5851,9 @@ function WindowIsClosing(event) {
|
||||
* Checks if this is the last full *browser* window around. If it is, this will
|
||||
* be communicated like quitting. Otherwise, we warn about closing multiple tabs.
|
||||
*
|
||||
* @param source where the request to close came from (used for telemetry)
|
||||
* @returns true if closing can proceed, false if it got cancelled.
|
||||
*/
|
||||
function warnAboutClosingWindow(source) {
|
||||
function warnAboutClosingWindow() {
|
||||
// Popups aren't considered full browser windows; we also ignore private windows.
|
||||
let isPBWindow =
|
||||
PrivateBrowsingUtils.isWindowPrivate(window) &&
|
||||
@@ -5863,8 +5862,7 @@ function warnAboutClosingWindow(source) {
|
||||
if (!isPBWindow && !toolbar.visible) {
|
||||
return gBrowser.warnAboutClosingTabs(
|
||||
gBrowser.visibleTabs.length,
|
||||
gBrowser.closingTabsEnum.ALL,
|
||||
source
|
||||
gBrowser.closingTabsEnum.ALL
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5904,8 +5902,7 @@ function warnAboutClosingWindow(source) {
|
||||
isPBWindow ||
|
||||
gBrowser.warnAboutClosingTabs(
|
||||
gBrowser.visibleTabs.length,
|
||||
gBrowser.closingTabsEnum.ALL,
|
||||
source
|
||||
gBrowser.closingTabsEnum.ALL
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -5930,8 +5927,7 @@ function warnAboutClosingWindow(source) {
|
||||
isPBWindow ||
|
||||
gBrowser.warnAboutClosingTabs(
|
||||
gBrowser.visibleTabs.length,
|
||||
gBrowser.closingTabsEnum.ALL,
|
||||
source
|
||||
gBrowser.closingTabsEnum.ALL
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3520,7 +3520,6 @@ BrowserGlue.prototype = {
|
||||
|
||||
let windowcount = 0;
|
||||
let pagecount = 0;
|
||||
let pinnedcount = 0;
|
||||
for (let win of lazy.BrowserWindowTracker.orderedWindows) {
|
||||
if (win.closed) {
|
||||
continue;
|
||||
@@ -3528,7 +3527,6 @@ BrowserGlue.prototype = {
|
||||
windowcount++;
|
||||
let tabbrowser = win.gBrowser;
|
||||
if (tabbrowser) {
|
||||
pinnedcount += tabbrowser._numPinnedTabs;
|
||||
pagecount += tabbrowser.visibleTabs.length - tabbrowser._numPinnedTabs;
|
||||
}
|
||||
}
|
||||
@@ -3616,26 +3614,6 @@ BrowserGlue.prototype = {
|
||||
checkboxLabel.value,
|
||||
warnOnClose
|
||||
);
|
||||
Services.telemetry.setEventRecordingEnabled("close_tab_warning", true);
|
||||
let warnCheckbox = warnOnClose.value ? "checked" : "unchecked";
|
||||
|
||||
let sessionWillBeRestored =
|
||||
Services.prefs.getIntPref("browser.startup.page") == 3 ||
|
||||
Services.prefs.getBoolPref("browser.sessionstore.resume_session_once");
|
||||
Services.telemetry.recordEvent(
|
||||
"close_tab_warning",
|
||||
"shown",
|
||||
"application",
|
||||
null,
|
||||
{
|
||||
source: this._quitSource,
|
||||
button: buttonPressed == 0 ? "close" : "cancel",
|
||||
warn_checkbox: warnCheckbox,
|
||||
closing_wins: "" + windowcount,
|
||||
closing_tabs: "" + (pagecount + pinnedcount),
|
||||
will_restore: sessionWillBeRestored ? "yes" : "no",
|
||||
}
|
||||
);
|
||||
|
||||
// If the user has unticked the box, and has confirmed closing, stop showing
|
||||
// the warning.
|
||||
|
||||
@@ -3436,7 +3436,7 @@
|
||||
}
|
||||
},
|
||||
|
||||
warnAboutClosingTabs(tabsToClose, aCloseTabs, aSource) {
|
||||
warnAboutClosingTabs(tabsToClose, aCloseTabs) {
|
||||
// We want to warn about closing duplicates even if there was only a
|
||||
// single duplicate, so we intentionally place this above the check for
|
||||
// tabsToClose <= 1.
|
||||
@@ -3540,39 +3540,6 @@
|
||||
warnOnClose
|
||||
);
|
||||
|
||||
Services.telemetry.setEventRecordingEnabled("close_tab_warning", true);
|
||||
let closeTabEnumKey =
|
||||
Object.entries(this.closingTabsEnum)
|
||||
.find(([, v]) => v == aCloseTabs)?.[0]
|
||||
?.toLowerCase() || "some";
|
||||
|
||||
let warnCheckbox = warnOnClose.value ? "checked" : "unchecked";
|
||||
if (!checkboxLabel) {
|
||||
warnCheckbox = "not-present";
|
||||
}
|
||||
let sessionWillBeRestored =
|
||||
Services.prefs.getIntPref("browser.startup.page") == 3 ||
|
||||
Services.prefs.getBoolPref("browser.sessionstore.resume_session_once");
|
||||
let closesWindow = aCloseTabs == this.closingTabsEnum.ALL;
|
||||
Services.telemetry.recordEvent(
|
||||
"close_tab_warning",
|
||||
"shown",
|
||||
closesWindow ? "window" : "tabs",
|
||||
null,
|
||||
{
|
||||
source: aSource || `close-${closeTabEnumKey}-tabs`,
|
||||
button: buttonPressed == 0 ? "close" : "cancel",
|
||||
warn_checkbox: warnCheckbox,
|
||||
closing_tabs: "" + tabsToClose,
|
||||
closing_wins: "" + +closesWindow, // ("1" or "0", depending on the value)
|
||||
// This value doesn't really apply to whether this warning
|
||||
// gets shown, but having pings be consistent (and perhaps
|
||||
// being able to see trends for users with/without sessionrestore)
|
||||
// seems useful:
|
||||
will_restore: sessionWillBeRestored ? "yes" : "no",
|
||||
}
|
||||
);
|
||||
|
||||
var reallyClose = buttonPressed == 0;
|
||||
|
||||
// don't set the pref unless they press OK and it's false
|
||||
|
||||
@@ -3706,28 +3706,6 @@ contextservices.quicksuggest:
|
||||
- adw@mozilla.com
|
||||
expiry_version: never
|
||||
|
||||
close_tab_warning:
|
||||
shown:
|
||||
description: >
|
||||
Recorded whenever we show the 'Close Tabs' dialog, with details about
|
||||
the reason it is shown and what choices the user makes (close or not).
|
||||
objects: ["window", "application", "tabs"]
|
||||
release_channel_collection: opt-out
|
||||
expiry_version: "99"
|
||||
record_in_processes: ["main"]
|
||||
products: ["firefox"]
|
||||
bug_numbers: [1712306, 1725296]
|
||||
notification_emails:
|
||||
- gkruitbosch@mozilla.com
|
||||
- rtestard@mozilla.com
|
||||
extra_keys:
|
||||
source: The way in which the tabs were closed (shortcut, close button, menuitem, appmenu, etc.)
|
||||
button: Which button the user clicked (Close tabs or Cancel)
|
||||
warn_checkbox: Whether the checkbox to display the warning again was checked or not.
|
||||
closing_wins: The number of windows being closed.
|
||||
closing_tabs: The number of tabs being closed.
|
||||
will_restore: Whether the session will be restored if closed now.
|
||||
|
||||
memory_watcher:
|
||||
on_high_memory:
|
||||
description: >
|
||||
|
||||
@@ -26,7 +26,7 @@ function closeWindow(aClose, aPromptFunction, aSource) {
|
||||
if (
|
||||
windowCount != 1 &&
|
||||
typeof aPromptFunction == "function" &&
|
||||
!aPromptFunction(aSource)
|
||||
!aPromptFunction()
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
@@ -35,10 +35,7 @@ function closeWindow(aClose, aPromptFunction, aSource) {
|
||||
if (aClose) {
|
||||
window.SessionStore?.maybeDontRestoreTabs(window);
|
||||
}
|
||||
} else if (
|
||||
typeof aPromptFunction == "function" &&
|
||||
!aPromptFunction(aSource)
|
||||
) {
|
||||
} else if (typeof aPromptFunction == "function" && !aPromptFunction()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user