summaryrefslogtreecommitdiffstats
path: root/browser/components/asrouter/modules/ToolbarBadgeHub.sys.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'browser/components/asrouter/modules/ToolbarBadgeHub.sys.mjs')
-rw-r--r--browser/components/asrouter/modules/ToolbarBadgeHub.sys.mjs36
1 files changed, 0 insertions, 36 deletions
diff --git a/browser/components/asrouter/modules/ToolbarBadgeHub.sys.mjs b/browser/components/asrouter/modules/ToolbarBadgeHub.sys.mjs
index 57fd104f19..36f7ca5005 100644
--- a/browser/components/asrouter/modules/ToolbarBadgeHub.sys.mjs
+++ b/browser/components/asrouter/modules/ToolbarBadgeHub.sys.mjs
@@ -10,7 +10,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
clearTimeout: "resource://gre/modules/Timer.sys.mjs",
requestIdleCallback: "resource://gre/modules/Timer.sys.mjs",
setTimeout: "resource://gre/modules/Timer.sys.mjs",
- ToolbarPanelHub: "resource:///modules/asrouter/ToolbarPanelHub.sys.mjs",
});
let notificationsByWindow = new WeakMap();
@@ -19,9 +18,6 @@ export class _ToolbarBadgeHub {
constructor() {
this.id = "toolbar-badge-hub";
this.state = {};
- this.prefs = {
- WHATSNEW_TOOLBAR_PANEL: "browser.messaging-system.whatsNewPanel.enabled",
- };
this.removeAllNotifications = this.removeAllNotifications.bind(this);
this.removeToolbarNotification = this.removeToolbarNotification.bind(this);
this.addToolbarNotification = this.addToolbarNotification.bind(this);
@@ -62,34 +58,12 @@ export class _ToolbarBadgeHub {
triggerId: "toolbarBadgeUpdate",
template: "toolbar_badge",
});
- // Listen for pref changes that could trigger new badges
- Services.prefs.addObserver(this.prefs.WHATSNEW_TOOLBAR_PANEL, this);
- }
-
- observe(aSubject, aTopic, aPrefName) {
- switch (aPrefName) {
- case this.prefs.WHATSNEW_TOOLBAR_PANEL:
- this.messageRequest({
- triggerId: "toolbarBadgeUpdate",
- template: "toolbar_badge",
- });
- break;
- }
}
maybeInsertFTL(win) {
win.MozXULElement.insertFTLIfNeeded("browser/newtab/asrouter.ftl");
}
- executeAction({ id }) {
- switch (id) {
- case "show-whatsnew-button":
- lazy.ToolbarPanelHub.enableToolbarButton();
- lazy.ToolbarPanelHub.enableAppmenuButton();
- break;
- }
- }
-
_clearBadgeTimeout() {
if (this.state.showBadgeTimeoutId) {
lazy.clearTimeout(this.state.showBadgeTimeoutId);
@@ -153,9 +127,6 @@ export class _ToolbarBadgeHub {
addToolbarNotification(win, message) {
const document = win.browser.ownerDocument;
- if (message.content.action) {
- this.executeAction({ ...message.content.action, message_id: message.id });
- }
let toolbarbutton = document.getElementById(message.content.target);
if (toolbarbutton) {
const badge = toolbarbutton.querySelector(".toolbarbutton-badge");
@@ -211,12 +182,6 @@ export class _ToolbarBadgeHub {
}
registerBadgeToAllWindows(message) {
- if (message.template === "update_action") {
- this.executeAction({ ...message.content.action, message_id: message.id });
- // No badge to set only an action to execute
- return;
- }
-
lazy.EveryWindow.registerCallback(
this.id,
win => {
@@ -297,7 +262,6 @@ export class _ToolbarBadgeHub {
this.state = {};
this._initialized = false;
notificationsByWindow = new WeakMap();
- Services.prefs.removeObserver(this.prefs.WHATSNEW_TOOLBAR_PANEL, this);
}
}