Backed out changeset 21855963319c (bug 1900513) for causing bc failures @ browser_device_connected.js CLOSED TREE

This commit is contained in:
Sandor Molnar
2024-06-14 23:52:19 +03:00
parent 7341bec522
commit 0c56720629
6 changed files with 1 additions and 225 deletions

View File

@@ -28,7 +28,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.sys.mjs",
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs",
BuiltInThemes: "resource:///modules/BuiltInThemes.sys.mjs",
CloseRemoteTab: "resource://gre/modules/FxAccountsCommands.sys.mjs",
ContentRelevancyManager:
"resource://gre/modules/ContentRelevancyManager.sys.mjs",
ContextualIdentityService:
@@ -136,7 +135,7 @@ XPCOMUtils.defineLazyServiceGetters(lazy, {
ChromeUtils.defineLazyGetter(
lazy,
"accountsL10n",
() => new Localization(["browser/accounts.ftl", "branding/brand.ftl"], true)
() => new Localization(["browser/accounts.ftl"], true)
);
if (AppConstants.ENABLE_WEBDRIVER) {
@@ -4987,64 +4986,6 @@ BrowserGlue.prototype = {
break;
}
}
let clickCallback = async (subject, topic) => {
if (topic == "alertshow") {
// Keep track of the fact that we showed the notification to
// the user at least once
lazy.CloseRemoteTab.hasPendingCloseTabNotification = true;
}
// The notification is either turned off or dismissed by user
if (topic == "alertfinished") {
// Reset the notification pending flag
lazy.CloseRemoteTab.hasPendingCloseTabNotification = false;
}
if (topic != "alertclickcallback") {
return;
}
let win =
lazy.BrowserWindowTracker.getTopWindow({ private: false }) ??
(await lazy.BrowserWindowTracker.promiseOpenWindow());
// We don't want to open a new tab, instead use the handler
// to switch to the existing view
if (win) {
win.FirefoxViewHandler.openTab("recentlyclosed");
}
};
let imageURL;
if (AppConstants.platform == "win") {
imageURL = "chrome://branding/content/icon64.png";
}
// Reset the count only if there are no pending notifications
if (!lazy.CloseRemoteTab.hasPendingCloseTabNotification) {
lazy.CloseRemoteTab.closeTabNotificationCount = 0;
}
lazy.CloseRemoteTab.closeTabNotificationCount += urls.length;
const [title, body] = await lazy.accountsL10n.formatValues([
{
id: "account-tabs-closed-remotely",
args: { closedCount: lazy.CloseRemoteTab.closeTabNotificationCount },
},
{ id: "account-view-recently-closed-tabs" },
]);
try {
this.AlertsService.showAlertNotification(
imageURL,
title,
body,
true,
null,
clickCallback,
"closed-tab-notification"
);
} catch (ex) {
console.error("Error notifying user of closed tab(s) ", ex);
}
},
async _onVerifyLoginNotification({ body, title, url }) {