mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 14:55:47 +00:00
Backed out changeset c120dd831b3f (bug 734323) r=bustage
This commit is contained in:
parent
3e437af1bc
commit
16b7178979
@ -1456,9 +1456,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 = {
|
||||
@ -1766,7 +1763,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)
|
||||
@ -1889,20 +1885,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;
|
||||
}
|
||||
|
||||
@ -1913,10 +1903,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;
|
||||
}
|
||||
@ -1977,11 +1964,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",
|
||||
@ -3867,7 +3849,6 @@ var ClipboardHelper = {
|
||||
|
||||
var PluginHelper = {
|
||||
showDoorHanger: function(aTab) {
|
||||
aTab.clickToPlayPluginDoorhangerShown = true;
|
||||
let message = Strings.browser.GetStringFromName("clickToPlayPlugins.message");
|
||||
let buttons = [
|
||||
{
|
||||
@ -3894,13 +3875,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