backout c86023072076 because of talos fail

This commit is contained in:
Margaret Leibovic 2012-03-28 16:18:11 -07:00
parent 578f9dac0c
commit be8b25fda1
2 changed files with 8 additions and 50 deletions

View File

@ -3925,54 +3925,23 @@ var ClipboardHelper = {
var PluginHelper = {
showDoorHanger: function(aTab) {
if (!aTab.browser)
return;
// Even though we may not end up showing a doorhanger, this flag
// lets us know that we've tried to show a doorhanger.
aTab.clickToPlayPluginDoorhangerShown = true;
let uri = aTab.browser.currentURI;
// If the user has previously set a plugins permission for this website,
// either play or don't play the plugins instead of showing a doorhanger.
let permValue = Services.perms.testPermission(uri, "plugins");
if (permValue != Services.perms.UNKNOWN_ACTION) {
if (permValue == Services.perms.ALLOW_ACTION)
PluginHelper.playAllPlugins(aTab.browser.contentWindow);
return;
}
let message = Strings.browser.formatStringFromName("clickToPlayPlugins.message1",
[uri.host], 1);
let message = Strings.browser.GetStringFromName("clickToPlayPlugins.message");
let buttons = [
{
label: Strings.browser.GetStringFromName("clickToPlayPlugins.yes"),
callback: function(aChecked) {
// If the user checked "Don't ask again", make a permanent exception
if (aChecked)
Services.perms.add(uri, "plugins", Ci.nsIPermissionManager.ALLOW_ACTION);
callback: function() {
PluginHelper.playAllPlugins(aTab.browser.contentWindow);
}
},
{
label: Strings.browser.GetStringFromName("clickToPlayPlugins.no"),
callback: function(aChecked) {
// If the user checked "Don't ask again", make a permanent exception
if (aChecked)
Services.perms.add(uri, "plugins", Ci.nsIPermissionManager.DENY_ACTION);
// Other than that, do nothing
callback: function() {
// Do nothing
}
}
];
// Add a checkbox with a "Don't ask again" message
let options = { checkbox: Strings.browser.GetStringFromName("clickToPlayPlugins.dontAskAgain") };
NativeWindow.doorhanger.show(message, "ask-to-play-plugins", buttons, aTab.id, options);
]
NativeWindow.doorhanger.show(message, "ask-to-play-plugins", buttons, aTab.id);
},
playAllPlugins: function(aContentWindow) {
@ -4034,7 +4003,7 @@ var PluginHelper = {
var PermissionsHelper = {
_permissonTypes: ["password", "geolocation", "popup", "indexedDB",
"offline-app", "desktop-notification", "plugins"],
"offline-app", "desktop-notification"],
_permissionStrings: {
"password": {
label: "password.rememberPassword",
@ -4065,11 +4034,6 @@ var PermissionsHelper = {
label: "desktopNotification.useNotifications",
allowed: "desktopNotification.allow",
denied: "desktopNotification.dontAllow"
},
"plugins": {
label: "clickToPlayPlugins.playPlugins",
allowed: "clickToPlayPlugins.yes",
denied: "clickToPlayPlugins.no"
}
},

View File

@ -229,15 +229,9 @@ timer.end=%1$S: %2$Sms
webapps.installTitle=Install Application
# Click to play plugins
clickToPlayPlugins.message1=%S contains plugin content. Would you like to play it?
clickToPlayPlugins.message=This page contains plugin content. Would you like to play it?
clickToPlayPlugins.yes=Yes
clickToPlayPlugins.no=No
# LOCALIZATION NOTE (clickToPlayPlugins.dontAskAgain): This label appears next to a
# checkbox to indicate whether or not the user wants to make a permanent decision.
clickToPlayPlugins.dontAskAgain=Don't ask again for this site
# LOCALIZATION NOTE (clickToPlayPlugins.playPlugins): Label that
# will be used in site settings dialog.
clickToPlayPlugins.playPlugins=Play Plugins
# Site settings dialog
# LOCALIZATION NOTE (siteSettings.labelToValue): This string will be used to