mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 06:45:42 +00:00
Bug 801068 - Add a "Don't Share" option for camera and microphone access requests; don't deny the request when dismissing the popup notification. r=anant
This commit is contained in:
parent
b434b489db
commit
96dc1b605f
@ -435,3 +435,5 @@ getUserMedia.shareSpecificMicrophone.label = Share Microphone: %S
|
||||
getUserMedia.shareCameraAndMicrophone.message = Would you like to share your camera and microphone with %S?
|
||||
getUserMedia.shareCameraAndMicrophone.label = Share Camera and Microphone
|
||||
getUserMedia.shareCameraAndMicrophone.accesskey = S
|
||||
getUserMedia.denyRequest.label = Don't Share
|
||||
getUserMedia.denyRequest.accesskey = D
|
||||
|
@ -77,14 +77,11 @@ function prompt(aBrowser, aCallID, aAudioRequested, aVideoRequested, aDevices) {
|
||||
let message = stringBundle.getFormattedString("getUserMedia." + requestType + ".message",
|
||||
[ host ]);
|
||||
|
||||
let responseSent = false;
|
||||
|
||||
let mainAction = {
|
||||
label: stringBundle.getString("getUserMedia." + requestType + ".label"),
|
||||
accessKey: stringBundle.getString("getUserMedia." + requestType + ".accesskey"),
|
||||
callback: function () {
|
||||
Services.obs.notifyObservers(null, "getUserMedia:response:allow", aCallID);
|
||||
responseSent = true;
|
||||
}
|
||||
};
|
||||
|
||||
@ -103,18 +100,19 @@ function prompt(aBrowser, aCallID, aAudioRequested, aVideoRequested, aDevices) {
|
||||
accessKey: selectableDeviceNumber,
|
||||
callback: function () {
|
||||
Services.obs.notifyObservers(device, "getUserMedia:response:allow", aCallID);
|
||||
responseSent = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
secondaryActions.push({
|
||||
label: stringBundle.getString("getUserMedia.denyRequest.label"),
|
||||
accessKey: stringBundle.getString("getUserMedia.denyRequest.accesskey"),
|
||||
callback: function () {
|
||||
Services.obs.notifyObservers(null, "getUserMedia:response:deny", aCallID);
|
||||
}
|
||||
});
|
||||
|
||||
let options = {
|
||||
removeOnDismissal: true,
|
||||
eventCallback: function (aType) {
|
||||
if (!responseSent && aType == "removed")
|
||||
Services.obs.notifyObservers(null, "getUserMedia:response:deny", aCallID);
|
||||
}
|
||||
};
|
||||
|
||||
chromeWin.PopupNotifications.show(aBrowser, "webRTC-shareDevices", message,
|
||||
|
Loading…
Reference in New Issue
Block a user