Bug 1645632 - Include webrtc window streams when handling webrtcLegacyIndicator click. r=johannh, a=jcristau
authorpbz <pbz@mozilla.com>
Thu, 18 Jun 2020 11:42:05 +0000
changeset 600879 d13ca4469f459b3c0428d07f5cb36187a6d6b874
parent 600878 2921a9fe2aeb34ee2ea604efc54dc8e10cb77061
child 600880 129695dde6e776ad7c854ae18212644ca6724589
push id2364
push userjcristau@mozilla.com
push dateThu, 25 Jun 2020 15:29:58 +0000
treeherdermozilla-release@52486654c09a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh, jcristau
bugs1645632, 1636207
milestone78.0
Bug 1645632 - Include webrtc window streams when handling webrtcLegacyIndicator click. r=johannh, a=jcristau Bug 1636207 updated webrtcUI.getActiveStreams to support getting window streams. This updates the call sites in the legacy webrtc indicator, so we get all streams. In the affected call sites the streams are used to find and focus the parent window and show the permissions doorhanger. Differential Revision: https://phabricator.services.mozilla.com/D80030
browser/base/content/webrtcLegacyIndicator.js
--- a/browser/base/content/webrtcLegacyIndicator.js
+++ b/browser/base/content/webrtcLegacyIndicator.js
@@ -103,17 +103,17 @@ function updateWindowAttr(attr, value) {
 
 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);
+    activeStreams = webrtcUI.getActiveStreams(false, false, true, true);
   }
   if (activeStreams.length) {
     let index = activeStreams.length - 1;
     webrtcUI.showSharingDoorhanger(activeStreams[index]);
     event.preventDefault();
     return;
   }
 
@@ -134,17 +134,17 @@ function onPopupMenuHiding(event) {
 }
 
 function onPopupMenuCommand(event) {
   webrtcUI.showSharingDoorhanger(event.target.stream);
 }
 
 function onFirefoxButtonClick(event) {
   event.target.blur();
-  let activeStreams = webrtcUI.getActiveStreams(true, true, true);
+  let activeStreams = webrtcUI.getActiveStreams(true, true, true, true);
   activeStreams[0].browser.ownerGlobal.focus();
 }
 
 var PositionHandler = {
   positionCustomized: false,
   threshold: 10,
   adjustPosition() {
     if (!this.positionCustomized) {