bug=23775
This is the last bit of the checkin that George Drapeau started
for bug 23775.  He didn't finish due to conflicts with this file
and, being the good engineer that he is, he waited for the author
to return from vacation.

George said I could check this in under the same approval for
the rest of 23775.
This commit is contained in:
edburns%acm.org 2000-06-30 17:31:02 +00:00
Родитель e122d3f4c1
Коммит 2a2fd82d21
2 изменённых файлов: 118 добавлений и 2 удалений

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

@ -1656,6 +1656,27 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateEmbededPlugin(const char *aMimeType,
return rv;
}
if (tagType == nsPluginTagType_Applet) {
nsCOMPtr<nsIPref> prefs(do_GetService(kPrefServiceCID));
// see if java is enabled
if (prefs) {
rv = prefs->GetBoolPref("security.enable_java", &isJavaEnabled);
if (NS_SUCCEEDED(rv)) {
// if not, don't show this plugin
if (!isJavaEnabled) {
return NS_ERROR_FAILURE;
}
}
else {
// if we were unable to get the pref, assume java is enabled
// and rely on the "find the plugin or not" logic.
// make sure the value wasn't modified in GetBoolPref
isJavaEnabled = PR_TRUE;
}
}
}
#ifdef NS_DEBUG
if(!aMimeType)
printf("InstantiateEmbededPlugin for %s\n",aMimeType);
@ -1781,11 +1802,48 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateFullPagePlugin(const char *aMimeType,
nsresult rv;
nsIURI *url;
PRBool isJavaEnabled = PR_TRUE;
nsCOMPtr<nsIPluginTagInfo2> pti2 = nsnull;
nsPluginTagType tagType;
#ifdef NS_DEBUG
printf("InstantiateFullPagePlugin for %s\n",aMimeType);
#endif
rv = aOwner->QueryInterface(kIPluginTagInfo2IID, getter_AddRefs(pti2));
if(rv != NS_OK) {
return rv;
}
rv = pti2->GetTagType(&tagType);
if((rv != NS_OK) || !((tagType == nsPluginTagType_Embed)
|| (tagType == nsPluginTagType_Applet)
|| (tagType == nsPluginTagType_Object)))
{
return rv;
}
if (tagType == nsPluginTagType_Applet) {
nsCOMPtr<nsIPref> prefs(do_GetService(kPrefServiceCID));
// see if java is enabled
if (prefs) {
rv = prefs->GetBoolPref("security.enable_java", &isJavaEnabled);
if (NS_SUCCEEDED(rv)) {
// if not, don't show this plugin
if (!isJavaEnabled) {
return NS_ERROR_FAILURE;
}
}
else {
// if we were unable to get the pref, assume java is enabled
// and rely on the "find the plugin or not" logic.
// make sure the value wasn't modified in GetBoolPref
isJavaEnabled = PR_TRUE;
}
}
}
//create a URL so that the instantiator can do file ext.
//based plugin lookups...
rv = NS_NewURI(&url, aURLSpec);

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

@ -1656,6 +1656,27 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateEmbededPlugin(const char *aMimeType,
return rv;
}
if (tagType == nsPluginTagType_Applet) {
nsCOMPtr<nsIPref> prefs(do_GetService(kPrefServiceCID));
// see if java is enabled
if (prefs) {
rv = prefs->GetBoolPref("security.enable_java", &isJavaEnabled);
if (NS_SUCCEEDED(rv)) {
// if not, don't show this plugin
if (!isJavaEnabled) {
return NS_ERROR_FAILURE;
}
}
else {
// if we were unable to get the pref, assume java is enabled
// and rely on the "find the plugin or not" logic.
// make sure the value wasn't modified in GetBoolPref
isJavaEnabled = PR_TRUE;
}
}
}
#ifdef NS_DEBUG
if(!aMimeType)
printf("InstantiateEmbededPlugin for %s\n",aMimeType);
@ -1781,11 +1802,48 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateFullPagePlugin(const char *aMimeType,
nsresult rv;
nsIURI *url;
PRBool isJavaEnabled = PR_TRUE;
nsCOMPtr<nsIPluginTagInfo2> pti2 = nsnull;
nsPluginTagType tagType;
#ifdef NS_DEBUG
printf("InstantiateFullPagePlugin for %s\n",aMimeType);
#endif
rv = aOwner->QueryInterface(kIPluginTagInfo2IID, getter_AddRefs(pti2));
if(rv != NS_OK) {
return rv;
}
rv = pti2->GetTagType(&tagType);
if((rv != NS_OK) || !((tagType == nsPluginTagType_Embed)
|| (tagType == nsPluginTagType_Applet)
|| (tagType == nsPluginTagType_Object)))
{
return rv;
}
if (tagType == nsPluginTagType_Applet) {
nsCOMPtr<nsIPref> prefs(do_GetService(kPrefServiceCID));
// see if java is enabled
if (prefs) {
rv = prefs->GetBoolPref("security.enable_java", &isJavaEnabled);
if (NS_SUCCEEDED(rv)) {
// if not, don't show this plugin
if (!isJavaEnabled) {
return NS_ERROR_FAILURE;
}
}
else {
// if we were unable to get the pref, assume java is enabled
// and rely on the "find the plugin or not" logic.
// make sure the value wasn't modified in GetBoolPref
isJavaEnabled = PR_TRUE;
}
}
}
//create a URL so that the instantiator can do file ext.
//based plugin lookups...
rv = NS_NewURI(&url, aURLSpec);