mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out 3 changesets (bug 889480, bug 889788, bug 888908) for mochitest-bc orange.
Backed out changeset d1c616745325 (bug 889788) Backed out changeset 6fe281a19554 (bug 888908) Backed out changeset 9b855bab8073 (bug 889480)
This commit is contained in:
parent
75373a534a
commit
c11458053c
@ -217,21 +217,14 @@ var gPluginHandler = {
|
||||
},
|
||||
|
||||
handleEvent : function(event) {
|
||||
let plugin;
|
||||
let doc;
|
||||
let plugin = event.target;
|
||||
let doc = plugin.ownerDocument;
|
||||
|
||||
// We're expecting the target to be a plugin.
|
||||
if (!(plugin instanceof Ci.nsIObjectLoadingContent))
|
||||
return;
|
||||
|
||||
let eventType = event.type;
|
||||
if (eventType === "PluginRemoved") {
|
||||
doc = event.target;
|
||||
}
|
||||
else {
|
||||
plugin = event.target;
|
||||
doc = plugin.ownerDocument;
|
||||
|
||||
if (!(plugin instanceof Ci.nsIObjectLoadingContent))
|
||||
return;
|
||||
}
|
||||
|
||||
if (eventType == "PluginBindingAttached") {
|
||||
// The plugin binding fires this event when it is created.
|
||||
// As an untrusted event, ensure that this object actually has a binding
|
||||
@ -311,7 +304,6 @@ var gPluginHandler = {
|
||||
break;
|
||||
|
||||
case "PluginInstantiated":
|
||||
case "PluginRemoved":
|
||||
this._showClickToPlayNotification(browser);
|
||||
break;
|
||||
}
|
||||
@ -694,12 +686,18 @@ var gPluginHandler = {
|
||||
|
||||
switch (aNewState) {
|
||||
case "allownow":
|
||||
if (aPluginInfo.fallbackType == Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE) {
|
||||
return;
|
||||
}
|
||||
permission = Ci.nsIPermissionManager.ALLOW_ACTION;
|
||||
expireType = Ci.nsIPermissionManager.EXPIRE_SESSION;
|
||||
expireTime = Date.now() + Services.prefs.getIntPref(this.PREF_SESSION_PERSIST_MINUTES) * 60 * 1000;
|
||||
break;
|
||||
|
||||
case "allowalways":
|
||||
if (aPluginInfo.fallbackType == Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE) {
|
||||
return;
|
||||
}
|
||||
permission = Ci.nsIPermissionManager.ALLOW_ACTION;
|
||||
expireType = Ci.nsIPermissionManager.EXPIRE_TIME;
|
||||
expireTime = Date.now() +
|
||||
@ -707,28 +705,25 @@ var gPluginHandler = {
|
||||
break;
|
||||
|
||||
case "block":
|
||||
if (aPluginInfo.fallbackType != Ci.nsIObjectLoadingContent.PLUGIN_ACTIVE) {
|
||||
return;
|
||||
}
|
||||
permission = Ci.nsIPermissionManager.PROMPT_ACTION;
|
||||
expireType = Ci.nsIPermissionManager.EXPIRE_NEVER;
|
||||
expireTime = 0;
|
||||
break;
|
||||
|
||||
// In case a plugin has already been allowed in another tab, the "continue allowing" button
|
||||
// shouldn't change any permissions but should run the plugin-enablement code below.
|
||||
case "continue":
|
||||
break;
|
||||
default:
|
||||
Cu.reportError(Error("Unexpected plugin state: " + aNewState));
|
||||
return;
|
||||
}
|
||||
|
||||
let browser = aNotification.browser;
|
||||
if (aNewState != "continue") {
|
||||
Services.perms.add(browser.currentURI, aPluginInfo.permissionString,
|
||||
permission, expireType, expireTime);
|
||||
Services.perms.add(browser.currentURI, aPluginInfo.permissionString,
|
||||
permission, expireType, expireTime);
|
||||
|
||||
if (aNewState == "block") {
|
||||
return;
|
||||
}
|
||||
if (aNewState == "block") {
|
||||
return;
|
||||
}
|
||||
|
||||
// Manually activate the plugins that would have been automatically
|
||||
@ -771,7 +766,8 @@ var gPluginHandler = {
|
||||
fallbackType == plugin.PLUGIN_BLOCKLISTED;
|
||||
});
|
||||
let dismissed = notification ? notification.dismissed : true;
|
||||
if (aPrimaryPlugin)
|
||||
// Always show the doorhanger if the anchor is not available.
|
||||
if (!isElementVisible(gURLBar) || aPrimaryPlugin)
|
||||
dismissed = false;
|
||||
|
||||
let primaryPluginPermission = null;
|
||||
|
@ -755,7 +755,6 @@ var gBrowserInit = {
|
||||
gBrowser.addEventListener("PluginCrashed", gPluginHandler, true);
|
||||
gBrowser.addEventListener("PluginOutdated", gPluginHandler, true);
|
||||
gBrowser.addEventListener("PluginInstantiated", gPluginHandler, true);
|
||||
gBrowser.addEventListener("PluginRemoved", gPluginHandler, true);
|
||||
|
||||
gBrowser.addEventListener("NewPluginInstalled", gPluginHandler.newPluginInstalled, true);
|
||||
|
||||
|
@ -1574,19 +1574,12 @@
|
||||
this.appendChild(item);
|
||||
this._items.push(item);
|
||||
}
|
||||
switch (this.notification.options.centerActions.length) {
|
||||
case 0:
|
||||
PopupNotifications._dismiss();
|
||||
break;
|
||||
case 1:
|
||||
this._setState(this._states.SINGLE);
|
||||
break;
|
||||
default:
|
||||
if (this.notification.options.primaryPlugin) {
|
||||
this._setState(this._states.MULTI_COLLAPSED);
|
||||
} else {
|
||||
this._setState(this._states.MULTI_EXPANDED);
|
||||
}
|
||||
if (this.notification.options.centerActions.length == 1) {
|
||||
this._setState(this._states.SINGLE);
|
||||
} else if (this.notification.options.primaryPlugin) {
|
||||
this._setState(this._states.MULTI_COLLAPSED);
|
||||
} else {
|
||||
this._setState(this._states.MULTI_EXPANDED);
|
||||
}
|
||||
]]></constructor>
|
||||
<method name="_setState">
|
||||
@ -1652,7 +1645,7 @@
|
||||
button2 = {
|
||||
label: "pluginContinue.label",
|
||||
accesskey: "pluginContinue.accesskey",
|
||||
action: "_singleContinue",
|
||||
action: "_cancel",
|
||||
default: true
|
||||
};
|
||||
switch (action.blocklistState) {
|
||||
@ -1826,14 +1819,6 @@
|
||||
this._cancel();
|
||||
]]></body>
|
||||
</method>
|
||||
<method name="_singleContinue">
|
||||
<body><![CDATA[
|
||||
gPluginHandler._updatePluginPermission(this.notification,
|
||||
this.notification.options.centerActions[0],
|
||||
"continue");
|
||||
this._cancel();
|
||||
]]></body>
|
||||
</method>
|
||||
<method name="_multiAccept">
|
||||
<body><![CDATA[
|
||||
for (let item of this._items) {
|
||||
|
@ -196,36 +196,26 @@ CheckPluginStopEvent::Run()
|
||||
*/
|
||||
class nsSimplePluginEvent : public nsRunnable {
|
||||
public:
|
||||
nsSimplePluginEvent(nsIContent* aTarget, const nsAString &aEvent)
|
||||
: mTarget(aTarget)
|
||||
, mDocument(aTarget->GetCurrentDoc())
|
||||
, mEvent(aEvent)
|
||||
{
|
||||
}
|
||||
|
||||
nsSimplePluginEvent(nsIDocument* aTarget, const nsAString& aEvent)
|
||||
: mTarget(aTarget)
|
||||
, mDocument(aTarget)
|
||||
, mEvent(aEvent)
|
||||
{
|
||||
}
|
||||
nsSimplePluginEvent(nsIContent* aContent, const nsAString &aEvent)
|
||||
: mContent(aContent),
|
||||
mEvent(aEvent)
|
||||
{}
|
||||
|
||||
~nsSimplePluginEvent() {}
|
||||
|
||||
NS_IMETHOD Run();
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsISupports> mTarget;
|
||||
nsCOMPtr<nsIDocument> mDocument;
|
||||
nsCOMPtr<nsIContent> mContent;
|
||||
nsString mEvent;
|
||||
};
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSimplePluginEvent::Run()
|
||||
{
|
||||
LOG(("OBJLC [%p]: nsSimplePluginEvent firing event \"%s\"", mTarget.get(),
|
||||
LOG(("OBJLC [%p]: nsSimplePluginEvent firing event \"%s\"", mContent.get(),
|
||||
mEvent.get()));
|
||||
nsContentUtils::DispatchTrustedEvent(mDocument, mTarget,
|
||||
nsContentUtils::DispatchTrustedEvent(mContent->GetDocument(), mContent,
|
||||
mEvent, true, true);
|
||||
return NS_OK;
|
||||
}
|
||||
@ -684,9 +674,7 @@ nsObjectLoadingContent::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||
/// would keep the docshell around, but trash the frameloader
|
||||
UnloadObject();
|
||||
}
|
||||
nsCOMPtr<nsIRunnable> ev = new nsSimplePluginEvent(thisContent->GetCurrentDoc(),
|
||||
NS_LITERAL_STRING("PluginRemoved"));
|
||||
NS_DispatchToCurrentThread(ev);
|
||||
|
||||
}
|
||||
|
||||
nsObjectLoadingContent::nsObjectLoadingContent()
|
||||
|
@ -1192,11 +1192,9 @@ PluginModuleParent::NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs
|
||||
uint32_t flags = 0;
|
||||
|
||||
if (!CallNP_Initialize(flags, error)) {
|
||||
mShutdown = true;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
else if (*error != NPERR_NO_ERROR) {
|
||||
mShutdown = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1222,14 +1220,8 @@ PluginModuleParent::NP_Initialize(NPNetscapeFuncs* bFuncs, NPError* error)
|
||||
flags |= kAllowAsyncDrawing;
|
||||
#endif
|
||||
|
||||
if (!CallNP_Initialize(flags, error)) {
|
||||
mShutdown = true;
|
||||
if (!CallNP_Initialize(flags, error))
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
if (*error != NPERR_NO_ERROR) {
|
||||
mShutdown = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#if defined XP_WIN
|
||||
// Send the info needed to join the chrome process's audio session to the
|
||||
|
Loading…
Reference in New Issue
Block a user