Bug 903965 - nsWebNavigationInfo now checks if the docShell wants plugins before loading them. r=smaug

--HG--
extra : rebase_source : 6dfa90bc1906a36b7d40ccf4c5ccddea44b180de
This commit is contained in:
Mark Hammond 2013-08-13 15:06:05 +10:00
Родитель c01dcfbb59
Коммит 5b0da5cb47
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -9,6 +9,7 @@
#include "nsServiceManagerUtils.h"
#include "nsIDocumentLoaderFactory.h"
#include "nsIPluginHost.h"
#include "nsIDocShell.h"
#include "nsContentUtils.h"
#include "imgLoader.h"
@ -50,7 +51,15 @@ nsWebNavigationInfo::IsTypeSupported(const nsACString& aType,
if (*aIsTypeSupported) {
return rv;
}
// If this request is for a docShell that isn't going to allow plugins,
// there's no need to try and find a plugin to handle it.
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aWebNav));
bool allowed;
if (docShell && NS_SUCCEEDED(docShell->GetAllowPlugins(&allowed)) && !allowed) {
return NS_OK;
}
// Try reloading plugins in case they've changed.
nsCOMPtr<nsIPluginHost> pluginHost =
do_GetService(MOZ_PLUGIN_HOST_CONTRACTID);