mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1051855 - window sharing indicator on the URL bar stays on after stream.stop has been called, r=Gijs.
This commit is contained in:
parent
60d0603045
commit
018dbc7842
@ -690,7 +690,7 @@ function updateIndicators() {
|
||||
else if (window.value && !webrtcUI.showScreenSharingIndicator)
|
||||
webrtcUI.showScreenSharingIndicator = "Window";
|
||||
|
||||
showBrowserSpecificIndicator(getBrowserForWindow(contentWindow));
|
||||
updateBrowserSpecificIndicator(getBrowserForWindow(contentWindow));
|
||||
}
|
||||
|
||||
let browserWindowEnum = Services.wm.getEnumerator("navigator:browser");
|
||||
@ -724,7 +724,7 @@ function updateIndicators() {
|
||||
}
|
||||
}
|
||||
|
||||
function showBrowserSpecificIndicator(aBrowser) {
|
||||
function updateBrowserSpecificIndicator(aBrowser) {
|
||||
let camera = {}, microphone = {}, screen = {}, window = {};
|
||||
MediaManagerService.mediaCaptureWindowState(aBrowser.contentWindow,
|
||||
camera, microphone, screen, window);
|
||||
@ -735,9 +735,6 @@ function showBrowserSpecificIndicator(aBrowser) {
|
||||
captureState = "Camera";
|
||||
} else if (microphone.value) {
|
||||
captureState = "Microphone";
|
||||
} else if (!screen.value && !window.value) {
|
||||
Cu.reportError("showBrowserSpecificIndicator: got neither video nor audio access");
|
||||
return;
|
||||
}
|
||||
|
||||
let chromeWin = aBrowser.ownerDocument.defaultView;
|
||||
@ -796,10 +793,15 @@ function showBrowserSpecificIndicator(aBrowser) {
|
||||
chromeWin.PopupNotifications.show(aBrowser, "webRTC-sharingDevices", message,
|
||||
anchorId, mainAction, secondaryActions, options);
|
||||
}
|
||||
else {
|
||||
removeBrowserNotification(aBrowser,"webRTC-sharingDevices");
|
||||
}
|
||||
|
||||
// Now handle the screen sharing indicator.
|
||||
if (!screen.value && !window.value)
|
||||
if (!screen.value && !window.value) {
|
||||
removeBrowserNotification(aBrowser,"webRTC-sharingScreen");
|
||||
return;
|
||||
}
|
||||
|
||||
options = {
|
||||
hideNotNow: true,
|
||||
@ -820,15 +822,14 @@ function showBrowserSpecificIndicator(aBrowser) {
|
||||
mainAction, secondaryActions, options);
|
||||
}
|
||||
|
||||
function removeBrowserSpecificIndicator(aSubject, aTopic, aData) {
|
||||
let browser = getBrowserForWindowId(aData);
|
||||
let PopupNotifications = browser.ownerDocument.defaultView.PopupNotifications;
|
||||
if (!PopupNotifications)
|
||||
return;
|
||||
|
||||
for (let notifId of ["webRTC-sharingDevices", "webRTC-sharingScreen"]) {
|
||||
let notification = PopupNotifications.getNotification(notifId, browser);
|
||||
if (notification)
|
||||
PopupNotifications.remove(notification);
|
||||
}
|
||||
function removeBrowserNotification(aBrowser, aNotificationId) {
|
||||
let win = aBrowser.ownerDocument.defaultView;
|
||||
let notification =
|
||||
win.PopupNotifications.getNotification(aNotificationId, aBrowser);
|
||||
if (notification)
|
||||
win.PopupNotifications.remove(notification);
|
||||
}
|
||||
|
||||
function removeBrowserSpecificIndicator(aSubject, aTopic, aData) {
|
||||
updateBrowserSpecificIndicator(getBrowserForWindowId(aData));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user