diff --git a/.prettierignore b/.prettierignore
index 07265bd95491..effc13f3d7ec 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -57,7 +57,6 @@ browser/base/content/macWindow.inc.xhtml
browser/base/content/main-popupset.inc.xhtml
browser/base/content/pageinfo/pageInfo.xhtml
browser/base/content/webext-panels.xhtml
-browser/base/content/webrtcLegacyIndicator.xhtml
browser/components/downloads/content/contentAreaDownloadsView.xhtml
browser/components/places/content/bookmarkProperties.xhtml
browser/components/places/content/bookmarksSidebar.xhtml
diff --git a/browser/base/content/webrtcIndicator.js b/browser/base/content/webrtcIndicator.js
index 765c75c03134..f38c7446ba16 100644
--- a/browser/base/content/webrtcIndicator.js
+++ b/browser/base/content/webrtcIndicator.js
@@ -12,11 +12,6 @@ const { showStreamSharingMenu, webrtcUI } = ChromeUtils.importESModule(
"resource:///modules/webrtcUI.sys.mjs"
);
-ChromeUtils.defineESModuleGetters(this, {
- BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs",
- MacOSWebRTCStatusbarIndicator: "resource:///modules/webrtcUI.sys.mjs",
-});
-
XPCOMUtils.defineLazyServiceGetter(
this,
"gScreenManager",
diff --git a/browser/base/content/webrtcLegacyIndicator.js b/browser/base/content/webrtcLegacyIndicator.js
deleted file mode 100644
index 76914d272033..000000000000
--- a/browser/base/content/webrtcLegacyIndicator.js
+++ /dev/null
@@ -1,208 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const { webrtcUI } = ChromeUtils.importESModule(
- "resource:///modules/webrtcUI.sys.mjs"
-);
-
-function init(event) {
- for (let id of ["audioVideoButton", "screenSharePopup"]) {
- let popup = document.getElementById(id);
- popup.addEventListener("popupshowing", onPopupMenuShowing);
- popup.addEventListener("popuphiding", onPopupMenuHiding);
- popup.addEventListener("command", onPopupMenuCommand);
- }
-
- let fxButton = document.getElementById("firefoxButton");
- fxButton.addEventListener("click", onFirefoxButtonClick);
- fxButton.addEventListener("mousedown", PositionHandler);
-
- updateIndicatorState();
-
- // Alert accessibility implementations stuff just changed. We only need to do
- // this initially, because changes after this will automatically fire alert
- // events if things change materially.
- let ev = new CustomEvent("AlertActive", { bubbles: true, cancelable: true });
- document.documentElement.dispatchEvent(ev);
-}
-
-function updateIndicatorState() {
- updateWindowAttr("sharingvideo", webrtcUI.showCameraIndicator);
- updateWindowAttr("sharingaudio", webrtcUI.showMicrophoneIndicator);
- updateWindowAttr("sharingscreen", webrtcUI.showScreenSharingIndicator);
-
- // Camera and microphone button tooltip.
- const audioVideoButton = document.getElementById("audioVideoButton");
- let avL10nId;
- if (webrtcUI.showCameraIndicator) {
- avL10nId = webrtcUI.showMicrophoneIndicator
- ? "webrtc-indicator-sharing-camera-and-microphone"
- : "webrtc-indicator-sharing-camera";
- } else {
- avL10nId = webrtcUI.showMicrophoneIndicator
- ? "webrtc-indicator-sharing-microphone"
- : "";
- }
- if (avL10nId) {
- document.l10n.setAttributes(audioVideoButton, avL10nId);
- } else {
- audioVideoButton.removeAttribute("data-l10n-id");
- audioVideoButton.removeAttribute("tooltiptext");
- }
-
- // Screen sharing button tooltip.
- const screenShareButton = document.getElementById("screenShareButton");
- let ssL10nId;
- const ssi = webrtcUI.showScreenSharingIndicator;
- switch (ssi) {
- case "Application":
- ssL10nId = "webrtc-indicator-sharing-application";
- break;
- case "Browser":
- ssL10nId = "webrtc-indicator-sharing-browser";
- break;
- case "Screen":
- ssL10nId = "webrtc-indicator-sharing-screen";
- break;
- case "Window":
- ssL10nId = "webrtc-indicator-sharing-window";
- break;
- default:
- if (ssi) {
- console.error(`Unknown showScreenSharingIndicator: ${ssi}`);
- }
- ssL10nId = "";
- }
- if (ssL10nId) {
- document.l10n.setAttributes(screenShareButton, ssL10nId);
- } else {
- screenShareButton.removeAttribute("data-l10n-id");
- screenShareButton.removeAttribute("tooltiptext");
- }
-
- // Resize and ensure the window position is correct
- // (sizeToContent messes with our position).
- window.sizeToContent();
- PositionHandler.adjustPosition();
-}
-
-function updateWindowAttr(attr, value) {
- let docEl = document.documentElement;
- if (value) {
- docEl.setAttribute(attr, "true");
- } else {
- docEl.removeAttribute(attr);
- }
-}
-
-function onPopupMenuShowing(event) {
- let popup = event.target;
-
- let activeStreams;
- if (popup.getAttribute("type") == "Devices") {
- activeStreams = webrtcUI.getActiveStreams(true, true, false);
- } else {
- activeStreams = webrtcUI.getActiveStreams(false, false, true, true);
- }
- if (activeStreams.length) {
- let index = activeStreams.length - 1;
- webrtcUI.showSharingDoorhanger(activeStreams[index], event);
- event.preventDefault();
- return;
- }
-
- for (let stream of activeStreams) {
- let item = document.createElement("menuitem");
- item.setAttribute("label", stream.browser.contentTitle || stream.uri);
- item.setAttribute("tooltiptext", stream.uri);
- item.stream = stream;
- popup.appendChild(item);
- }
-}
-
-function onPopupMenuHiding(event) {
- let popup = event.target;
- while (popup.firstChild) {
- popup.firstChild.remove();
- }
-}
-
-function onPopupMenuCommand(event) {
- webrtcUI.showSharingDoorhanger(event.target.stream, event);
-}
-
-function onFirefoxButtonClick(event) {
- event.target.blur();
- let activeStreams = webrtcUI.getActiveStreams(true, true, true, true);
- activeStreams[0].browser.ownerGlobal.focus();
-}
-
-var PositionHandler = {
- positionCustomized: false,
- threshold: 10,
- adjustPosition() {
- if (!this.positionCustomized) {
- // Center the window horizontally on the screen (not the available area).
- // Until we have moved the window to y=0, 'screen.width' may give a value
- // for a secondary screen, so use values from the screen manager instead.
- let primaryScreen = Cc["@mozilla.org/gfx/screenmanager;1"].getService(
- Ci.nsIScreenManager
- ).primaryScreen;
- let widthDevPix = {};
- primaryScreen.GetRect({}, {}, widthDevPix, {});
- let availTopDevPix = {};
- primaryScreen.GetAvailRect({}, availTopDevPix, {}, {});
- let scaleFactor = primaryScreen.defaultCSSScaleFactor;
- let widthCss = widthDevPix.value / scaleFactor;
- window.moveTo(
- (widthCss - document.documentElement.clientWidth) / 2,
- availTopDevPix.value / scaleFactor
- );
- } else {
- // This will ensure we're at y=0.
- this.setXPosition(window.screenX);
- }
- },
- setXPosition(desiredX) {
- // Ensure the indicator isn't moved outside the available area of the screen.
- desiredX = Math.max(desiredX, screen.availLeft);
- let maxX =
- screen.availLeft +
- screen.availWidth -
- document.documentElement.clientWidth;
- window.moveTo(Math.min(desiredX, maxX), screen.availTop);
- },
- handleEvent(aEvent) {
- switch (aEvent.type) {
- case "mousedown":
- if (aEvent.button != 0 || aEvent.defaultPrevented) {
- return;
- }
-
- this._startMouseX = aEvent.screenX;
- this._startWindowX = window.screenX;
- this._deltaX = this._startMouseX - this._startWindowX;
-
- window.addEventListener("mousemove", this);
- window.addEventListener("mouseup", this);
- break;
-
- case "mousemove":
- let moveOffset = Math.abs(aEvent.screenX - this._startMouseX);
- if (this._dragFullyStarted || moveOffset > this.threshold) {
- this.setXPosition(aEvent.screenX - this._deltaX);
- this._dragFullyStarted = true;
- }
- break;
-
- case "mouseup":
- this._dragFullyStarted = false;
- window.removeEventListener("mousemove", this);
- window.removeEventListener("mouseup", this);
- this.positionCustomized =
- Math.abs(this._startWindowX - window.screenX) >= this.threshold;
- break;
- }
- },
-};
diff --git a/browser/base/content/webrtcLegacyIndicator.xhtml b/browser/base/content/webrtcLegacyIndicator.xhtml
deleted file mode 100644
index ffae597af799..000000000000
--- a/browser/base/content/webrtcLegacyIndicator.xhtml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/browser/base/jar.mn b/browser/base/jar.mn
index dcbfaf7e52ac..12a6d3f15e49 100644
--- a/browser/base/jar.mn
+++ b/browser/base/jar.mn
@@ -89,10 +89,6 @@ browser.jar:
# XXX: We should exclude this one as well (bug 71895)
* content/browser/hiddenWindowMac.xhtml (content/hiddenWindowMac.xhtml)
content/browser/nonbrowser-mac.js (content/nonbrowser-mac.js)
-#endif
-#ifndef XP_MACOSX
-* content/browser/webrtcLegacyIndicator.xhtml (content/webrtcLegacyIndicator.xhtml)
- content/browser/webrtcLegacyIndicator.js (content/webrtcLegacyIndicator.js)
#endif
content/browser/webrtcIndicator.xhtml (content/webrtcIndicator.xhtml)
content/browser/webrtcIndicator.js (content/webrtcIndicator.js)
diff --git a/browser/locales/en-US/browser/webrtcIndicator.ftl b/browser/locales/en-US/browser/webrtcIndicator.ftl
index ae6077818e0d..7601a2a04b9d 100644
--- a/browser/locales/en-US/browser/webrtcIndicator.ftl
+++ b/browser/locales/en-US/browser/webrtcIndicator.ftl
@@ -6,8 +6,6 @@
## enumerate/look for window titles. It is not normally visible anywhere.
webrtc-indicator-title = { -brand-short-name } — Sharing Indicator
-webrtc-indicator-window =
- .title = { -brand-short-name } — Sharing Indicator
## Used as list items in sharing menu
@@ -59,23 +57,6 @@ webrtc-microphone-system-menu =
webrtc-screen-system-menu =
.label = You are sharing a window or a screen. Click to control sharing.
-## Tooltips used by the legacy global sharing indicator
-
-webrtc-indicator-sharing-camera-and-microphone =
- .tooltiptext = Your camera and microphone are being shared. Click to control sharing.
-webrtc-indicator-sharing-camera =
- .tooltiptext = Your camera is being shared. Click to control sharing.
-webrtc-indicator-sharing-microphone =
- .tooltiptext = Your microphone is being shared. Click to control sharing.
-webrtc-indicator-sharing-application =
- .tooltiptext = An application is being shared. Click to control sharing.
-webrtc-indicator-sharing-screen =
- .tooltiptext = Your screen is being shared. Click to control sharing.
-webrtc-indicator-sharing-window =
- .tooltiptext = A window is being shared. Click to control sharing.
-webrtc-indicator-sharing-browser =
- .tooltiptext = A tab is being shared. Click to control sharing.
-
## These strings are only used on Mac for menus attached to icons
## near the clock on the mac menubar.
## Variables:
diff --git a/browser/modules/webrtcUI.sys.mjs b/browser/modules/webrtcUI.sys.mjs
index b51346795057..6884a3143e26 100644
--- a/browser/modules/webrtcUI.sys.mjs
+++ b/browser/modules/webrtcUI.sys.mjs
@@ -1053,137 +1053,6 @@ export function showStreamSharingMenu(win, event, inclWindow = false) {
}
}
-/**
- * Controls the visibility of screen, camera and microphone sharing indicators
- * in the macOS global menu bar. This class should only ever be instantiated
- * on macOS.
- *
- * The public methods on this class intentionally match the interface for the
- * WebRTC global sharing indicator, because the MacOSWebRTCStatusbarIndicator
- * acts as the indicator when in the legacy indicator configuration.
- */
-export class MacOSWebRTCStatusbarIndicator {
- constructor() {
- this._camera = null;
- this._microphone = null;
- this._screen = null;
-
- this._hiddenDoc = Services.appShell.hiddenDOMWindow.document;
- this._statusBar = Cc["@mozilla.org/widget/systemstatusbar;1"].getService(
- Ci.nsISystemStatusBar
- );
-
- this.updateIndicatorState();
- }
-
- /**
- * Public method that will determine the most appropriate
- * set of indicators to show, and then show them or hide
- * them as necessary.
- */
- updateIndicatorState() {
- this._setIndicatorState("Camera", webrtcUI.showCameraIndicator);
- this._setIndicatorState("Microphone", webrtcUI.showMicrophoneIndicator);
- this._setIndicatorState("Screen", webrtcUI.showScreenSharingIndicator);
- }
-
- /**
- * Public method that will hide all indicators.
- */
- close() {
- this._setIndicatorState("Camera", false);
- this._setIndicatorState("Microphone", false);
- this._setIndicatorState("Screen", false);
- }
-
- handleEvent(event) {
- switch (event.type) {
- case "popupshowing": {
- this._popupShowing(event);
- break;
- }
- case "popuphiding": {
- this._popupHiding(event);
- break;
- }
- case "command": {
- this._command(event);
- break;
- }
- }
- }
-
- /**
- * Handler for command events fired by the