mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-08 20:47:44 +00:00
Backed out changeset 29529018c1da (bug 734323)
This commit is contained in:
parent
308b47322a
commit
380e3eaa21
@ -1465,9 +1465,6 @@ function Tab(aURL, aParams) {
|
||||
this._zoom = 1.0;
|
||||
this.userScrollPos = { x: 0, y: 0 };
|
||||
this.contentDocumentIsDisplayed = true;
|
||||
this.clickToPlayPluginDoorhangerShown = false;
|
||||
this.clickToPlayPluginsActivated = false;
|
||||
this.loadEventProcessed = false;
|
||||
}
|
||||
|
||||
Tab.prototype = {
|
||||
@ -1796,7 +1793,6 @@ Tab.prototype = {
|
||||
}
|
||||
|
||||
case "load": {
|
||||
this.loadEventProcessed = true;
|
||||
// Show a plugin doorhanger if there are no clickable overlays showing
|
||||
let contentWindow = this.browser.contentWindow;
|
||||
let cwu = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
@ -1919,20 +1915,14 @@ Tab.prototype = {
|
||||
|
||||
case "PluginClickToPlay": {
|
||||
let plugin = aEvent.target;
|
||||
|
||||
if (this.clickToPlayPluginsActivated) {
|
||||
PluginHelper.playPlugin(plugin);
|
||||
let overlay = plugin.ownerDocument.getAnonymousElementByAttribute(plugin, "class", "mainBox");
|
||||
if (!overlay)
|
||||
return;
|
||||
}
|
||||
|
||||
// If the overlay is too small, hide the overlay and act like this
|
||||
// is a hidden plugin object
|
||||
let overlay = plugin.ownerDocument.getAnonymousElementByAttribute(plugin, "class", "mainBox");
|
||||
if (!overlay || PluginHelper.isTooSmall(plugin, overlay)) {
|
||||
if (overlay)
|
||||
overlay.style.visibility = "hidden";
|
||||
if (this.loadEventProcessed && !this.clickToPlayPluginDoorhangerShown)
|
||||
PluginHelper.showDoorHanger(this);
|
||||
if (PluginHelper.isTooSmall(plugin, overlay)) {
|
||||
overlay.style.visibility = "hidden";
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1943,10 +1933,7 @@ Tab.prototype = {
|
||||
return;
|
||||
e.preventDefault();
|
||||
}
|
||||
let win = e.target.ownerDocument.defaultView.top;
|
||||
let tab = BrowserApp.getTabForWindow(win);
|
||||
tab.clickToPlayPluginsActivated = true;
|
||||
PluginHelper.playAllPlugins(win);
|
||||
PluginHelper.playAllPlugins(e.target.ownerDocument.defaultView);
|
||||
}, true);
|
||||
break;
|
||||
}
|
||||
@ -2007,11 +1994,6 @@ Tab.prototype = {
|
||||
contentType = browser.contentDocument.contentType;
|
||||
}
|
||||
|
||||
// Reset state of click-to-play plugin notifications.
|
||||
this.clickToPlayPluginDoorhangerShown = false;
|
||||
this.clickToPlayPluginsActivated = false;
|
||||
this.loadEventProcessed = false;
|
||||
|
||||
let message = {
|
||||
gecko: {
|
||||
type: "Content:LocationChange",
|
||||
@ -3920,7 +3902,6 @@ var ClipboardHelper = {
|
||||
|
||||
var PluginHelper = {
|
||||
showDoorHanger: function(aTab) {
|
||||
aTab.clickToPlayPluginDoorhangerShown = true;
|
||||
let message = Strings.browser.GetStringFromName("clickToPlayPlugins.message");
|
||||
let buttons = [
|
||||
{
|
||||
@ -3947,13 +3928,11 @@ var PluginHelper = {
|
||||
if (!plugins || !plugins.length)
|
||||
return;
|
||||
|
||||
plugins.forEach(this.playPlugin);
|
||||
},
|
||||
|
||||
playPlugin: function(plugin) {
|
||||
let objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
if (!objLoadingContent.activated)
|
||||
objLoadingContent.playPlugin();
|
||||
for (let plugin of plugins) {
|
||||
let objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
if (!objLoadingContent.activated)
|
||||
objLoadingContent.playPlugin();
|
||||
}
|
||||
},
|
||||
|
||||
getPluginPreference: function getPluginPreference() {
|
||||
|
Loading…
Reference in New Issue
Block a user