mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 871931 support non-tab browsers in usermedia/camera toolbarbutton, r=dao
This commit is contained in:
parent
4e9196b791
commit
6575602183
@ -44,9 +44,12 @@ let WebrtcIndicator = {
|
||||
if (!streamData)
|
||||
return;
|
||||
|
||||
let tab = streamData.tab;
|
||||
let browserWindow = tab.ownerDocument.defaultView;
|
||||
browserWindow.gBrowser.selectedTab = tab;
|
||||
let browserWindow = streamData.browser.ownerDocument.defaultView;
|
||||
if (streamData.tab) {
|
||||
browserWindow.gBrowser.selectedTab = streamData.tab;
|
||||
} else {
|
||||
streamData.browser.focus();
|
||||
}
|
||||
browserWindow.focus();
|
||||
}
|
||||
}
|
||||
|
@ -39,19 +39,16 @@ this.webrtcUI = {
|
||||
let activeStreams = [];
|
||||
for (let i = 0; i < count; i++) {
|
||||
let contentWindow = contentWindowSupportsArray.GetElementAt(i);
|
||||
let browserWindow = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShell)
|
||||
.chromeEventHandler.ownerDocument.defaultView;
|
||||
let browser = getBrowserForWindow(contentWindow);
|
||||
let browserWindow = browser.ownerDocument.defaultView;
|
||||
let tab = browserWindow.gBrowser &&
|
||||
browserWindow.gBrowser._getTabForContentWindow(contentWindow.top);
|
||||
if (tab) {
|
||||
activeStreams.push({
|
||||
uri: contentWindow.location.href,
|
||||
tab: tab
|
||||
tab: tab,
|
||||
browser: browser
|
||||
});
|
||||
}
|
||||
}
|
||||
return activeStreams;
|
||||
}
|
||||
}
|
||||
@ -212,8 +209,8 @@ function updateIndicators() {
|
||||
while (e.hasMoreElements())
|
||||
e.getNext().WebrtcIndicator.updateButton();
|
||||
|
||||
for (let {tab: tab} of webrtcUI.activeStreams)
|
||||
showBrowserSpecificIndicator(tab.linkedBrowser);
|
||||
for (let {browser: browser} of webrtcUI.activeStreams)
|
||||
showBrowserSpecificIndicator(browser);
|
||||
}
|
||||
|
||||
function showBrowserSpecificIndicator(aBrowser) {
|
||||
|
Loading…
Reference in New Issue
Block a user