Making it so that we handle known image decoder mime types internally by default unless pref("plugin.override_internal_types", true); fixing bug 131230 r=av,biesi sr=beard a=asa

git-svn-id: svn://10.0.0.236/trunk@117464 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterlubczynski%netscape.com
2002-03-26 06:30:33 +00:00
parent 7d3010414d
commit cb72b75c9c
5 changed files with 31 additions and 2 deletions

View File

@@ -677,3 +677,7 @@ pref("alerts.height", 50);
pref("update_notifications.enabled", true);
pref("update_notifications.provider.0.frequency", 7); // number of days
pref("update_notifications.provider.0.datasource", "chrome://communicator-region/locale/region.properties");
// if true, allow plug-ins to override internal imglib decoder mime types in full-page mode
pref("plugin.override_internal_types", false);

View File

@@ -56,6 +56,7 @@ REQUIRES = xpcom \
docshell \
webbrwsr \
windowwatcher \
imglib2 \
$(NULL)
# for xlib port
REQUIRES += xlibxtbin xlibrgb

View File

@@ -52,6 +52,7 @@ REQUIRES = xpcom \
webBrowser_core \
windowwatcher \
gfx \
imglib2 \
$(NULL)
DEFINES =-D_IMPL_NS_PLUGIN -DWIN32_LEAN_AND_MEAN

View File

@@ -149,6 +149,8 @@
#include "nsUnicharUtils.h"
#include "imgILoader.h"
#ifdef XP_UNIX
#if defined(MOZ_WIDGET_GTK)
#include <gdk/gdkx.h> // for GDK_DISPLAY()
@@ -2526,6 +2528,13 @@ nsPluginHostImpl::nsPluginHostImpl()
mDontShowBadPluginMessage = PR_FALSE;
mIsDestroyed = PR_FALSE;
mUnusedLibraries = nsnull;
mOverrideInternalTypes = PR_FALSE;
// check to see if pref is set at startup to let plugins take over in
// full page mode for certain image mime types that we handle internally
nsCOMPtr<nsIPref> prefs(do_GetService(kPrefServiceCID));
if (prefs)
prefs->GetBoolPref("plugin.override_internal_types", &mOverrideInternalTypes);
nsCOMPtr<nsIObserverService> obsService = do_GetService("@mozilla.org/observer-service;1");
if (obsService)
@@ -3681,8 +3690,21 @@ nsresult nsPluginHostImpl::RegisterPluginMimeTypesWithLayout(nsPluginTag * plugi
if (!obsoleteManager)
return rv;
for(int i = 0; i < pluginTag->mVariants; i++)
{
nsCOMPtr<imgILoader> loader;
if (!mOverrideInternalTypes)
loader = do_GetService("@mozilla.org/image/loader;1");
for(int i = 0; i < pluginTag->mVariants; i++) {
// Do not register any doc loader factory content viewers for mime types we do internally
// Note: This excludes plugins of these mime types from running in full-page mode.
// This gets around Quicktime's default handling of PNG's
PRBool bIsSupportedImage = PR_FALSE;
if (!mOverrideInternalTypes &&
NS_SUCCEEDED(loader->SupportImageWithMimeType(pluginTag->mMimeTypeArray[i], &bIsSupportedImage)) &&
bIsSupportedImage)
continue;
static NS_DEFINE_CID(kPluginDocLoaderFactoryCID, NS_PLUGINDOCLOADERFACTORY_CID);
nsCAutoString contractid(NS_DOCUMENT_LOADER_FACTORY_CONTRACTID_PREFIX "view;1?type=");

View File

@@ -472,6 +472,7 @@ private:
PRBool mPluginsLoaded;
PRBool mDontShowBadPluginMessage;
PRBool mIsDestroyed;
PRBool mOverrideInternalTypes; // set by pref plugin.override_internal_types
nsActivePluginList mActivePluginList;
nsUnusedLibrary *mUnusedLibraries;