mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 15:55:36 +00:00
Backed out changeset 1db5409ea062 (bug 1037430) for dt orange on a CLOSED TREE
This commit is contained in:
parent
df4be1aa83
commit
d1342c1421
@ -135,10 +135,8 @@ browser.jar:
|
||||
* content/browser/softwareUpdateOverlay.xul (content/softwareUpdateOverlay.xul)
|
||||
#endif
|
||||
* content/browser/viewSourceOverlay.xul (content/viewSourceOverlay.xul)
|
||||
#ifndef XP_MACOSX
|
||||
* content/browser/webrtcIndicator.xul (content/webrtcIndicator.xul)
|
||||
content/browser/webrtcIndicator.js (content/webrtcIndicator.js)
|
||||
#endif
|
||||
#ifdef XP_WIN
|
||||
content/browser/win6BrowserOverlay.xul (content/win6BrowserOverlay.xul)
|
||||
#endif
|
||||
|
@ -14,24 +14,3 @@ webrtcIndicator.sharingCamera.tooltip = Your camera is being shared
|
||||
webrtcIndicator.sharingMicrophone.tooltip = Your microphone is being shared. Click to control sharing.
|
||||
webrtcIndicator.sharingScreen.tooltip = Your screen is being shared. Click to control sharing.
|
||||
webrtcIndicator.sharingWindow.tooltip = A window is being shared. Click to control sharing.
|
||||
|
||||
|
||||
# LOCALIZATION NOTE : The following strings are only used on Mac for
|
||||
# menus attached to icons near the clock on the mac menubar.
|
||||
|
||||
# LOCALIZATION NOTE (webrtcIndicator.sharing*With.menuitem):
|
||||
# %S is the title of the tab using the share.
|
||||
webrtcIndicator.sharingCameraWith.menuitem = Sharing Camera with "%S"
|
||||
webrtcIndicator.sharingMicrophoneWith.menuitem = Sharing Microphone with "%S"
|
||||
webrtcIndicator.sharingScreenWith.menuitem = Sharing Screen with "%S"
|
||||
webrtcIndicator.sharingWindowWith.menuitem = Sharing a Window with "%S"
|
||||
webrtcIndicator.controlSharing.menuitem = Control Sharing
|
||||
# LOCALIZATION NOTE (webrtcIndicator.sharing*WithNTabs.menuitem):
|
||||
# Semicolon-separated list of plural forms.
|
||||
webrtcIndicator.sharingCameraWithNTabs.menuitem = Sharing Camera with #1 tab;Sharing Camera with #1 tabs
|
||||
webrtcIndicator.sharingMicrophoneWithNTabs.menuitem = Sharing Microphone with #1 tab;Sharing Microphone with #1 tabs
|
||||
webrtcIndicator.sharingScreenWithNTabs.menuitem = Sharing Screen with #1 tab;Sharing Screen with #1 tabs
|
||||
webrtcIndicator.sharingWindowWithNTabs.menuitem = Sharing a Window with #1 tab;Sharing Windows with #1 tabs
|
||||
# LOCALIZATION NOTE (webrtcIndicator.controlSharingOn.menuitem):
|
||||
# %S is the title of the tab using the share.
|
||||
webrtcIndicator.controlSharingOn.menuitem = Control Sharing on "%S"
|
||||
|
@ -24,6 +24,7 @@ EXTRA_JS_MODULES += [
|
||||
'Social.jsm',
|
||||
'TabCrashReporter.jsm',
|
||||
'WebappManager.jsm',
|
||||
'webrtcUI.jsm',
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||
@ -42,7 +43,6 @@ EXTRA_PP_JS_MODULES += [
|
||||
'AboutHome.jsm',
|
||||
'RecentWindow.jsm',
|
||||
'UITour.jsm',
|
||||
'webrtcUI.jsm',
|
||||
]
|
||||
|
||||
if CONFIG['MOZILLA_OFFICIAL']:
|
||||
|
@ -13,6 +13,8 @@ const Ci = Components.interfaces;
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
const INDICATOR_CHROME_URI = "chrome://browser/content/webrtcIndicator.xul";
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
|
||||
"resource://gre/modules/PluralForm.jsm");
|
||||
|
||||
@ -416,138 +418,6 @@ function prompt(aContentWindow, aCallID, aAudio, aVideo, aDevices, aSecure) {
|
||||
anchorId, mainAction, secondaryActions, options);
|
||||
}
|
||||
|
||||
function getGlobalIndicator() {
|
||||
#ifndef XP_MACOSX
|
||||
const INDICATOR_CHROME_URI = "chrome://browser/content/webrtcIndicator.xul";
|
||||
const features = "chrome,dialog=yes,titlebar=no,popup=yes";
|
||||
|
||||
return Services.ww.openWindow(null, INDICATOR_CHROME_URI, "_blank", features, []);
|
||||
#else
|
||||
let indicator = {
|
||||
_camera: null,
|
||||
_microphone: null,
|
||||
_screen: null,
|
||||
|
||||
_hiddenDoc: Cc["@mozilla.org/appshell/appShellService;1"]
|
||||
.getService(Ci.nsIAppShellService)
|
||||
.hiddenDOMWindow.document,
|
||||
_statusBar: Cc["@mozilla.org/widget/macsystemstatusbar;1"]
|
||||
.getService(Ci.nsISystemStatusBar),
|
||||
|
||||
_command: function(aEvent) {
|
||||
let type = this.getAttribute("type");
|
||||
if (type == "Camera" || type == "Microphone")
|
||||
type = "Devices";
|
||||
else if (type == "Window")
|
||||
type = "Screen";
|
||||
webrtcUI.showSharingDoorhanger(aEvent.target.stream, type);
|
||||
},
|
||||
|
||||
_popupShowing: function(aEvent) {
|
||||
let type = this.getAttribute("type");
|
||||
let activeStreams;
|
||||
if (type == "Camera") {
|
||||
activeStreams = webrtcUI.getActiveStreams(true, false, false);
|
||||
}
|
||||
else if (type == "Microphone") {
|
||||
activeStreams = webrtcUI.getActiveStreams(false, true, false);
|
||||
}
|
||||
else if (type == "Screen") {
|
||||
activeStreams = webrtcUI.getActiveStreams(false, false, true);
|
||||
type = webrtcUI.showScreenSharingIndicator;
|
||||
}
|
||||
|
||||
let bundle =
|
||||
Services.strings.createBundle("chrome://browser/locale/webrtcIndicator.properties");
|
||||
|
||||
if (activeStreams.length == 1) {
|
||||
let stream = activeStreams[0];
|
||||
|
||||
let menuitem = this.ownerDocument.createElement("menuitem");
|
||||
let labelId = "webrtcIndicator.sharing" + type + "With.menuitem";
|
||||
let label = stream.browser.contentTitle || stream.uri;
|
||||
menuitem.setAttribute("label", bundle.formatStringFromName(labelId, [label], 1));
|
||||
menuitem.setAttribute("disabled", "true");
|
||||
this.appendChild(menuitem);
|
||||
|
||||
menuitem = this.ownerDocument.createElement("menuitem");
|
||||
menuitem.setAttribute("label",
|
||||
bundle.GetStringFromName("webrtcIndicator.controlSharing.menuitem"));
|
||||
menuitem.setAttribute("type", type);
|
||||
menuitem.stream = stream;
|
||||
menuitem.addEventListener("command", indicator._command);
|
||||
|
||||
this.appendChild(menuitem);
|
||||
return true;
|
||||
}
|
||||
|
||||
// We show a different menu when there are several active streams.
|
||||
let menuitem = this.ownerDocument.createElement("menuitem");
|
||||
let labelId = "webrtcIndicator.sharing" + type + "WithNTabs.menuitem";
|
||||
let count = activeStreams.length;
|
||||
let label = PluralForm.get(count, bundle.GetStringFromName(labelId)).replace("#1", count);
|
||||
menuitem.setAttribute("label", label);
|
||||
menuitem.setAttribute("disabled", "true");
|
||||
this.appendChild(menuitem);
|
||||
|
||||
for (let stream of activeStreams) {
|
||||
let item = this.ownerDocument.createElement("menuitem");
|
||||
let labelId = "webrtcIndicator.controlSharingOn.menuitem";
|
||||
let label = stream.browser.contentTitle || stream.uri;
|
||||
item.setAttribute("label", bundle.formatStringFromName(labelId, [label], 1));
|
||||
item.setAttribute("type", type);
|
||||
item.stream = stream;
|
||||
item.addEventListener("command", indicator._command);
|
||||
this.appendChild(item);
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
_popupHiding: function(aEvent) {
|
||||
while (this.firstChild)
|
||||
this.firstChild.remove();
|
||||
},
|
||||
|
||||
_setIndicatorState: function(aName, aState) {
|
||||
let field = "_" + aName.toLowerCase();
|
||||
if (aState && !this[field]) {
|
||||
let menu = this._hiddenDoc.createElement("menu");
|
||||
let uri = "chrome://browser/skin/webRTC-" + aName.toLowerCase() + "-black-16.png";
|
||||
menu.setAttribute("image", uri);
|
||||
this._statusBar.addItem(menu);
|
||||
|
||||
let menupopup = this._hiddenDoc.createElement("menupopup");
|
||||
menupopup.setAttribute("type", aName);
|
||||
menupopup.addEventListener("popupshowing", this._popupShowing);
|
||||
menupopup.addEventListener("popuphiding", this._popupHiding);
|
||||
menupopup.addEventListener("command", this._command);
|
||||
menu.appendChild(menupopup);
|
||||
|
||||
this[field] = menu;
|
||||
}
|
||||
else if (this[field] && !aState) {
|
||||
this._statusBar.removeItem(this[field]);
|
||||
this[field] = null
|
||||
}
|
||||
},
|
||||
updateIndicatorState: function() {
|
||||
this._setIndicatorState("Camera", webrtcUI.showCameraIndicator);
|
||||
this._setIndicatorState("Microphone", webrtcUI.showMicrophoneIndicator);
|
||||
this._setIndicatorState("Screen", webrtcUI.showScreenSharingIndicator);
|
||||
},
|
||||
close: function() {
|
||||
this._setIndicatorState("Camera", false);
|
||||
this._setIndicatorState("Microphone", false);
|
||||
this._setIndicatorState("Screen", false);
|
||||
}
|
||||
};
|
||||
|
||||
indicator.updateIndicatorState();
|
||||
return indicator;
|
||||
#endif
|
||||
}
|
||||
|
||||
var gIndicatorWindow = null;
|
||||
|
||||
function updateIndicators() {
|
||||
@ -582,10 +452,13 @@ function updateIndicators() {
|
||||
}
|
||||
|
||||
if (webrtcUI.showGlobalIndicator) {
|
||||
if (!gIndicatorWindow)
|
||||
gIndicatorWindow = getGlobalIndicator();
|
||||
else
|
||||
if (!gIndicatorWindow) {
|
||||
const features = "chrome,dialog=yes,titlebar=no,popup=yes";
|
||||
gIndicatorWindow = Services.ww.openWindow(null, INDICATOR_CHROME_URI, "_blank",
|
||||
features, []);
|
||||
} else {
|
||||
gIndicatorWindow.updateIndicatorState();
|
||||
}
|
||||
} else if (gIndicatorWindow) {
|
||||
gIndicatorWindow.close();
|
||||
gIndicatorWindow = null;
|
||||
|
@ -77,7 +77,7 @@ browser.jar:
|
||||
skin/classic/browser/webRTC-shareScreen-16.png (../shared/webrtc/webRTC-shareScreen-16.png)
|
||||
skin/classic/browser/webRTC-shareScreen-64.png (../shared/webrtc/webRTC-shareScreen-64.png)
|
||||
skin/classic/browser/webRTC-sharingScreen-16.png (../shared/webrtc/webRTC-sharingScreen-16.png)
|
||||
skin/classic/browser/webRTC-indicator.css (../shared/webrtc/indicator.css)
|
||||
* skin/classic/browser/webRTC-indicator.css (../shared/webrtc/indicator.css)
|
||||
skin/classic/browser/webRTC-camera-white-16.png (../shared/webrtc/camera-white-16.png)
|
||||
skin/classic/browser/webRTC-microphone-white-16.png (../shared/webrtc/microphone-white-16.png)
|
||||
skin/classic/browser/webRTC-screen-white-16.png (../shared/webrtc/screen-white-16.png)
|
||||
|
@ -131,9 +131,13 @@ browser.jar:
|
||||
skin/classic/browser/webRTC-shareScreen-64@2x.png (../shared/webrtc/webRTC-shareScreen-64@2x.png)
|
||||
skin/classic/browser/webRTC-sharingScreen-16.png (../shared/webrtc/webRTC-sharingScreen-16.png)
|
||||
skin/classic/browser/webRTC-sharingScreen-16@2x.png (../shared/webrtc/webRTC-sharingScreen-16@2x.png)
|
||||
skin/classic/browser/webRTC-camera-black-16.png
|
||||
skin/classic/browser/webRTC-microphone-black-16.png
|
||||
skin/classic/browser/webRTC-screen-black-16.png
|
||||
* skin/classic/browser/webRTC-indicator.css (../shared/webrtc/indicator.css)
|
||||
skin/classic/browser/webRTC-camera-white-16.png (../shared/webrtc/camera-white-16.png)
|
||||
skin/classic/browser/webRTC-camera-white-16@2x.png (../shared/webrtc/camera-white-16@2x.png)
|
||||
skin/classic/browser/webRTC-microphone-white-16.png (../shared/webrtc/microphone-white-16.png)
|
||||
skin/classic/browser/webRTC-microphone-white-16@2x.png (../shared/webrtc/microphone-white-16@2x.png)
|
||||
skin/classic/browser/webRTC-screen-white-16.png (../shared/webrtc/screen-white-16.png)
|
||||
skin/classic/browser/webRTC-screen-white-16@2x.png (../shared/webrtc/screen-white-16@2x.png)
|
||||
skin/classic/browser/customizableui/background-noise-toolbar.png (customizableui/background-noise-toolbar.png)
|
||||
skin/classic/browser/customizableui/customize-titleBar-toggle.png (customizableui/customize-titleBar-toggle.png)
|
||||
skin/classic/browser/customizableui/customize-titleBar-toggle@2x.png (customizableui/customize-titleBar-toggle@2x.png)
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 15 KiB |
Binary file not shown.
Before Width: | Height: | Size: 15 KiB |
Binary file not shown.
Before Width: | Height: | Size: 15 KiB |
@ -109,3 +109,21 @@ window[sharingscreen][sharingvideo] > #shareSeparator,
|
||||
window[sharingscreen][sharingaudio] > #shareSeparator {
|
||||
display: -moz-box;
|
||||
}
|
||||
|
||||
%ifdef XP_MACOSX
|
||||
@media (min-resolution: 2dppx) {
|
||||
window[sharingvideo] > #audioVideoButton {
|
||||
background-image: url("webRTC-camera-white-16@2x.png");
|
||||
}
|
||||
|
||||
window[sharingaudio] > #audioVideoButton {
|
||||
background-image: url("webRTC-microphone-white-16@2x.png");
|
||||
}
|
||||
|
||||
/* Multi-icon button: */
|
||||
window[sharingaudio][sharingvideo] > #audioVideoButton {
|
||||
background-image: url("webRTC-camera-white-16@2x.png"),
|
||||
url("webRTC-microphone-white-16@2x.png");
|
||||
}
|
||||
}
|
||||
%endif
|
||||
|
@ -98,7 +98,7 @@ browser.jar:
|
||||
skin/classic/browser/webRTC-shareScreen-16.png (../shared/webrtc/webRTC-shareScreen-16.png)
|
||||
skin/classic/browser/webRTC-shareScreen-64.png (../shared/webrtc/webRTC-shareScreen-64.png)
|
||||
skin/classic/browser/webRTC-sharingScreen-16.png (../shared/webrtc/webRTC-sharingScreen-16.png)
|
||||
skin/classic/browser/webRTC-indicator.css (../shared/webrtc/indicator.css)
|
||||
* skin/classic/browser/webRTC-indicator.css (../shared/webrtc/indicator.css)
|
||||
skin/classic/browser/webRTC-camera-white-16.png (../shared/webrtc/camera-white-16.png)
|
||||
skin/classic/browser/webRTC-microphone-white-16.png (../shared/webrtc/microphone-white-16.png)
|
||||
skin/classic/browser/webRTC-screen-white-16.png (../shared/webrtc/screen-white-16.png)
|
||||
@ -514,7 +514,7 @@ browser.jar:
|
||||
skin/classic/aero/browser/webRTC-shareScreen-16.png (../shared/webrtc/webRTC-shareScreen-16.png)
|
||||
skin/classic/aero/browser/webRTC-shareScreen-64.png (../shared/webrtc/webRTC-shareScreen-64.png)
|
||||
skin/classic/aero/browser/webRTC-sharingScreen-16.png (../shared/webrtc/webRTC-sharingScreen-16.png)
|
||||
skin/classic/aero/browser/webRTC-indicator.css (../shared/webrtc/indicator.css)
|
||||
* skin/classic/aero/browser/webRTC-indicator.css (../shared/webrtc/indicator.css)
|
||||
skin/classic/aero/browser/webRTC-camera-white-16.png (../shared/webrtc/camera-white-16.png)
|
||||
skin/classic/aero/browser/webRTC-microphone-white-16.png (../shared/webrtc/microphone-white-16.png)
|
||||
skin/classic/aero/browser/webRTC-screen-white-16.png (../shared/webrtc/screen-white-16.png)
|
||||
|
Loading…
Reference in New Issue
Block a user