Bug 883404 - Add a object.reload() call for chrome to de-activate plugins. r=josh

This commit is contained in:
John Schoenick 2013-06-18 14:35:26 -07:00
parent 52b9644728
commit 1383b35b3b
4 changed files with 33 additions and 1 deletions

View File

@ -25,7 +25,7 @@ class nsNPAPIPluginInstance;
* interface to mirror this interface when changing it.
*/
[scriptable, uuid(070bfc7f-f8b8-4e84-aa31-a0bfaffa8e8e)]
[scriptable, uuid(16c14177-52eb-49d3-9842-a1a0b92be11a)]
interface nsIObjectLoadingContent : nsISupports
{
/**
@ -133,6 +133,14 @@ interface nsIObjectLoadingContent : nsISupports
*/
void playPlugin();
/**
* Forces a re-evaluation and reload of the tag, optionally invalidating its
* click-to-play state. This can be used when the MIME type that provides a
* type has changed, for instance, to force the tag to re-evalulate the
* handler to use.
*/
void reload(in boolean aClearActivation);
/**
* This attribute will return true if the current content type has been
* activated, either explicitly or by passing checks that would have it be

View File

@ -2894,6 +2894,17 @@ nsObjectLoadingContent::PlayPlugin()
return NS_OK;
}
NS_IMETHODIMP
nsObjectLoadingContent::Reload(bool aClearActivation)
{
if (aClearActivation) {
mActivated = false;
mPlayPreviewCanceled = false;
}
return LoadObject(true, true);
}
NS_IMETHODIMP
nsObjectLoadingContent::GetActivated(bool *aActivated)
{

View File

@ -179,6 +179,10 @@ class nsObjectLoadingContent : public nsImageLoadingContent
{
aRv = PlayPlugin();
}
void Reload(bool aClearActivation, mozilla::ErrorResult& aRv)
{
aRv = Reload(aClearActivation);
}
bool Activated() const
{
return mActivated;

View File

@ -162,6 +162,15 @@ interface MozObjectLoadingContent {
[ChromeOnly, Throws]
void playPlugin();
/**
* Forces a re-evaluation and reload of the tag, optionally invalidating its
* click-to-play state. This can be used when the MIME type that provides a
* type has changed, for instance, to force the tag to re-evalulate the
* handler to use.
*/
[ChromeOnly, Throws]
void reload(boolean aClearActivation);
/**
* This attribute will return true if the current content type has been
* activated, either explicitly or by passing checks that would have it be